﻿/* =========================================
   AUTH PAGE – ĐĂNG NHẬP / ĐĂNG KÝ
========================================= */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.auth-wrap {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ---- LEFT: BRAND PANEL ---- */

.auth-brand {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #18191a 0%, #1e1f20 40%, #1e3a5a 100%);
}

.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 25% 55%, rgba(66, 153, 225, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 20%, rgba(11, 197, 234, 0.12) 0%, transparent 50%);
    pointer-events: none;
}

/* Decorative blobs */
.auth-brand::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: -60px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(66, 153, 225, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 380px;
}

/* Logo */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 52px;
}

.auth-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-alt));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 8px 24px rgba(66, 153, 225, 0.45);
}

.auth-logo-text {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent), var(--accent-alt));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Heading */
.auth-brand h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    margin-bottom: 14px;
}

.auth-brand > .auth-brand-inner > p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.975rem;
    line-height: 1.65;
    margin-bottom: 36px;
}

/* Feature list */
.auth-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
}

.auth-features li .feat-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(66, 153, 225, 0.2);
    border: 1px solid rgba(66, 153, 225, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ---- RIGHT: FORM PANEL ---- */

.auth-panel {
    width: 500px;
    min-width: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 52px 44px;
    background: var(--bg-body);
}

.auth-box {
    width: 100%;
    max-width: 400px;
}

/* ---- TABS ---- */

.auth-tabs {
    display: flex;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 28px;
    gap: 4px;
}

.auth-tab {
    flex: 1;
    padding: 10px 0;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.22s ease;
    background: transparent;
    border: none;
    letter-spacing: 0.01em;
}

.auth-tab.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-alt));
    color: #fff;
    box-shadow: 0 4px 18px rgba(66, 153, 225, 0.4);
}

.auth-tab:not(.active):hover {
    color: var(--text-main);
    background: var(--bg-elevated-soft);
}

/* ---- FORMS ---- */

.auth-form {
    animation: formFadeIn 0.28s ease;
}

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

@keyframes formFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-sub {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 22px;
}

/* Form group */
.auth-form-group {
    margin-bottom: 16px;
}

.auth-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 7px;
}

.auth-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    outline: none;
}

.auth-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
    background: var(--bg-elevated-soft);
}

.auth-input::placeholder {
    color: var(--text-soft);
}

/* Options row (remember me + forgot) */
.auth-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0 20px;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.83rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.auth-forgot-link {
    font-size: 0.83rem;
    color: var(--accent);
    transition: color 0.15s ease;
}

.auth-forgot-link:hover {
    color: var(--accent-hover);
}

/* Submit button */
.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent), var(--accent-alt));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 8px 24px rgba(66, 153, 225, 0.35);
    margin-bottom: 20px;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(66, 153, 225, 0.5);
    filter: brightness(1.06);
}

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

/* Switch link */
.auth-switch {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--accent);
    font-weight: 600;
    transition: color 0.15s ease;
}

.auth-switch a:hover {
    color: var(--accent-hover);
}

/* Password strength hint (optional, shown when typing) */
.password-hint {
    font-size: 0.78rem;
    color: var(--text-soft);
    margin-top: 5px;
}

/* ---- DIVIDER (nếu muốn thêm social login sau) ---- */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--text-soft);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* ---- UTILITY ---- */

.hidden { display: none !important; }

/* ---- ALERT ---- */

.auth-alert {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.86rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.auth-alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86efac;
}

/* ---- INPUT WRAP (cho nút mắt) ---- */

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap .auth-input {
    padding-right: 42px;
}

.auth-eye-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-soft);
    padding: 2px;
    line-height: 1;
    user-select: none;
}

/* ---- NÚT PHỤ ---- */

.auth-btn-secondary {
    background: var(--bg-elevated) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-subtle) !important;
    box-shadow: none !important;
}

.auth-btn-secondary:hover {
    background: var(--bg-elevated-soft) !important;
    box-shadow: none !important;
    filter: none !important;
}

/* ---- TRẠNG THÁI ĐÃ ĐĂNG NHẬP ---- */

.auth-logged-in {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 0;
    animation: formFadeIn 0.3s ease;
}

.auth-logged-avatar-wrap {
    position: relative;
    margin-bottom: 20px;
}

.auth-logged-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 6px rgba(66, 153, 225, 0.15);
}

.auth-logged-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-body);
}

.auth-logged-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.auth-logged-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.auth-logged-balance {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 18px;
    font-size: 0.9rem;
    color: var(--text-soft);
    margin-bottom: 24px;
    width: 100%;
}

.auth-logged-balance strong {
    color: #38bdf8;
    font-size: 1rem;
}

.auth-logged-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 18px;
}

.auth-logged-actions .auth-btn {
    flex: 1;
    margin-bottom: 0;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logout-link {
    background: none;
    border: none;
    color: var(--text-soft);
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    transition: color 0.15s ease;
}

.auth-logout-link:hover {
    color: #ef4444;
}

/* ---- RESPONSIVE ---- */

@media (max-width: 860px) {
    .auth-wrap {
        flex-direction: column;
    }

    .auth-brand {
        padding: 36px 28px 30px;
        flex: none;
        min-height: auto;
    }

    .auth-brand h2 {
        font-size: 1.55rem;
    }

    .auth-features {
        display: none;
    }

    .auth-brand > .auth-brand-inner > p {
        margin-bottom: 0;
    }

    .auth-panel {
        width: 100%;
        min-width: auto;
        padding: 36px 24px 48px;
    }
}

@media (max-width: 420px) {
    .auth-brand {
        padding: 28px 20px 22px;
    }

    .auth-panel {
        padding: 28px 16px 40px;
    }
}

@media (max-width: 360px) {
    .auth-brand h2 {
        font-size: 1.2rem;
    }

    .auth-panel {
        padding: 22px 14px 36px;
    }

    .auth-input {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .auth-submit {
        font-size: 0.9rem;
        padding: 11px;
    }
}
