*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-primary:    #0D0D15;
    --bg-secondary:  #1A1A2E;
    --bg-card:       rgba(26, 26, 46, 0.9);
    --gold-primary:  #D4A853;
    --gold-light:    #F0C674;
    --gold-dark:     #B8942D;
    --gold-glow:     rgba(212, 168, 83, 0.25);
    --text-primary:  #EAEAEA;
    --text-secondary:#A0A0B0;
    --text-gold:     #D4A853;
    --error-color:   #E74C3C;
    --success-color: #2ECC71;
    --border-glass:  1px solid rgba(212, 168, 83, 0.2);
    --font:          'Inter', 'Segoe UI', sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: 2rem 0;
}

/* Background orbs */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}
body::before {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(212,168,83,0.12) 0%, transparent 70%);
    top: -100px; left: -100px;
    animation: float 8s ease-in-out infinite;
}
body::after {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(100,50,200,0.08) 0%, transparent 70%);
    bottom: -100px; right: -100px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    50%       { transform: translateY(-30px) translateX(20px); }
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
    margin: auto;
}

/* Logo */
.logo {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.logo-icon {
    width: 72px;
    height: 72px;
    display: block;
    margin: 0 auto 0.75rem;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 0 30px var(--gold-glow);
}
.logo-name {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}
.logo-tagline {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Card */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: var(--border-glass);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4), 0 0 60px var(--gold-glow);
}

/* Tabs */
.tabs {
    display: flex;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 1.75rem;
    gap: 4px;
}
.tab-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tab-btn.active {
    background: var(--gold-primary);
    color: #0D0D15;
    font-weight: 600;
}
.tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
}

/* Forms */
.form { display: none; }
.form.active { display: block; }

.form-group { margin-bottom: 1.1rem; }
.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    letter-spacing: 0.3px;
}
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-input::placeholder { color: rgba(160,160,176,0.5); }
.form-input.error { border-color: var(--error-color); }

.field-error {
    font-size: 0.75rem;
    color: var(--error-color);
    margin-top: 0.3rem;
    display: none;
}
.field-error.show { display: block; }

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    border: none;
    border-radius: 8px;
    color: #0D0D15;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}
.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(212,168,83,0.4);
}
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn-submit .spinner {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(0,0,0,0.3);
    border-top-color: #0D0D15;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Alert */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.alert-error { background: rgba(231,76,60,0.15); border: 1px solid rgba(231,76,60,0.4); color: #ff6b6b; }
.alert-success { background: rgba(46,204,113,0.15); border: 1px solid rgba(46,204,113,0.4); color: #5dde8b; }
/* Điện thoại / máy tính bảng: iOS không tự phóng khi chạm ô nhập (chữ ≥16px); liên kết đủ cao để chạm */
@media (max-width: 1024px) {
    .form-input { font-size: 16px; }
    .auth-forgot-link { display: inline-flex; align-items: center; min-height: 36px; }
}
