/* ============================================
   AUTH PAGES - Login & Register
   Matches homepage design system
   ============================================ */

:root {
    --color-bg: #fafafa;
    --color-bg-alt: #ffffff;
    --color-bg-dark: #0c1929;
    --color-bg-darker: #060d15;
    
    --color-text: #1a2332;
    --color-text-secondary: #5a6573;
    --color-text-muted: #8a929d;
    --color-text-light: #ffffff;
    --color-text-inverse: #e8eaed;
    
    --color-primary: #1e3a5f;
    --color-primary-dark: #0f2744;
    --color-primary-light: #2d4f7a;
    
    --color-accent: #c9a227;
    --color-accent-light: #e4c04a;
    
    --color-success: #2d8659;
    --color-error: #dc2626;
    
    --color-border: #e5e7eb;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Fraunces', Georgia, serif;
    
    --transition-fast: 120ms ease-out;
    --transition-base: 200ms ease-out;
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-light);
}

/* ============================================
   LAYOUT
   ============================================ */
.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

@media (max-width: 900px) {
    .auth-container {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   LEFT PANEL - Value Reinforcement
   ============================================ */
.auth-panel {
    background: var(--color-bg-dark);
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Subtle grid pattern */
.auth-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.5;
    pointer-events: none;
}

/* Gradient glow */
.auth-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: radial-gradient(ellipse 100% 100% at 50% 100%, rgba(201, 162, 39, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.auth-panel-content {
    position: relative;
    z-index: 1;
    max-width: 400px;
}

@media (max-width: 900px) {
    .auth-panel {
        padding: 32px 24px;
    }
    
    .auth-panel-content {
        text-align: center;
    }
}

/* Logo */
.auth-logo {
    display: inline-flex;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 48px;
}

.logo-parlay {
    color: var(--color-text-light);
}

.logo-buddy {
    color: var(--color-accent);
}

@media (max-width: 900px) {
    .auth-logo {
        margin-bottom: 24px;
    }
}

/* Value Prop */
.auth-value {
    margin-bottom: 40px;
}

.auth-value h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-light);
    line-height: 1.2;
    margin-bottom: 12px;
}

.auth-value p {
    font-size: 1rem;
    color: var(--color-text-inverse);
    opacity: 0.8;
    line-height: 1.6;
}

@media (max-width: 900px) {
    .auth-value h1 {
        font-size: 1.5rem;
    }
}

/* Features List (Login) */
.auth-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text-inverse);
    font-size: 0.938rem;
}

.feature-item svg {
    flex-shrink: 0;
    color: var(--color-success);
}

@media (max-width: 900px) {
    .auth-features {
        display: none;
    }
}

/* Steps (Register) */
.auth-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: var(--color-text-light);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: 50%;
}

.step-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-text strong {
    color: var(--color-text-light);
    font-size: 0.938rem;
    font-weight: 600;
}

.step-text span {
    color: var(--color-text-inverse);
    opacity: 0.7;
    font-size: 0.875rem;
}

@media (max-width: 900px) {
    .auth-steps {
        display: none;
    }
}

/* Trust Badge */
.auth-trust {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

@media (max-width: 900px) {
    .auth-trust {
        justify-content: center;
    }
}

/* ============================================
   RIGHT PANEL - Form
   ============================================ */
.auth-form-panel {
    background: var(--color-bg-alt);
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

@media (max-width: 900px) {
    .auth-form-panel {
        padding: 32px 24px;
    }
}

/* Form Header */
.auth-form-header {
    margin-bottom: 32px;
}

.auth-form-header h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

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

.auth-form-header p a {
    color: var(--color-accent);
    font-weight: 500;
    position: relative;
    z-index: 10;
}

.auth-form-header p a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Messages */
.auth-message {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 24px;
}

.auth-message.success {
    background: rgba(45, 134, 89, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(45, 134, 89, 0.2);
}

.auth-message.error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--color-error);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

/* Form */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-group input {
    padding: 12px 16px;
    font-size: 1rem;
    font-family: var(--font-sans);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-group input::placeholder {
    color: var(--color-text-muted);
}

.field-error {
    font-size: 0.813rem;
    color: var(--color-error);
}

/* Form Footer */
.form-footer {
    display: flex;
    justify-content: flex-end;
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

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

/* Submit Button */
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-sans);
    background: var(--color-primary);
    color: var(--color-text-light);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-base), transform var(--transition-fast);
}

.btn-submit:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

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

/* Loading state */
.btn-submit.is-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-submit.is-loading .btn-label {
    visibility: hidden;
}

.btn-submit.is-loading svg {
    display: none;
}

.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-left-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-submit.is-loading .btn-spinner {
    display: block;
    position: absolute;
}

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

/* Secondary Button */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-sans);
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    width: 100%;
}

.btn-secondary:hover {
    background: var(--color-bg);
    border-color: var(--color-text-muted);
    color: var(--color-text);
}

.resend-form {
    margin-top: 16px;
}

/* Terms Text */
.terms-text {
    font-size: 0.813rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 8px;
}

.terms-text a {
    color: var(--color-text-secondary);
}

.terms-text a:hover {
    color: var(--color-primary);
}

/* Honeypot */
.hp-field {
    position: absolute;
    left: -100vw;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Back Link / Alt Action */
.auth-alt-action {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.back-link:hover {
    color: var(--color-primary);
}

.back-link svg {
    transition: transform var(--transition-base);
}

.back-link:hover svg {
    transform: translateX(-3px);
}
