/* ============================================================
   Contact Advertiser Modal
   ============================================================ */

/* ---- Desktop: wide rectangle, two-column layout ---- */
.contact-advertiser-modal {
    z-index: 1085;
}

.modal-backdrop.contact-modal-backdrop {
    z-index: 1080;
}

.contact-advertiser-modal .modal-dialog {
    max-width: 800px;
    transition: max-width 0.28s ease;
}

.contact-advertiser-modal.contact-state-collapsed .modal-dialog {
    max-width: 440px;
}

.contact-advertiser-modal .modal-content {
    border: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.18);
}

.contact-advertiser-modal .modal-header {
    padding: 15px 24px 13px;
    border-bottom: 1px solid #f0f2f6;
    align-items: center;
}

.contact-advertiser-modal .modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #172033;
    margin-bottom: 2px;
}

.contact-advertiser-modal .btn-close {
    opacity: 0.5;
}

.contact-advertiser-modal .btn-close:hover {
    opacity: 1;
}

.contact-advertiser-modal .modal-body {
    padding: 20px 24px 24px;
    display: flex;
    gap: 18px;
    align-items: stretch;
}

.contact-advertiser-modal.contact-state-collapsed .modal-body {
    display: block;
}

/* Left column: hero card */
.contact-left-col {
    flex: 0 0 auto;
    width: 46%;
    display: flex;
    flex-direction: column;
}

.contact-advertiser-modal.contact-state-collapsed .contact-left-col {
    width: 100%;
}

/* Right column: action buttons + capture form */
.contact-right-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-advertiser-modal.contact-state-collapsed .contact-right-col {
    display: none;
}

