/* ═══════════════════════════════════════════════════════
   MODAL — shared contact form popup (all pages)
═══════════════════════════════════════════════════════ */

/* ── Backdrop ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(20, 28, 32, 0.68);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* ── Card ── */
.modal-card {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 472px;
    position: relative;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.12),
        0 28px 72px rgba(0, 0, 0, 0.24);
    overflow: hidden;
    transform: translateY(32px) scale(0.96);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-overlay.is-open .modal-card {
    transform: translateY(0) scale(1);
}

/* Red top accent stripe */
.modal-card::before {
    content: "";
    display: block;
    height: 4px;
    background: #e53935;
    flex-shrink: 0;
}

/* ── Close button ── */
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #c0c0c0;
    transition:
        color 0.15s,
        background 0.15s;
    z-index: 2;
    flex-shrink: 0;
}
.modal-close:hover {
    color: #e53935;
    background: #fff5f5;
}

/* ── Header ── */
.modal-head {
    padding: 22px 28px 6px;
}
.modal-logo-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
    margin-bottom: 13px;
    flex-shrink: 0;
}
.modal-title {
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    font-size: 19px;
    color: #1f2a2e;
    line-height: 1.2;
    margin: 0 0 5px;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    padding-right: 36px; /* don't overlap close btn */
}
.modal-sub {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
    margin: 0;
}

/* ── Form wrapper ── */
.modal-form {
    padding: 16px 28px 28px;
}

/* Promise bar */
.modal-promise {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    border-left: 3px solid #e53935;
    border-radius: 0 7px 7px 0;
    padding: 9px 14px;
    margin-bottom: 20px;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: #444;
    line-height: 1.4;
}
.modal-promise svg {
    flex-shrink: 0;
    color: #e53935;
}

/* Fields */
.modal-field {
    margin-bottom: 13px;
}
.modal-label {
    display: block;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    font-size: 10.5px;
    color: #555;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.modal-req {
    color: #e53935;
    margin-left: 2px;
}
.modal-optional {
    color: #bbb;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

/* Inputs, selects, textarea */
.modal-input,
.modal-select,
.modal-textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: "Inter", "Montserrat", sans-serif;
    font-size: 14px;
    color: #1f2a2e;
    background: #f8f8f8;
    border: 1.5px solid #e5e5e5;
    border-radius: 8px;
    padding: 11px 14px;
    transition:
        border-color 0.15s,
        background 0.15s,
        box-shadow 0.15s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}
.modal-input::placeholder,
.modal-textarea::placeholder {
    color: #c0c0c0;
}
.modal-input:focus,
.modal-select:focus,
.modal-textarea:focus {
    border-color: #e53935;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}
.modal-input.modal-error,
.modal-select.modal-error {
    border-color: #e53935;
    background: #fff9f9;
    animation: modalShake 0.3s ease;
}
.modal-textarea {
    resize: vertical;
    min-height: 78px;
    line-height: 1.55;
}
/* Custom select arrow */
.modal-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
    color: #1f2a2e;
}
.modal-select option[value=""] {
    color: #c0c0c0;
}

/* Submit button */
.modal-submit {
    width: 100%;
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 14px 20px;
    cursor: pointer;
    transition:
        background 0.2s,
        transform 0.15s;
    margin-top: 8px;
}
.modal-submit:hover {
    background: #c62828;
}
.modal-submit:active {
    transform: translateY(1px);
}

/* Privacy note */
.modal-form-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
    color: #b71c1c;
    background: #ffebee;
    border-radius: 8px;
    text-align: center;
}

.modal-privacy {
    font-size: 10.5px;
    color: #c0c0c0;
    text-align: center;
    margin: 9px 0 0;
    line-height: 1.5;
}
.modal-privacy a {
    color: #8f9699;
    border-bottom: 1px solid #d9dcdd;
}
.modal-privacy a:hover {
    color: #e53935;
    border-bottom-color: #e53935;
}

/* ── Success state ── */
/* Explicit override: CSS display:flex must not win over the hidden attribute */
.modal-form[hidden],
.modal-success[hidden] {
    display: none !important;
}

.modal-success {
    padding: 38px 28px 44px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.modal-success-icon {
    width: 70px;
    height: 70px;
    background: #fff5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}
.modal-success-title {
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    font-size: 20px;
    color: #1f2a2e;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin: 0 0 10px;
}
.modal-success-text {
    font-size: 13.5px;
    color: #666;
    line-height: 1.65;
    margin: 0 0 18px;
    max-width: 320px;
}
.modal-success-phone {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #e53935;
    letter-spacing: 0.02em;
    margin: 0 0 26px;
    text-decoration: none;
}
.modal-success-phone:hover {
    text-decoration: underline;
}
.modal-success-close {
    background: #1f2a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 12px 30px;
    cursor: pointer;
    transition: background 0.2s;
}
.modal-success-close:hover {
    background: #2d3f47;
}

/* ── Shake animation for validation ── */
@keyframes modalShake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* ── Responsive: bottom sheet on mobile ── */
@media (max-width: 520px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .modal-card {
        border-radius: 18px 18px 0 0;
        max-width: 100%;
        transform: translateY(100%);
        max-height: 92svh;
        overflow-y: auto;
    }
    .modal-overlay.is-open .modal-card {
        transform: translateY(0);
    }
}
