

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 3, 10, 0.88);
    backdrop-filter: blur(16px) saturate(1.1);
    -webkit-backdrop-filter: blur(16px) saturate(1.1);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.auth-modal {
    width: 100%;
    max-width: 420px;
    position: relative;
    border-radius: 8px;
    background:
        linear-gradient(165deg, rgba(0, 71, 255, 0.08) 0%, transparent 45%),
        linear-gradient(180deg, rgba(10, 20, 40, 0.92) 0%, rgba(2, 3, 10, 0.98) 100%);
    border: 1px solid rgba(0, 71, 255, 0.28);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.5) inset,
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 32px 64px -16px rgba(0, 0, 0, 0.65),
        0 0 48px -20px rgba(0, 71, 255, 0.2);
    overflow: hidden;
    transform: translateY(16px) scale(0.98);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
}
.auth-modal-overlay.active .auth-modal {
    transform: translateY(0) scale(1);
}

.auth-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 184, 0, 0.35) 45%,
        rgba(0, 71, 255, 0.5) 55%,
        transparent
    );
    pointer-events: none;
    z-index: 2;
}

.auth-modal-header {
    position: relative;
    padding: 1.75rem 1.75rem 1rem;
    text-align: center;
}

.auth-modal-close,
.auth-back-btn {
    position: absolute;
    top: 0.875rem;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 71, 255, 0.2);
    color: rgba(148, 163, 184, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    z-index: 10;
}
.auth-modal-close { right: 0.875rem; }
.auth-back-btn { left: 0.875rem; }
.auth-modal-close:hover,
.auth-back-btn:hover {
    background: rgba(0, 71, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 184, 0, 0.35);
}

.auth-modal-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.125rem;
    color: #ffb800;
}
.auth-modal-brand svg,
.auth-modal-brand .site-logo-mark {
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(255, 184, 0, 0.35));
}
.auth-modal-brand-name {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #fff;
}

.auth-modal-title {
    font-size: clamp(1.2rem, 4vw, 1.45rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
    margin-bottom: 0.35rem;
    line-height: 1.15;
}
.auth-modal-subtitle {
    font-size: 0.9375rem;
    color: #94a3b8;
    line-height: 1.55;
}

.auth-modal-body {
    padding: 0 1.75rem 1.75rem;
}

.auth-form-group { margin-bottom: 1.125rem; }
.auth-form-group.mb-0 { margin-bottom: 0; }

.auth-form-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.45rem;
}

.auth-form-input {
    width: 100%;
    background: rgba(2, 3, 10, 0.6);
    border: 1px solid rgba(0, 71, 255, 0.25);
    border-radius: 4px;
    padding: 0.7rem 0.85rem;
    font-size: 0.9375rem;
    color: #fff;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.auth-form-input::placeholder {
    color: #475569;
}
.auth-form-input:focus {
    background: rgba(0, 71, 255, 0.08);
    border-color: rgba(255, 184, 0, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 184, 0, 0.12);
}

.auth-btn-primary {
    width: 100%;
    height: 44px;
    padding: 0 1.25rem;
    border: none;
    border-radius: 4px;
    background: #ffb800;
    color: #02030a;
    font-size: 0.875rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(255, 184, 0, 0.28);
}
.auth-btn-primary:hover {
    background: #ffc933;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(255, 184, 0, 0.35);
}
.auth-btn-primary:active {
    transform: translateY(0);
}

.auth-code-inputs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.45rem;
    margin-bottom: 1.125rem;
}
.auth-code-input {
    aspect-ratio: 1;
    min-height: 0;
    background: rgba(2, 3, 10, 0.55);
    border: 1px solid rgba(0, 71, 255, 0.28);
    border-radius: 4px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: #fff;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
}
.auth-code-input:focus {
    border-color: rgba(255, 184, 0, 0.55);
    background: rgba(0, 71, 255, 0.1);
    box-shadow: 0 0 20px -8px rgba(255, 184, 0, 0.25);
}

.auth-error-message,
.auth-success-message {
    display: none;
    padding: 0.65rem 0.875rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.875rem;
    text-align: center;
}
.auth-error-message.active {
    display: block;
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.28);
}
.auth-success-message.active {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.28);
}

.auth-helper-text {
    font-size: 0.875rem;
    color: #94a3b8;
    text-align: center;
    margin-bottom: 0.875rem;
    line-height: 1.5;
}
.auth-helper-text .auth-email-highlight {
    color: #fff;
    font-weight: 600;
    font-style: normal;
}

.auth-countdown-text {
    font-size: 0.8125rem;
    color: #64748b;
    margin-bottom: 0.4rem;
}

.auth-hint-micro {
    margin-top: 0.875rem;
    font-size: 0.6875rem;
    color: #475569;
    text-align: center;
    line-height: 1.45;
}

.auth-footer-actions {
    margin-top: 1.25rem;
    text-align: center;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.auth-btn-text {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.125rem;
    transition: color 0.2s;
    font-family: inherit;
}
.auth-btn-text:hover {
    color: #ffb800;
}

.auth-step-content { display: none; }
.auth-step-content.active {
    display: block;
    animation: authModalStepIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes authModalStepIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 2rem; }
.space-y-4 > * + * { margin-top: 1rem; }
