
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20,16,10,.52);
    backdrop-filter: saturate(140%) blur(22px);
    -webkit-backdrop-filter: saturate(140%) blur(22px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.auth-modal-overlay.active { display: flex; }

.auth-modal {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 580px;
    border-radius: 20px;
    border: 1.5px solid rgba(0,0,0,.16);
    box-shadow: 5px 5px 0 #111111, 0 28px 72px rgba(0,0,0,.18);
    animation: authModalIn 0.34s cubic-bezier(0.19, 1, 0.22, 1);
    overflow: hidden;
    position: relative;
}
@keyframes authModalIn {
    from { opacity: 0; transform: scale(0.96) translateY(14px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.auth-brand-panel {
    width: 185px;
    flex-shrink: 0;
    background: #111111;
    padding: 2.25rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.055) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240,93,35,.20) 0%, transparent 70%);
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
}

.auth-brand-logo {
    position: relative;
    z-index: 1;
    margin-bottom: 1.125rem;
}

.auth-brand-name {
    position: relative;
    z-index: 1;
    font-family: 'Noto Serif SC', 'STSong', serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: rgba(255,255,255,.92);
    margin-bottom: .375rem;
    line-height: 1.2;
}

.auth-brand-tagline {
    position: relative;
    z-index: 1;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,.30);
    line-height: 1.7;
}

.auth-brand-spacer { flex: 1; }

.auth-brand-watermark {
    position: absolute;
    bottom: -1.5rem;
    right: -0.75rem;
    font-size: 8rem;
    font-weight: 900;
    font-family: 'Inter', sans-serif;
    color: rgba(255,255,255,.04);
    line-height: 1;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    letter-spacing: -0.06em;
}

.auth-brand-status {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.auth-brand-status-dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: #34C759; flex-shrink: 0; opacity: .85;
}
.auth-brand-status-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255,255,255,.28);
}

.auth-form-panel {
    flex: 1;
    background: #EBEAE5;
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.auth-form-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,0,0,.042) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,.042) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
    z-index: 0;
}

.auth-modal-close,
.auth-back-btn {
    position: absolute;
    top: .875rem;
    z-index: 100;
    cursor: pointer;
    background: rgba(0,0,0,.06);
    border: 1.5px solid rgba(0,0,0,.09);
    color: rgba(0,0,0,.38);
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s, color .18s;
    padding: 0;
    line-height: 0;
}
.auth-modal-close { right: .875rem; }
.auth-back-btn    { left: .875rem; }
.auth-modal-close:hover,
.auth-back-btn:hover {
    background: rgba(0,0,0,.12);
    color: rgba(0,0,0,.65);
}

.auth-modal-header {
    position: relative;
    z-index: 1;
    padding: 2.25rem 1.75rem 1.25rem;
}

.auth-modal-title {
    font-family: 'Noto Serif SC', 'STSong', serif;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.25;
    color: #0d0d0d;
    -webkit-text-stroke: 0.5px #0d0d0d;
    paint-order: stroke fill;
    text-shadow: 2px 2px 0 rgba(0,0,0,.06);
    margin-bottom: .35rem;
}
.auth-modal-subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(0,0,0,.40);
    line-height: 1.6;
}

.auth-modal-body {
    position: relative;
    z-index: 1;
    flex: 1;
    border-top: 1px solid rgba(0,0,0,.07);
    padding: 1.5rem 1.75rem 2rem;
}

.auth-form-group { margin-bottom: 1rem; }

.auth-form-label {
    display: block;
    font-size: 0.67rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    margin-bottom: 6px;
    color: rgba(0,0,0,.32);
}

.auth-form-input {
    width: 100%;
    background: rgba(255,255,255,.60);
    border: 1.5px solid rgba(0,0,0,.10);
    border-radius: 9px;
    padding: 10px 13px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #111111;
    transition: all .18s ease;
    outline: none;
    font-family: inherit;
}
.auth-form-input::placeholder { color: rgba(0,0,0,.22); }
.auth-form-input:focus {
    background: #ffffff;
    border-color: #F05D23;
    box-shadow: 0 0 0 3px rgba(240,93,35,.10);
}

.auth-btn-primary {
    width: 100%;
    background: #111111;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 9px;
    border: 1.5px solid #111111;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: .02em;
    margin-top: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 0 rgba(0,0,0,.28);
    transition: box-shadow .12s ease, transform .12s ease, background .15s ease;
    font-family: inherit;
}
.auth-btn-primary:hover {
    background: #2a2a2a;
    box-shadow: 4px 4px 0 rgba(0,0,0,.28);
    transform: translate(-1px, -1px);
}
.auth-btn-primary:active {
    box-shadow: 1px 1px 0 rgba(0,0,0,.28);
    transform: translate(2px, 2px);
}

.auth-error-message,
.auth-success-message {
    display: none;
    padding: 9px 11px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: .875rem;
    border-radius: 7px;
    line-height: 1.5;
    border-left: 3px solid;
}
.auth-error-message   { background: rgba(217,48,37,.07); color: #b83227; border-color: #c0392b; }
.auth-success-message { background: rgba(52,199,89,.08); color: #1e7a38; border-color: #34C759; }
.auth-error-message.active,
.auth-success-message.active { display: block; }

.auth-code-inputs {
    display: flex;
    gap: 7px;
    justify-content: space-between;
    margin-bottom: 1.125rem;
}
.auth-code-input {
    width: 100%;
    max-width: 48px;
    height: 54px;
    background: rgba(255,255,255,.60);
    border: 1.5px solid rgba(0,0,0,.10);
    border-radius: 9px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #111111;
    transition: all .18s ease;
    outline: none;
    font-family: inherit;
    box-shadow: 2px 2px 0 rgba(0,0,0,.08);
}
.auth-code-input:focus {
    background: #ffffff;
    border-color: #F05D23;
    box-shadow: 0 0 0 3px rgba(240,93,35,.10);
}

.auth-btn-text {
    background: none;
    border: none;
    font-size: 0.77rem;
    font-weight: 600;
    color: rgba(0,0,0,.32);
    cursor: pointer;
    transition: color .15s;
    padding: 3px 0;
    font-family: inherit;
}
.auth-btn-text:hover { color: #F05D23; }

.auth-countdown-text {
    font-size: 0.67rem;
    font-weight: 700;
    color: rgba(0,0,0,.28);
    display: block;
    margin-top: 8px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.auth-helper-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(0,0,0,.42);
    margin-bottom: 1.125rem;
    line-height: 1.65;
}

.auth-step-content        { display: none; }
.auth-step-content.active { display: block; }

@media (max-width: 520px) {
    .auth-modal {
        flex-direction: column;
        max-width: 400px;
        box-shadow: 4px 4px 0 #111111, 0 20px 52px rgba(0,0,0,.18);
    }
    .auth-brand-panel {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: .625rem;
        padding: 1rem 1.25rem;
    }
    .auth-brand-tagline,
    .auth-brand-spacer,
    .auth-brand-watermark,
    .auth-brand-status { display: none; }
    .auth-brand-name { margin-bottom: 0; font-size: 14px; }
    .auth-brand-panel::after { display: none; }
    .auth-modal-header { padding: 1.5rem 1.5rem 1rem; }
    .auth-modal-body   { padding: 1.25rem 1.5rem 1.75rem; }
    .auth-modal-close  { right: .75rem; top: .75rem; }
    .auth-back-btn     { left: .75rem;  top: .75rem; }
}
