/* ============================================
   AUTH PAGES - Light Theme (Login/Register/Logout)
   Consistent with game layout colors
   ============================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --auth-primary: #16a34a;
    --auth-primary-light: #22c55e;
    --auth-primary-bg: rgba(22,163,74,0.06);
    --auth-primary-border: rgba(22,163,74,0.15);
    --auth-primary-glow: rgba(22,163,74,0.12);
    --auth-bg: #f7f9f6;
    --auth-card: #ffffff;
    --auth-card-border: #e2e8f0;
    --auth-text: #1e293b;
    --auth-text-dim: #64748b;
    --auth-text-light: #94a3b8;
    --auth-input-bg: #f8fafc;
    --auth-input-border: #e2e8f0;
    --auth-input-focus-border: #16a34a;
    --auth-input-focus-shadow: rgba(22,163,74,0.12);
    --auth-panel-bg: linear-gradient(160deg, #15803d 0%, #166534 50%, #14532d 100%);
    --auth-radius: 16px;
    --auth-radius-sm: 10px;
    --auth-shadow: 0 4px 24px rgba(0,0,0,0.06);
    --auth-shadow-lg: 0 20px 50px rgba(0,0,0,0.08);
    --auth-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    font-family: var(--auth-font);
    background: var(--auth-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* === Background decoration === */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-bg::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(22,163,74,0.06) 0%, transparent 70%);
    top: -200px; right: -150px;
}

.auth-bg::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(22,163,74,0.04) 0%, transparent 70%);
    bottom: -150px; left: -100px;
}

/* === Wrapper === */
.auth-wrapper {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* === Two-column container (Login/Register) === */
.auth-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    max-width: 920px;
    width: 100%;
    background: var(--auth-card);
    border: 1px solid var(--auth-card-border);
    border-radius: var(--auth-radius);
    overflow: hidden;
    box-shadow: var(--auth-shadow-lg);
    animation: auth-appear 0.5s cubic-bezier(0.4,0,0.2,1) both;
}

/* === Single-column card (Logout) === */
.auth-card {
    max-width: 420px;
    width: 100%;
    background: var(--auth-card);
    border: 1px solid var(--auth-card-border);
    border-radius: var(--auth-radius);
    overflow: hidden;
    box-shadow: var(--auth-shadow-lg);
    animation: auth-appear 0.5s cubic-bezier(0.4,0,0.2,1) both;
    text-align: center;
}

@keyframes auth-appear {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Left branding panel === */
.auth-brand {
    background: var(--auth-panel-bg);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(74,222,128,0.15) 0%, transparent 70%);
    top: -60px; right: -60px;
}

.auth-brand::after {
    content: '';
    position: absolute;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(74,222,128,0.1) 0%, transparent 70%);
    bottom: -40px; left: -40px;
}

.auth-brand-logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 2.5rem;
    position: relative;
    z-index: 1;
}

.auth-brand-logo-icon {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.auth-brand-logo-text {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.auth-brand-logo-text span {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-brand-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.auth-brand-emoji {
    font-size: 4rem;
    margin-bottom: 1.25rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.auth-brand-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.auth-brand-title em {
    font-style: normal;
    color: #86efac;
}

.auth-brand-desc {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.auth-brand-features {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.auth-brand-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.8);
}

.auth-brand-feature i {
    color: #4ade80;
    font-size: 0.9rem;
}

/* === Form panel (right side) === */
.auth-form-panel {
    padding: 2.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-header {
    margin-bottom: 1.75rem;
}

.auth-form-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--auth-text);
    margin-bottom: 0.3rem;
}

.auth-form-header p {
    font-size: 0.85rem;
    color: var(--auth-text-dim);
}

/* === Form elements === */
.auth-form-group {
    margin-bottom: 1.1rem;
}

.auth-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.auth-label-row label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-label-row a {
    font-size: 0.78rem;
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-label-row a:hover { color: var(--auth-primary-light); text-decoration: underline; }

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap i.auth-input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-light);
    font-size: 1rem;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    padding: 0.7rem 0.85rem 0.7rem 2.5rem;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-input-border);
    border-radius: var(--auth-radius-sm);
    color: var(--auth-text);
    font-size: 0.88rem;
    font-family: var(--auth-font);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

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

.auth-input:focus {
    border-color: var(--auth-input-focus-border);
    box-shadow: 0 0 0 3px var(--auth-input-focus-shadow);
    background: #fff;
}

.auth-input-toggle {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-text-light);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    transition: color 0.2s;
}

.auth-input-toggle:hover { color: var(--auth-primary); }

/* === Buttons === */
.auth-btn-primary {
    display: block;
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, var(--auth-primary-light), var(--auth-primary));
    border: none;
    border-radius: var(--auth-radius-sm);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: var(--auth-font);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(22,163,74,0.25);
    margin-top: 0.5rem;
}

