/* =====================================================
   AUTH STYLES — Dark Christmas theme
   ===================================================== */

/* ===== OVERLAY ===== */
.auth-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow-y: auto;
    padding: 24px 16px;
}

.auth-overlay.hidden { display: none; }

/* ===== CARD ===== */
.auth-container {
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(74, 222, 128, 0.06),
        0 32px 64px rgba(0, 0, 0, 0.85);
    width: 100%;
    max-width: 400px;
    padding: 36px;
    position: relative;
    animation: authSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    margin: auto;
    flex-shrink: 0;
}

@keyframes authSlideIn {
    from { opacity: 0; transform: translateY(-18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== LED DECORATION ===== */
.auth-leds {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
}

.auth-leds span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: ledPulse 2.4s ease-in-out infinite;
}

.auth-leds span:nth-child(1) { background: #ef4444; animation-delay: 0s; }
.auth-leds span:nth-child(2) { background: #22c55e; animation-delay: 0.3s; }
.auth-leds span:nth-child(3) { background: #facc15; animation-delay: 0.6s; }
.auth-leds span:nth-child(4) { background: #60a5fa; animation-delay: 0.9s; }
.auth-leds span:nth-child(5) { background: #ef4444; animation-delay: 1.2s; }
.auth-leds span:nth-child(6) { background: #22c55e; animation-delay: 1.5s; }
.auth-leds span:nth-child(7) { background: #facc15; animation-delay: 1.8s; }

@keyframes ledPulse {
    0%, 100% { opacity: 0.25; transform: scale(1); }
    50%       { opacity: 1;    transform: scale(1.25); box-shadow: 0 0 6px currentColor; }
}

/* ===== HEADER ===== */
.auth-header {
    text-align: center;
    margin-bottom: 26px;
}

.auth-header h2 {
    color: #fafafa;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.auth-header p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13.5px;
}

/* ===== TABS ===== */
.auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 4px;
    border-radius: 11px;
}

.auth-tab {
    flex: 1;
    padding: 9px 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.auth-tab:hover:not(.active) {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
}

.auth-tab.active {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.2);
}

/* ===== FORMS ===== */
.auth-form { display: none; }
.auth-form.active { display: block; }

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.65);
    font-size: 12.5px;
    font-weight: 500;
    margin-bottom: 7px;
}

.form-group input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    color: #fafafa;
    font-size: 14.5px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-group input::placeholder { color: rgba(255, 255, 255, 0.2); }

.form-group input:focus {
    outline: none;
    border-color: rgba(74, 222, 128, 0.5);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.08);
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    margin-top: 8px;
    font-size: 12px;
    display: none;
}

.password-strength.show { display: block; }

.strength-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 2px;
    margin-bottom: 5px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s;
    border-radius: 2px;
}

.strength-fill.weak   { width: 33%; background: #ef4444; }
.strength-fill.medium { width: 66%; background: #facc15; }
.strength-fill.strong { width: 100%; background: #22c55e; }

.strength-text {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

/* ===== MESSAGES ===== */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    display: none;
}

.error-message.show { display: block; }

.success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #86efac;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    display: none;
}

.success-message.show { display: block; }

/* ===== MAIN BUTTON ===== */
.auth-button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 12px;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.auth-button:hover {
    background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.22);
}

.auth-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.auth-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== DIVIDER ===== */
.auth-divider {
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    font-size: 12px;
    margin: 20px 0;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 41%;
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
}

.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

/* ===== OAUTH ===== */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.oauth-button {
    width: 100%;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.oauth-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateY(-1px);
}

.oauth-button:active { transform: translateY(0); }

/* ===== FORGOT PASSWORD ===== */
.forgot-password {
    text-align: center;
    margin-top: 10px;
}

.forgot-password a {
    color: rgba(255, 255, 255, 0.35);
    font-size: 12.5px;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password a:hover { color: rgba(255, 255, 255, 0.7); }

/* ===== LOADING SPINNER ===== */
.auth-loading {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 480px) {
    .auth-overlay { padding: 16px 12px; }

    .auth-container {
        padding: 28px 20px;
        border-radius: 16px;
    }

    .auth-header h2 { font-size: 20px; }
    .auth-header { margin-bottom: 20px; }

    .auth-leds { gap: 8px; margin-bottom: 16px; }
    .auth-leds span { width: 7px; height: 7px; }

    .form-group input {
        font-size: 16px; /* prevents iOS zoom */
        padding: 10px 13px;
    }

    .auth-button { padding: 11px; font-size: 14px; }
    .oauth-button { padding: 10px; font-size: 13px; }
}

@media (max-width: 360px) {
    .auth-container { padding: 22px 16px; border-radius: 14px; }
    .auth-header h2 { font-size: 18px; }
    .auth-tab { font-size: 12px; padding: 8px 4px; }
    .auth-leds span { width: 6px; height: 6px; }
    .auth-leds { gap: 7px; }
}

@media (max-height: 600px) and (orientation: landscape) {
    .auth-overlay {
        align-items: flex-start;
        overflow-y: auto;
        padding: 10px 16px;
    }

    .auth-container {
        padding: 18px 28px;
        margin: 6px auto;
    }

    .auth-header { margin-bottom: 12px; }
    .auth-leds { margin-bottom: 10px; }
    .auth-leds span { width: 6px; height: 6px; }
    .form-group { margin-bottom: 9px; }
    .form-group label { margin-bottom: 4px; font-size: 11.5px; }
    .form-group input { padding: 8px 12px; }
    .auth-button { padding: 9px; margin-bottom: 7px; }
    .auth-divider { margin: 10px 0; }
    .oauth-button { padding: 9px; }
    .auth-tabs { margin-bottom: 12px; }
}
