/* Consultation Popup – popup.css
   RTL · Mobile-first · No layout-shift
   ─────────────────────────────────── */

/* Overlay */
#cpp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    direction: rtl;
    /* hidden via [hidden] attribute; animate with class */
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
    font-family: inherit;
}

#cpp-overlay.cpp-show {
    opacity: 1;
    visibility: visible;
}

/* Modal box */
#cpp-modal {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px 32px;
    width: min(90vw, 460px);          /* ~30% on 1440px wide screens */
    max-height: min(90vh, 640px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    transform: translateY(24px) scale(.97);
    transition: transform .28s ease;
    font-family: inherit;
}

#cpp-overlay.cpp-show #cpp-modal {
    transform: translateY(0) scale(1);
}

/* Close button – top-right (RTL: left visually = right in RTL) */
#cpp-close {
    position: absolute;
    top: 12px;
    left: 14px;           /* left in RTL = visual right */
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #888;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}
#cpp-close:hover { color: #333; background: #f0f0f0; }
#cpp-close:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

/* Title */
#cpp-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 24px;
    line-height: 1.7;
    padding-left: 28px;   /* space so text doesn't clash with close btn */
}

/* Fields */
.cpp-field {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cpp-field label {
    font-size: .85rem;
    font-weight: 600;
    color: #374151;
}

.cpp-field select,
.cpp-field input[type="tel"] {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 3px;            /* requirement: 3px */
    font-size: .95rem;
    font-family: inherit;
    color: #111;
    background: #fafafa;
    transition: border-color .18s, box-shadow .18s;
    outline: none;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}

.cpp-field select:focus,
.cpp-field input[type="tel"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
    background: #fff;
}

/* Message area */
#cpp-msg {
    min-height: 20px;
    margin-bottom: 14px;
    font-size: .88rem;
    border-radius: 6px;
    padding: 0;
    text-align: center;
}
#cpp-msg.cpp-error {
    color: #b91c1c;
    background: #fef2f2;
    padding: 8px 12px;
    border: 1px solid #fca5a5;
}
#cpp-msg.cpp-success {
    color: #166534;
    background: #f0fdf4;
    padding: 8px 12px;
    border: 1px solid #86efac;
}

/* Submit button */
#cpp-submit {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .18s, transform .1s;
    letter-spacing: .5px;
}
#cpp-submit:hover  { background: #1d4ed8; }
#cpp-submit:active { transform: scale(.98); }
#cpp-submit:disabled { background: #93c5fd; cursor: not-allowed; }
#cpp-submit:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (min-width: 1024px) {
    #cpp-modal {
        width: 30vw;
        min-width: 360px;
        max-width: 520px;
    }
}

@media (max-width: 480px) {
    #cpp-modal {
        width: 95vw;
        padding: 28px 20px 24px;
    }
    #cpp-title { font-size: .95rem; }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    #cpp-overlay,
    #cpp-modal { transition: none; }
}