.contact-contact-hero {
    background: linear-gradient(145deg, #fdfbf8 0%, #ffffff 55%, #f6f8ff 100%);
    border: 1px solid #ece8e1;
    border-radius: 18px;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.contact-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.contact-role-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #fff8f0;
    border: 1px solid #f5dfc0;
    color: #92520c;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Icon badges replacing status dots */
.contact-badge-icons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.contact-badge-wa,
.contact-badge-call {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.contact-badge-wa {
    background: #eafaf2;
    border: 1.5px solid #a7e9c1;
    color: #18a34f;
    font-size: 1rem;
}

.contact-badge-call {
    background: #fff4ef;
    border: 1.5px solid #fbcfb3;
    color: #d95a14;
    font-size: 0.85rem;
}

.contact-hero-main {
    display: flex;
    gap: 16px;
    align-items: center;
}

.contact-avatar {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.22);
    flex: 0 0 auto;
    letter-spacing: 0.03em;
}

.contact-identity {
    min-width: 0;
    flex: 1;
}

.contact-identity h4 {
    margin: 0 0 3px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #172033;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-company {
    margin: 0 0 4px;
    font-size: 0.85rem;
    color: #6b7280;
}

.contact-phone-mask {
    margin: 0;
    font-size: 0.975rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #1f2937;
    font-family: ui-monospace, 'Courier New', monospace;
}

.contact-property-note {
    margin: 14px 0 0;
    padding: 11px 14px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #ece8df;
    color: #4b5563;
    font-size: 0.85rem;
    line-height: 1.5;
    flex: none;
}

.contact-expand-details-btn {
    margin-top: 14px;
    width: 100%;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #ff8a3d 0%, #ff612f 100%);
    color: #fff;
    font-size: 0.96rem;
    font-weight: 700;
    padding: 14px 18px;
    box-shadow: 0 16px 28px rgba(255, 113, 55, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.contact-expand-details-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(255, 113, 55, 0.28);
}

.contact-expand-details-btn:focus-visible {
    outline: 3px solid rgba(255, 123, 63, 0.22);
    outline-offset: 2px;
}

.contact-capture-box {
    border: 1px solid #e8ebf2;
    border-radius: 16px;
    background: #fdfdff;
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.contact-capture-box form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.contact-reveal-spacer {
    flex: 1;
}

.contact-capture-title {
    margin: 0 0 14px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #172033;
}

.contact-field {
    margin-bottom: 11px;
}

.contact-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #374151;
}

.contact-dealer-options {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.contact-choice-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.contact-choice-input {
    position: static;
    opacity: 1;
    pointer-events: auto;
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: #4f46e5;
    cursor: pointer;
}

.contact-choice-pill {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #334155;
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 600;
    line-height: 1;
    transition: color 0.15s ease;
}

.contact-choice-input:checked + .contact-choice-pill {
    color: #1f2937;
    font-weight: 700;
}

.contact-choice-input:focus-visible + .contact-choice-pill {
    outline: 2px solid rgba(79, 70, 229, 0.2);
    outline-offset: 2px;
    border-radius: 3px;
}

.contact-choice-pill:hover {
    color: #0f172a;
}

.contact-choice-pill span {
    line-height: 1;
}

.contact-field input[type="text"],
.contact-field input[type="tel"] {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1.5px solid #dde1ec;
    background: #f9fafb;
    outline: none;
    font-size: 0.94rem;
    color: #111827;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.contact-field input[type="text"]:focus,
.contact-field input[type="tel"]:focus {
    background: #fff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.contact-error {
    font-size: 0.82rem;
    color: #dc2626;
    min-height: 16px;
    margin-bottom: 2px;
}

.contact-error.is-success {
    color: #15803d;
}

.contact-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0 14px;
    color: #6b7280;
    font-size: 0.82rem;
    line-height: 1.45;
    cursor: pointer;
}

.contact-consent input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #4f46e5;
    cursor: pointer;
}

.contact-reveal-btn, .contact-verify-otp-btn {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #ff8a4c 0%, #ff5c1a 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 22px rgba(255, 92, 26, 0.28);
    transition: opacity 0.2s ease, transform 0.15s ease;
    cursor: pointer;
}

.contact-reveal-btn:hover:not(:disabled),
.contact-verify-otp-btn:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px);
}

.contact-reveal-btn:active:not(:disabled),
.contact-verify-otp-btn:active:not(:disabled) {
    transform: translateY(0);
}

.contact-reveal-btn:disabled,
.contact-verify-otp-btn:disabled {
    opacity: 0.65;
    cursor: default;
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    box-shadow: none;
}

.contact-send-hint {
    margin: 8px 0 0;
    padding: 9px 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px dashed #cfd8e6;
    color: #64748b;
    font-size: 0.76rem;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.contact-otp-box {
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.contact-otp-header {
    margin-bottom: 10px;
}

.contact-otp-title {
    margin: 0 0 4px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #172033;
}

.contact-otp-copy {
    margin: 0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.45;
}

.contact-otp-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.contact-otp-input {
    width: 100%;
    min-width: 0;
    height: 46px;
    border: 1.5px solid #d7ddea;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-otp-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.contact-otp-error {
    margin-top: 10px;
    margin-bottom: 0;
}

.contact-otp-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.contact-verify-otp-btn {
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.2);
}

.contact-resend-otp-btn {
    align-self: center;
    border: 0;
    background: transparent;
    color: #4f46e5;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.contact-resend-otp-btn:hover {
    color: #3730a3;
}

.contact-revealed-note {
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    background: #f0fdf5;
    border: 1px solid #bbf7d0;
    color: #15803d;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-message-box {
    border: 1px solid #e8ebf2;
    border-radius: 16px;
    background: #fdfdff;
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-message-label {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #172033;
    display: flex;
    align-items: center;
    gap: 7px;
}

.contact-message-label .fa-whatsapp {
    color: #25d366;
    font-size: 1.1rem;
}

.contact-message-hint {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
}

.contact-message-textarea {
    width: 100%;
    flex: 1;
    min-height: 110px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid #dde1ec;
    background: #f9fafb;
    outline: none;
    font-size: 0.88rem;
    color: #111827;
    line-height: 1.55;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-family: inherit;
}

.contact-message-textarea:focus {
    background: #fff;
    border-color: #25d366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.12);
}

.contact-advertiser-modal.contact-state-expanded .contact-expand-details-btn {
    display: none;
}
.contact-message-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.contact-char-count {
    font-size: 0.76rem;
    color: #9ca3af;
    white-space: nowrap;
}

.contact-wa-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 22px;
    min-height: 44px;
    min-width: 250px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #25d366 0%, #1ab554 100%);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 18px rgba(37, 211, 102, 0.28);
    cursor: pointer;
    transition: opacity 0.18s ease, transform 0.14s ease, box-shadow 0.18s ease;
    white-space: nowrap;
}

.contact-wa-send-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(37, 211, 102, 0.34);
}

.contact-wa-send-btn:active {
    transform: translateY(0);
    opacity: 1;
}

.contact-send-message-note {
    margin: 2px 0 0;
    padding: 9px 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.45;
}

.contact-send-message-note strong {
    color: #334155;
    font-weight: 700;
}

/* ------- Mobile: bottom-sheet slide-up ------- */
@media (max-width: 767.98px) {
    .contact-advertiser-modal .modal-dialog {
        margin: 0;
        max-width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        /* Override BS5 transform so it slides up from bottom */
        transform: translateY(100%) !important;
        transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1) !important;
    }

    .contact-advertiser-modal.contact-state-collapsed .modal-dialog {
        max-width: 100%;
    }

    .contact-advertiser-modal.show .modal-dialog {
        transform: translateY(0) !important;
    }

    .contact-advertiser-modal .modal-content {
        border-radius: 20px 20px 0 0;
        max-height: 92dvh;
        overflow-y: auto;
    }

    .contact-advertiser-modal .modal-body {
        flex-direction: column;
        gap: 14px;
        padding: 16px 16px 20px;
    }

    .contact-advertiser-modal.contact-state-collapsed .modal-body {
        display: block;
    }

    .contact-advertiser-modal .modal-header {
        padding-left: 16px;
        padding-right: 16px;
    }

    .contact-left-col {
        width: 100%;
    }

    /* Drag handle indicator */
    .contact-advertiser-modal .modal-header::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 99px;
        background: #d1d5db;
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
    }

    .contact-advertiser-modal .modal-header {
        position: relative;
        padding-top: 20px;
    }

    .contact-contact-hero {
        flex: none;
    }

    .contact-property-note {
        flex: none;
    }

    .contact-capture-box {
        flex: none;
    }

    .contact-otp-inputs {
        gap: 6px;
    }

    .contact-otp-input {
        height: 44px;
        font-size: 0.95rem;
    }

    .contact-message-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-char-count {
        text-align: right;
    }

    .contact-wa-send-btn {
        width: 100%;
        min-width: 0;
    }
}
