/* ============================================================
   BISHNOI DENTAL — Appointment Popup
   Brand: Navy #1a2e5a  |  Orange #e87722
   ============================================================ */

/* Overlay */
.bdap-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 15, 35, 0.78);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    padding: 14px;
    box-sizing: border-box;
    backdrop-filter: blur(3px);
}
.bdap-overlay.active {
    display: flex;
    animation: bdapFadeIn 0.22s ease;
}
@keyframes bdapFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Modal */
.bdap-modal {
    display: flex;
    width: 100%;
    max-width: 730px;
    max-height: 93vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.50);
    animation: bdapSlideUp 0.28s ease;
}
@keyframes bdapSlideUp {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── LEFT PANEL ── */
.bdap-left {
    background: #1a2e5a;
    width: 215px;
    flex-shrink: 0;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
}
.bdap-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bdap-brand-icon {
    width: 48px;
    height: 48px;
    background: #e87722;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bdap-brand h3 {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 2px;
    line-height: 1.2;
}
.bdap-brand p {
    color: rgba(255,255,255,0.55);
    font-size: 10px;
    margin: 0;
    line-height: 1.4;
}
.bdap-divider {
    height: 1px;
    background: rgba(255,255,255,0.10);
}
.bdap-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.bdap-stat {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    padding: 9px 5px;
    text-align: center;
}
.bdap-stat-num {
    display: block;
    color: #e87722;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}
.bdap-stat-label {
    display: block;
    color: rgba(255,255,255,0.60);
    font-size: 9.5px;
    margin-top: 3px;
    line-height: 1.3;
}
.bdap-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bdap-feat {
    color: rgba(255,255,255,0.80);
    font-size: 12px;
    line-height: 1.4;
    padding-left: 2px;
}
.bdap-callback-badge {
    background: rgba(232,119,34,0.14);
    border: 1px solid rgba(232,119,34,0.30);
    border-radius: 10px;
    padding: 11px 12px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: auto;
}
.bdap-callback-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}
.bdap-callback-badge strong {
    display: block;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 2px;
}
.bdap-callback-badge p {
    color: rgba(255,255,255,0.65);
    font-size: 10.5px;
    margin: 0;
    line-height: 1.45;
}

/* ── RIGHT PANEL ── */
.bdap-right {
    background: #ffffff;
    flex: 1;
    overflow-y: auto;
    padding: 26px 26px 22px;
    position: relative;
    box-sizing: border-box;
}
.bdap-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: #f1f3f8;
    border: none;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
    z-index: 5;
    line-height: 1;
}
.bdap-close:hover { background: #dde1eb; color: #1a2e5a; }

/* Header */
.bdap-header { margin-bottom: 16px; }
.bdap-badge {
    display: inline-block;
    background: #1a2e5a;
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 1.3px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 9px;
}
.bdap-header h2 {
    color: #1a2e5a;
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 4px;
    line-height: 1.2;
}
.bdap-header p {
    color: #8a90a0;
    font-size: 12.5px;
    margin: 0;
}
.bdap-accent {
    width: 42px;
    height: 3px;
    background: #e87722;
    border-radius: 2px;
    margin-top: 11px;
}

/* ── STEP INDICATOR ── */
.bdap-steps {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}
.bdap-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.bdap-step span {
    font-size: 10px;
    color: #b0b5c5;
    font-weight: 500;
    white-space: nowrap;
}
.bdap-step-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid #dde1eb;
    color: #b0b5c5;
    background: #fff;
    transition: all 0.2s;
}
.bdap-step.active .bdap-step-circle { background:#e87722; border-color:#e87722; color:#fff; }
.bdap-step.active span              { color:#e87722; }
.bdap-step.done  .bdap-step-circle  { background:#1a2e5a; border-color:#1a2e5a; color:#fff; }
.bdap-step.done  span               { color:#1a2e5a; }
.bdap-step-line {
    flex: 1;
    height: 2px;
    background: #dde1eb;
    margin: 0 5px;
    margin-bottom: 14px;
    transition: background 0.2s;
}
.bdap-step-line.done { background: #1a2e5a; }

/* Error */
.bdap-err {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5a89e;
    border-radius: 8px;
    padding: 9px 13px;
    font-size: 12.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 500;
}

/* Panels */
.bdap-panel { display: none; }
.bdap-panel.active { display: block; }

/* Fields */
.bdap-field { margin-bottom: 12px; }
.bdap-field label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 700;
    color: #1a2e5a;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.bdap-field label em {
    color: #aaa;
    font-style: normal;
    font-weight: 400;
    font-size: 11px;
}
.bdap-lbl-icon { font-size: 13px; }
.bdap-req { color: #e87722; }

.bdap-field input,
.bdap-field select {
    width: 100%;
    padding: 10px 13px;
    border: 1.8px solid #e5e8f0;
    border-radius: 9px;
    font-size: 14px;         /* 14px prevents iOS zoom on focus */
    color: #1a2e5a;
    background: #f7f8fc;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    box-sizing: border-box;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}
.bdap-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%231a2e5a' stroke-width='1.7' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}
.bdap-field input:focus,
.bdap-field select:focus {
    border-color: #e87722;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(232,119,34,0.12);
}
.bdap-field input::placeholder { color: #c0c5d5; }

/* Date input — hide default icon on mobile */
input[type="date"] { -webkit-appearance: none; appearance: none; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.5; }

/* Phone row */
.bdap-phone-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.bdap-prefix {
    padding: 10px 12px;
    background: #f7f8fc;
    border: 1.8px solid #e5e8f0;
    border-radius: 9px;
    font-size: 14px;
    color: #1a2e5a;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.bdap-phone-row input { flex: 1; min-width: 0; }

/* 2-col — always 2 col even on mobile for age/gender */
.bdap-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Treatment Tags — ALWAYS horizontal wrap */
.bdap-tags {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;   /* explicit: never column */
    gap: 7px;
    margin-bottom: 4px;
}
.bdap-tag {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 7px 11px;
    border: 1.8px solid #e5e8f0;
    border-radius: 22px;
    font-size: 12px;
    color: #555e78;
    cursor: pointer;
    transition: all 0.15s;
    background: #f7f8fc;
    user-select: none;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}
.bdap-tag:hover,
.bdap-tag:active {
    border-color: #e87722;
    color: #1a2e5a;
    background: rgba(232,119,34,0.08);
}
.bdap-tag.sel {
    border-color: #e87722;
    background: rgba(232,119,34,0.12);
    color: #1a2e5a;
    font-weight: 600;
}

/* Nav buttons */
.bdap-nav {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.bdap-btn-back {
    flex-shrink: 0;
    padding: 11px 14px;
    background: #f1f3f8;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    color: #555e78;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.15s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.bdap-btn-back:hover { background: #dde1eb; }

.bdap-btn-next {
    flex: 1;
    padding: 12px 14px;
    background: #1a2e5a;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: background 0.18s, transform 0.12s;
    letter-spacing: 0.2px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;   /* iOS tap target */
}
.bdap-btn-next:hover  { background: #e87722; transform: translateY(-1px); }
.bdap-btn-next:active { transform: scale(0.99); }
.bdap-btn-next:disabled {
    background: #c0c5d5;
    cursor: not-allowed;
    transform: none;
}

/* Success */
.bdap-success-view { text-align: center; padding: 10px 8px; }
.bdap-success-icon {
    width: 62px; height: 62px;
    background: rgba(26,46,90,0.10);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    font-size: 28px; color: #1a2e5a; font-weight: 900;
}
.bdap-success-view h3    { color:#1a2e5a; font-size:18px; font-weight:800; margin:0 0 6px; }
.bdap-success-view > p   { color:#666; font-size:13px; line-height:1.6; margin-bottom:16px; }
.bdap-success-view strong{ color:#e87722; }
.bdap-summary {
    background: #f7f8fc;
    border: 1px solid #e5e8f0;
    border-radius: 10px;
    padding: 12px 15px;
    text-align: left;
}
.bdap-sum-row {
    display: flex; align-items: baseline; gap: 8px;
    padding: 5px 0; font-size: 12.5px; color: #555e78;
    border-bottom: 1px solid #eef0f5;
}
.bdap-sum-row:last-child { border-bottom: none; }
.bdap-sum-icon { font-size:13px; flex-shrink:0; }
.bdap-sum-val  { color:#1a2e5a; font-weight:600; margin-left:auto; text-align:right; }

/* ══════════════════════════════════════════
   MOBILE  ≤ 580px
   ══════════════════════════════════════════ */
@media (max-width: 580px) {

    /* Modal stacks vertically, fills most of screen */
    .bdap-modal {
        flex-direction: column;
        max-height: 96vh;
        border-radius: 14px;
        margin: 0;
        width: 100%;
    }

    /* Left panel → compact horizontal strip */
    .bdap-left {
        width: 100%;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        padding: 12px 14px;
        gap: 10px;
        flex-shrink: 0;
    }
    .bdap-brand {
        flex: 1;
        min-width: 0;
        gap: 8px;
    }
    .bdap-brand-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        flex-shrink: 0;
    }
    .bdap-brand-icon svg { width: 20px; height: 20px; }
    .bdap-brand h3 { font-size: 13px; }
    .bdap-brand p  { font-size: 9.5px; }

    /* Hide decorative left-panel sections on mobile */
    .bdap-divider,
    .bdap-stats,
    .bdap-features,
    .bdap-callback-badge { display: none !important; }

    /* Right panel padding tighter */
    .bdap-right { padding: 16px 14px 18px; }

    /* Header smaller */
    .bdap-header { margin-bottom: 12px; }
    .bdap-header h2 { font-size: 17px; }

    /* Step labels shorter on tiny screens */
    .bdap-step span { font-size: 9px; }
    .bdap-step-circle { width: 24px; height: 24px; font-size: 10px; }

    /* Age + Gender stay side by side */
    .bdap-row2 {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    /* Tags: horizontal wrap — tighter padding on mobile */
    .bdap-tags { gap: 6px; }
    .bdap-tag  { padding: 6px 10px; font-size: 11.5px; }

    /* Nav buttons — single row, no wrap */
    .bdap-nav { gap: 7px; }
    .bdap-btn-back { padding: 11px 12px; font-size: 12px; }
    .bdap-btn-next { font-size: 12px; padding: 11px 12px; }

    /* Overlay padding reduced so modal uses more screen */
    .bdap-overlay { padding: 8px; }
}

/* Very small phones ≤ 360px */
@media (max-width: 360px) {
    .bdap-tag { padding: 5px 9px; font-size: 11px; }
    .bdap-btn-back,
    .bdap-btn-next { font-size: 11.5px; padding: 10px 10px; }
    .bdap-row2 { gap: 6px; }
}