/* ==========================================================
   BOOK MY ARTIST - HOMEPAGE MODAL
   v2.2 — Dark theme (matches site-wide dark navy/purple forms)
========================================================== */

/* ---------------- Color tokens — tweak here if the site's
   exact shades change, everything below references these ---------------- */
.bma-modal-overlay{
    --bma-bg-start: #1b1730;
    --bma-bg-end: #241b3d;
    --bma-border: rgba(255,255,255,.14);
    --bma-input-bg: rgba(255,255,255,.06);
    --bma-input-border: rgba(255,255,255,.18);
    --bma-input-focus-border: #e53935;
    --bma-text: #ffffff;
    --bma-label: #b9b5cc;
    --bma-subtitle: #b3aec7;
    --bma-placeholder: #85809c;
    --bma-error: #ff6b6b;
    --bma-accent: #e53935;
    --bma-accent-hover: #c92e2a;
}

.bma-modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.7);
    display:none;
    align-items:center;
    justify-content:center;
    padding:20px;
    z-index:99999;
    overflow-y:auto;
}

.bma-modal{
    position:relative;
    width:100%;
    max-width:760px;
    max-height:90vh;
    background:linear-gradient(160deg, var(--bma-bg-start), var(--bma-bg-end));
    border:1px solid var(--bma-border);
    border-radius:14px;
    box-shadow:0 25px 70px rgba(0,0,0,.5);
    display:flex;
    flex-direction:column;
    overflow:hidden;
    animation:bmaModalFade .25s ease;
    color:var(--bma-text);
}

@keyframes bmaModalFade{
    from{
        opacity:0;
        transform:translateY(20px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

.bma-modal-header{
    padding:30px;
    text-align:center;
    border-bottom:1px solid var(--bma-border);
}

.bma-modal-title{
    margin:0 0 10px;
    font-size:32px;
    font-weight:700;
    line-height:1.2;
    color:var(--bma-text);
}

.bma-modal-subtitle{
    margin:0;
    color:var(--bma-subtitle);
    font-size:16px;
    line-height:1.6;
}

.bma-modal-body{
    padding:30px;
    overflow-y:auto;
    flex:1;
}

.bma-modal-close{
    position:absolute;
    top:15px;
    right:18px;
    width:40px;
    height:40px;
    border:1px solid var(--bma-border);
    border-radius:50%;
    background:rgba(255,255,255,.06);
    color:var(--bma-text);
    font-size:28px;
    line-height:38px;
    cursor:pointer;
    transition:.25s;
}
.bma-modal-close:hover{
    background:var(--bma-accent);
    border-color:var(--bma-accent);
    color:#ffffff;
}

.bma-modal .fg{
    display:flex;
    gap:20px;
    margin-bottom:20px;
}
.bma-modal .fg > div{
    flex:1;
    min-width:0;
}

.bma-modal .step-btn{
    margin-top:25px;
}

body.bma-modal-open{
    overflow:hidden;
}

/* ==========================================================
   LABELS
========================================================== */
.bma-modal label{
    display:block;
    margin-bottom:8px;
    font-size:12px;
    font-weight:700;
    letter-spacing:.06em;
    text-transform:uppercase;
    color:var(--bma-label);
}

/* ==========================================================
   INPUTS / SELECTS / TEXTAREA
========================================================== */
.bma-modal input[type="text"],
.bma-modal input[type="tel"],
.bma-modal input[type="email"],
.bma-modal input[type="date"],
.bma-modal select,
.bma-modal textarea{
    width:100%;
    background:var(--bma-input-bg);
    border:1px solid var(--bma-input-border);
    border-radius:8px;
    padding:13px 14px;
    font-size:15px;
    color:var(--bma-text);
    transition:border-color .2s, background .2s;
    box-sizing:border-box;
}

.bma-modal input::placeholder,
.bma-modal textarea::placeholder{
    color:var(--bma-placeholder);
}

.bma-modal input:focus,
.bma-modal select:focus,
.bma-modal textarea:focus{
    outline:none;
    border-color:var(--bma-input-focus-border);
    background:rgba(255,255,255,.09);
}

/* Custom dropdown arrow (native arrows look inconsistent on dark bg) */
.bma-modal select{
    appearance:none;
    -webkit-appearance:none;
    -moz-appearance:none;
    background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b9b5cc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 14px center;
    background-size:18px;
    padding-right:40px;
    cursor:pointer;
}
.bma-modal select option{
    background:#241b3d;
    color:#ffffff;
}

/* Date input calendar icon needs to be visible on a dark background */
.bma-modal input[type="date"]{
    color-scheme:dark;
}

.bma-modal textarea{
    min-height:110px;
    resize:vertical;
    font-family:inherit;
}

/* ==========================================================
   BUDGET ROW / DYNAMIC FIELD 3 LAYOUT
========================================================== */
.bma-modal .budget-col{
    flex:1;
    min-width:0;
}

/* ==========================================================
   ERRORS
========================================================== */
.bma-modal .field-error{
    margin-top:6px;
    font-size:13px;
    color:var(--bma-error);
    min-height:0;
}

.bma-modal .bma-general-error{
    color:var(--bma-error) !important;
    background:rgba(255,107,107,.1);
    border:1px solid rgba(255,107,107,.3);
    border-radius:8px;
    padding:10px 14px;
}

/* ==========================================================
   SUBMIT BUTTON
========================================================== */
.bma-modal .btn-red,
.bma-modal #modalSubmitBtn{
    width:100%;
    background:var(--red);
    color:#ffffff;
    border:none;
    border-radius:8px;
    padding:16px 20px;
    font-size:16px;
    font-weight:700;
    cursor:pointer;
    transition:background .2s;
}
.bma-modal .btn-red:hover,
.bma-modal #modalSubmitBtn:hover{
    background:var(--bma-accent-hover);
}
.bma-modal #modalSubmitBtn:disabled{
    opacity:.6;
    cursor:not-allowed;
}

