/* ── Auth Modal ──────────────────────────────────────────── */

.sb-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.sb-auth-modal[hidden] { display: none; }

.sb-auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

.sb-auth-modal__box {
    position: relative;
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 2.25rem 2rem;
    box-shadow: 0 25px 80px rgba(0,0,0,.25);
    animation: sbModalIn .25s cubic-bezier(.34,1.3,.64,1) both;
    max-height: 92vh;
    overflow-y: auto;
}
@keyframes sbModalIn {
    from { opacity: 0; transform: scale(.92) translateY(20px); }
    to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.sb-auth-modal__close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: var(--sb-bg-light, #f1f5f9);
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    color: var(--sb-muted);
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.sb-auth-modal__close:hover { background: #fee2e2; color: #dc2626; }

/* Tabs */
.sb-auth-tabs {
    display: flex;
    gap: .25rem;
    background: var(--sb-bg-light, #f1f5f9);
    border-radius: 10px;
    padding: .25rem;
    margin-bottom: 1.5rem;
}
.sb-auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: .6rem;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--sb-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
    font-family: var(--sb-font);
}
.sb-auth-tab--active, .sb-auth-tab:hover {
    background: #fff;
    color: var(--sb-primary);
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

.sb-auth-subtitle { font-size: .88rem; color: var(--sb-muted); margin-bottom: 1.25rem; }

/* Form fields */
.sb-auth-field { margin-bottom: 1rem; }
.sb-auth-field label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--sb-heading);
    margin-bottom: .35rem;
}
.sb-auth-field label span { color: #dc2626; }
.sb-auth-field input {
    width: 100%;
    padding: .65rem .9rem;
    border: 1px solid var(--sb-border, #e2e8f0);
    border-radius: 8px;
    font-size: .9rem;
    font-family: var(--sb-font);
    color: var(--sb-text);
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.sb-auth-field input:focus {
    outline: none;
    border-color: var(--sb-primary);
    box-shadow: 0 0 0 3px var(--sb-primary-ring);
}
.sb-auth-field small { font-size: .75rem; color: var(--sb-muted); margin-top: .25rem; display: block; }

.sb-input-phone {
    display: flex;
    border: 1px solid var(--sb-border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.sb-input-phone:focus-within {
    border-color: var(--sb-primary);
    box-shadow: 0 0 0 3px var(--sb-primary-ring);
}
.sb-input-phone__code {
    background: var(--sb-bg-light, #f1f5f9);
    padding: .65rem .75rem;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    border-right: 1px solid var(--sb-border, #e2e8f0);
    display: flex;
    align-items: center;
}
.sb-input-phone input {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Error */
.sb-auth-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: .6rem .9rem;
    font-size: .85rem;
    color: #991b1b;
    margin-bottom: .75rem;
}

/* Submit btn */
.sb-auth-modal__box .sb-btn--full {
    display: block;
    width: 100%;
    text-align: center;
    padding: .75rem;
    font-size: .95rem;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: var(--sb-font);
    transition: background .2s, transform .15s;
}
.sb-auth-modal__box .sb-btn--primary {
    background: var(--sb-secondary);
    color: var(--sb-cream);
}
.sb-auth-modal__box .sb-btn--primary:hover { background: var(--sb-secondary-dark); transform: translateY(-1px); }
.sb-auth-modal__box .sb-btn--primary:disabled { background: #94a3b8; transform: none; cursor: not-allowed; }

.sb-auth-switch { text-align: center; font-size: .82rem; color: var(--sb-muted); margin-top: 1rem; }
.sb-auth-switch a { color: var(--sb-primary); font-weight: 600; }

@media (max-width: 480px) {
    .sb-auth-modal__box { padding: 1.75rem 1.25rem; }
}