.auth-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(22,163,74,0.35);
    color: #fff;
}

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

.auth-btn-secondary {
    display: block;
    width: 100%;
    padding: 0.7rem;
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: var(--auth-radius-sm);
    color: var(--auth-text-dim);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--auth-font);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    margin-top: 0.6rem;
}

.auth-btn-secondary:hover {
    background: #fff;
    border-color: var(--auth-primary-border);
    color: var(--auth-text);
}

/* === Social buttons === */
.auth-social-section { margin-bottom: 1.25rem; }

.auth-btn-social {
    width: 100%;
    padding: 0.7rem;
    border-radius: var(--auth-radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    font-family: var(--auth-font);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-bottom: 0.6rem;
    border: 1px solid var(--auth-card-border);
    background: #fff;
    color: var(--auth-text);
}

.auth-btn-social:hover {
    background: var(--auth-input-bg);
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.auth-btn-social svg { width: 18px; height: 18px; flex-shrink: 0; }

/* === Divider === */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1.25rem 0;
}

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

.auth-divider span {
    font-size: 0.78rem;
    color: var(--auth-text-light);
    white-space: nowrap;
}

/* === Links === */
.auth-links {
    text-align: center;
    font-size: 0.85rem;
    color: var(--auth-text-dim);
    margin-top: 1rem;
}

.auth-links a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-links a:hover { text-decoration: underline; }

/* === Alert === */
.auth-alert-error {
    background: rgba(220,38,38,0.06);
    border: 1px solid rgba(220,38,38,0.2);
    border-radius: var(--auth-radius-sm);
    padding: 0.7rem 0.9rem;
    font-size: 0.82rem;
    color: #b91c1c;
    margin-bottom: 1.1rem;
}

/* === Logout card sections === */
.auth-card-header {
    background: var(--auth-panel-bg);
    padding: 2.5rem 2rem 2rem;
    position: relative;
    overflow: hidden;
}

.auth-card-header::before {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(74,222,128,0.12) 0%, transparent 70%);
    top: -60px; right: -60px;
}

.auth-card-header-emoji {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.auth-card-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.35rem;
}

.auth-card-header p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

.auth-card-body {
    padding: 2rem 2rem 2.5rem;
}

.auth-card-message {
    background: var(--auth-primary-bg);
    border: 1px solid var(--auth-primary-border);
    border-radius: var(--auth-radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.auth-card-message p {
    font-size: 0.85rem;
    color: var(--auth-text-dim);
    line-height: 1.6;
    margin: 0;
}

.auth-card-message strong { color: var(--auth-text); }

/* === Password requirements (Register) === */
.auth-pw-requirements {
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: var(--auth-radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 1.1rem;
}

.auth-pw-requirements h6 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--auth-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.auth-pw-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.auth-pw-requirements li {
    font-size: 0.8rem;
    color: var(--auth-text-light);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.auth-pw-requirements li::before {
    content: '○';
    color: var(--auth-text-light);
    font-size: 0.7rem;
}

.auth-pw-requirements li.valid { color: var(--auth-primary); }
.auth-pw-requirements li.valid::before { content: '●'; color: var(--auth-primary); }

/* === Footer === */
.auth-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 1rem;
    font-size: 0.78rem;
    color: var(--auth-text-light);
}

/* === Responsive === */
@media (max-width: 768px) {
    .auth-container {
        grid-template-columns: 1fr;
        max-width: 440px;
    }
    .auth-brand { display: none; }
    .auth-form-panel { padding: 2rem 1.5rem; }
}