/* ==========================================================
   MESSAGE FIELD
========================================================== */
#messageRow{
    display:flex;
    flex-direction:column;
    margin-bottom:20px;
}
#messageRow label{
    display:block;
    margin-bottom:8px;
}
#messageRow textarea{
    display:block;
    width:100%;
}
#messageRow .counter{
    margin-top:8px;
    text-align:right;
    font-size:12px;
    color:var(--bma-placeholder);
}

/* ==========================================================
   MOBILE
========================================================== */
@media(max-width:768px){
    .bma-modal-overlay{
        padding:15px;
        align-items:flex-start;
    }
    .bma-modal{
        max-width:100%;
        max-height:calc(100vh - 40px);
        margin:20px 0;
        border-radius:10px;
    }
    .bma-modal-header{
        padding:22px 20px;
    }
    .bma-modal-title{
        font-size:26px;
    }
    .bma-modal-subtitle{
        font-size:14px;
    }
    .bma-modal-body{
        padding:20px;
    }
    .bma-modal-close{
        width:36px;
        height:36px;
        font-size:24px;
        line-height:34px;
        top:12px;
        right:12px;
    }
    .bma-modal .fg{
        flex-direction:column;
        gap:0;
    }
    /* Fields stack on mobile - need vertical spacing since gap:0
       above (gap isn't well supported the same way once column-stacked
       across all older Android WebViews, so margin is used as a
       reliable fallback). Last item skips the extra margin since the
       parent .fg already carries margin-bottom:20px. */
    .bma-modal .fg > div{
        margin-bottom:16px;
    }
    .bma-modal .fg > div:last-child{
        margin-bottom:0;
    }
}

/* ==========================================================
   VERY SMALL SCREENS (older/budget phones, narrow viewports)
========================================================== */
@media(max-width:380px){
    .bma-modal-overlay{
        padding:10px;
    }
    .bma-modal-header{
        padding:18px 16px;
    }
    .bma-modal-title{
        font-size:22px;
    }
    .bma-modal-subtitle{
        font-size:13px;
    }
    .bma-modal-body{
        padding:16px;
    }
    .bma-modal input[type="text"],
    .bma-modal input[type="tel"],
    .bma-modal input[type="email"],
    .bma-modal input[type="date"],
    .bma-modal select,
    .bma-modal textarea{
        padding:11px 12px;
        font-size:14px;
    }
    .bma-modal .btn-red,
    .bma-modal #modalSubmitBtn{
        padding:14px 16px;
        font-size:15px;
    }
}

/* ==========================================================
   SHORT VIEWPORTS (landscape phones, or keyboard open on mobile
   pushing available height down) - keep modal usable/scrollable
========================================================== */
@media(max-height:560px){
    .bma-modal-overlay{
        align-items:flex-start;
    }
    .bma-modal{
        margin:10px 0;
        max-height:calc(100vh - 20px);
    }
    .bma-modal-header{
        padding:16px 20px;
    }
    .bma-modal-title{
        font-size:22px;
    }
    .bma-modal-body{
        padding:18px 20px;
    }
}