
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.auth-modal-overlay.active {
    display: flex;
    animation: zh-auth-overlay-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes zh-auth-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-modal {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: min(92vh, 760px);
    overflow-y: auto;
    padding: 40px 36px 32px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.04),
        0 24px 48px -12px rgba(15, 23, 42, 0.16),
        0 12px 24px -10px rgba(0, 0, 0, 0.08);
    -webkit-overflow-scrolling: touch;
}

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.auth-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.auth-modal-header {
    margin-bottom: 26px;
    text-align: left;
    padding-right: 36px;
}

.auth-modal-title {
    font-size: clamp(24px, 5vw, 30px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.15;
    color: #0f172a;
    margin-bottom: 10px;
}

.auth-modal-subtitle {
    font-size: 15px;
    line-height: 1.55;
    color: #64748b;
    font-weight: 500;
}

.auth-form-group {
    margin-bottom: 18px;
}

.auth-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 8px;
}

.auth-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input::placeholder {
    color: #94a3b8;
}

.auth-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.auth-code-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 22px 0 18px;
}

@media (max-width: 380px) {
    .auth-code-container {
        gap: 6px;
    }
}

.auth-code-input {
    width: 100%;
    min-height: 48px;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #0f172a;
    background: #fafafa;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-code-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.auth-btn-submit {
    width: 100%;
    padding: 14px 22px;
    margin-top: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #0f172a;
    border: none;
    border-radius: 99px;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.18s ease,
        background 0.18s ease;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.auth-btn-submit:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
}

.auth-btn-submit:active {
    transform: translateY(0);
}

.auth-btn-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.auth-link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
    text-decoration: none;
    margin-top: 0;
    font-family: inherit;
}

.auth-link-btn:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

.auth-link-btn.auth-link-danger {
    color: #dc2626 !important;
}

.auth-link-btn.auth-link-danger:hover {
    color: #b91c1c !important;
}

.auth-error-msg {
    display: none;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
}

.auth-error-msg.active {
    display: block;
}

.auth-countdown-row {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}
