:root {
    --trw-primary: #905d47;
    --trw-bg: #f7f7f7;
    --trw-text: #2c2c2c;
    --trw-muted: #666;
    --trw-border: #d7d7d7;
}

.trw-modalform-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.trw-modalform-modal {
    width: 100%;
    max-width: 520px;
    background: var(--trw-bg);
    border-radius: 16px;
    padding: 18px;
    position: relative;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
    max-height: calc(100vh - 28px);
    overflow: auto;
    border: 1px solid #ececec;
}

.trw-modalform-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    background: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #6d6d6d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.trw-modalform-logo-wrap {
    text-align: center;
    margin: 4px 0 12px;
}

.trw-modalform-logo {
    max-width: 220px;
    width: 100%;
    height: auto;
}

.trw-modalform-title {
    text-align: center;
    margin: 0 0 16px;
    font-size: clamp(22px, 2.8vw, 34px);
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--trw-text);
    font-weight: 700;
}

.trw-modalform label {
    display: block;
    margin-bottom: 6px;
    color: #3f3f3f;
    font-size: 16px;
    font-weight: 600;
}

.trw-modalform input[type="text"],
.trw-modalform input[type="email"],
.trw-modalform textarea {
    width: 100%;
    border: 1px solid var(--trw-border);
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 13px;
    font-size: 15px;
    line-height: 1.35;
    color: #1f1f1f;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.trw-modalform input[type="text"]:focus,
.trw-modalform input[type="email"]:focus,
.trw-modalform textarea:focus {
    outline: none;
    border-color: var(--trw-primary);
    box-shadow: 0 0 0 3px rgba(144, 93, 71, 0.15);
}

.trw-modalform textarea {
    min-height: 110px;
    resize: vertical;
}

.trw-modalform-check {
    display: flex !important;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 8px !important;
    font-size: 15px !important;
    line-height: 1.42;
    color: var(--trw-muted) !important;
    font-weight: 400 !important;
}

.trw-modalform-check input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.trw-modalform-check a {
    color: var(--trw-primary);
    text-decoration: underline;
}

.trw-btn-submit,
.trw-btn-phone {
    display: block;
    width: 100%;
    border-radius: 10px;
    border: 0;
    text-align: center;
    padding: 13px 14px;
    font-size: clamp(16px, 1.7vw, 20px);
    line-height: 1.12;
    font-weight: 700;
    margin-top: 9px;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: filter 0.2s ease, background-color 0.2s ease;
}

.trw-btn-submit {
    background: var(--trw-primary) !important;
    color: #fff !important;
    cursor: pointer;
}

.trw-btn-submit:hover,
.trw-btn-phone:hover {
    filter: brightness(0.94);
}

.trw-btn-phone {
    background: var(--trw-primary) !important;
    color: #fff !important;
}

.trw-btn-phone:visited,
.trw-btn-phone:hover,
.trw-btn-phone:focus,
.trw-btn-phone:active,
.trw-btn-submit:visited,
.trw-btn-submit:focus,
.trw-btn-submit:active {
    color: #fff !important;
    text-decoration: none !important;
}

#trw-modalform-overlay .trw-btn-submit,
#trw-modalform-overlay .trw-btn-phone {
    background-color: var(--trw-primary) !important;
    border-color: var(--trw-primary) !important;
}

.trw-modalform-response {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
}

.trw-modalform-response.is-success {
    color: #0a7a33;
}

.trw-modalform-response.is-error {
    color: #b52323;
}

.trw-inline-form-wrap {
    background: #ffffff;
    border: 1px solid #eadfd8;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.trw-inline-form-title {
    margin: 0 0 10px;
    color: #4b4b4b;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.trw-inline-form input[type="text"],
.trw-inline-form input[type="email"],
.trw-inline-form textarea {
    font-size: 13px;
    padding: 9px 10px;
    margin-bottom: 9px;
    border-radius: 8px;
}

.trw-inline-form textarea {
    min-height: 74px;
}

.trw-inline-form .trw-modalform-check {
    font-size: 11px !important;
    margin-bottom: 8px !important;
}

.trw-inline-form .trw-modalform-check input {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
}

.trw-inline-form .trw-btn-submit {
    margin-top: 4px;
    font-size: 16px;
    padding: 9px 10px;
    border-radius: 999px;
}

@media (max-width: 640px) {
    .trw-modalform-overlay {
        align-items: flex-start;
        padding: 10px;
    }

    .trw-modalform-modal {
        max-width: 100%;
        padding: 14px;
        border-radius: 14px;
        max-height: calc(100vh - 20px);
    }

    .trw-modalform-title {
        font-size: 22px;
        margin-bottom: 14px;
    }

    .trw-modalform label {
        font-size: 14px;
    }

    .trw-modalform input[type="text"],
    .trw-modalform input[type="email"],
    .trw-modalform textarea {
        font-size: 16px;
        padding: 11px 12px;
        margin-bottom: 11px;
    }

    .trw-modalform-check {
        font-size: 13px !important;
        gap: 8px;
    }

    .trw-modalform-check input {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }

    .trw-btn-submit,
    .trw-btn-phone {
        font-size: 18px;
        padding: 11px 12px;
    }

    .trw-inline-form-wrap {
        padding: 12px;
    }
}

@media (max-width: 420px) {
    .trw-modalform-title {
        font-size: 20px;
    }

    .trw-btn-submit,
    .trw-btn-phone {
        font-size: 17px;
    }
}
