.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 7, 4, 0.62);
    backdrop-filter: saturate(160%) blur(24px);
    -webkit-backdrop-filter: saturate(160%) blur(24px);
    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: column;
    width: 100%;
    max-width: 460px;
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.5),
        0 32px 80px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.12);
    animation: authModalIn 0.36s cubic-bezier(0.19, 1, 0.22, 1);
}
@keyframes authModalIn {
    from { opacity: 0; transform: scale(0.94) translateY(18px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.auth-header-strip {
    background: linear-gradient(135deg, rgba(203, 252, 192, 0.65) 0%, rgba(249, 178, 192, 0.7) 100%);
    padding: 1.5rem 1.75rem 1.25rem;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.auth-header-strip::before {
    content: 'K';
    position: absolute;
    right: -0.5rem;
    bottom: -2.5rem;
    font-size: 9rem;
    font-weight: 900;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: rgba(0, 0, 0, 0.05);
    line-height: 1;
    user-select: none;
    pointer-events: none;
    z-index: 0;
    letter-spacing: -0.06em;
}
.auth-header-strip::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(0, 0, 0, 0.045) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

.auth-header-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}
.auth-header-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
}
.auth-header-name {
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    color: #1a1a1a;
    line-height: 1;
    margin-bottom: 3px;
}
.auth-header-sub {
    font-size: 9px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.35);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    line-height: 1;
}
.auth-header-status {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    padding: 3px 9px;
}
.auth-header-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #5db87a;
    box-shadow: 0 0 5px rgba(93, 184, 122, 0.6);
    animation: dotPulse 2.4s ease-in-out infinite;
}
@keyframes dotPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}
.auth-header-status-text {
    font-size: 9px;
    font-weight: 700;
    color: rgba(46, 125, 79, 0.85);
    letter-spacing: 0.1em;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    text-transform: uppercase;
}
.auth-header-divider {
    position: relative;
    z-index: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.07);
    margin-bottom: 0.75rem;
}
.auth-header-tagline {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.45);
    line-height: 1.5;
}

.auth-modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    z-index: 10;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.45);
    width: 28px; height: 28px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    padding: 0; line-height: 0;
}
.auth-modal-close:hover { background: rgba(255, 255, 255, 0.95); color: #1a1a1a; }

.auth-back-btn {
    display: none;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #D889A2;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    padding: 0;
    margin-bottom: 0.75rem;
    font-family: inherit;
    transition: color 0.15s;
}
.auth-back-btn:hover { color: #c4728c; }
.auth-back-btn.visible { display: inline-flex; }
.auth-back-btn svg { display: block; flex-shrink: 0; }
.auth-back-btn span { display: block; line-height: 1; position: relative; top: 0.5px; }

.auth-form-panel {
    background: #fff;
    position: relative;
    flex: 1;
}
.auth-modal-header { padding: 1.5rem 1.75rem 1rem; }

.auth-modal-step-label {
    font-size: 10px;
    font-weight: 800;
    color: #D889A2;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}
.auth-modal-step-label::before {
    content: '';
    display: inline-block;
    width: 14px; height: 2px;
    background: linear-gradient(90deg, #CBFCC0, #D889A2);
    border-radius: 2px;
    flex-shrink: 0;
}

.auth-modal-title {
    font-family: 'Plus Jakarta Sans', 'Noto Sans SC', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.25;
    color: #1a1a1a;
    margin-bottom: 0.3rem;
}
.auth-modal-subtitle {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.38);
    line-height: 1.6;
}

.auth-modal-body {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1.25rem 1.75rem 1.75rem;
}

.auth-form-group { margin-bottom: 1rem; }
.auth-form-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
    color: #666;
}
.auth-form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.025);
    border: 1.5px solid rgba(0, 0, 0, 0.09);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a1a1a;
    transition: all 0.18s ease;
    outline: none;
    font-family: inherit;
}
.auth-form-input::placeholder { color: rgba(0, 0, 0, 0.2); }
.auth-form-input:focus {
    background: #fff;
    border-color: #D889A2;
    box-shadow: 0 0 0 3px rgba(216, 137, 162, 0.12);
}

.auth-btn-primary {
    width: 100%;
    background: #F9B2C0;
    color: #333;
    padding: 13px 20px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
    margin-top: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: inherit;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s, color 0.2s;
    box-shadow: 0 4px 16px rgba(249, 178, 192, 0.5);
}
.auth-btn-primary::after { content: '→'; font-size: 1rem; opacity: 0.55; }
.auth-btn-primary:hover {
    background: #D889A2;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(216, 137, 162, 0.4);
}
.auth-btn-primary:hover::after { opacity: 1; }
.auth-btn-primary:active { transform: translateY(0); }

.auth-error-message,
.auth-success-message {
    display: none;
    padding: 9px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border-radius: 8px;
    line-height: 1.5;
    border-left: 3px solid;
}
.auth-error-message   { background: rgba(216, 137, 162, 0.07); color: #a0446a; border-color: #D889A2; }
.auth-success-message { background: rgba(93, 184, 122, 0.08);  color: #2e7d4f; border-color: #5db87a; }
.auth-error-message.active,
.auth-success-message.active { display: block; }

.auth-code-inputs {
    display: flex;
    gap: 7px;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.auth-code-input {
    width: 100%;
    max-width: 52px;
    height: 54px;
    background: rgba(0, 0, 0, 0.025);
    border: 1.5px solid rgba(0, 0, 0, 0.09);
    border-radius: 10px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a1a;
    transition: all 0.18s ease;
    outline: none;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}
.auth-code-input:focus {
    background: #fff;
    border-color: #D889A2;
    box-shadow: 0 0 0 3px rgba(216, 137, 162, 0.12);
}

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

.auth-countdown-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.28);
    display: block;
    margin-top: 8px;
    letter-spacing: 0.04em;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
}
.auth-helper-text {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.42);
    margin-bottom: 1rem;
    line-height: 1.65;
}

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

@media (max-width: 560px) {
    .auth-modal        { max-width: 100%; border-radius: 20px; }
    .auth-modal-header { padding: 1.25rem 1.5rem 0.875rem; }
    .auth-modal-body   { padding: 1.125rem 1.5rem 1.5rem; }
    .auth-code-input   { max-width: 44px; height: 48px; font-size: 1.2rem; }
}
