/* ===================================
   BUILD.CV – Auth CSS
   Modern SaaS authentication pages
=================================== */

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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99,102,241,0.2);
    --bg: #0f0f13;
    --surface: #1a1a24;
    --surface-2: #22222e;
    --border: rgba(255,255,255,0.08);
    --text: #f0f0f5;
    --text-muted: #8b8ba7;
    --text-light: #a0a0b8;
    --success: #10b981;
    --error: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Inter', sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout */
.auth-page {
    display: flex;
    min-height: 100vh;
}

.auth-left {
    flex: 1;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1040 50%, #0f1a2a 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.auth-left::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(139,92,246,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.auth-right {
    width: 520px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-left: 1px solid var(--border);
}

/* Brand / Logo */
.logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    width: fit-content;
}

.logo-icon {
    font-size: 1.6rem;
    background: var(--primary);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.logo-dot { color: var(--primary); }

.auth-logo-img { width: 180px; height: auto; max-height: 60px; object-fit: contain; display: block; }

/* Auth Hero */
.auth-hero {
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-hero p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

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

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.feature-icon {
    width: 22px;
    height: 22px;
    background: rgba(99,102,241,0.2);
    border: 1px solid rgba(99,102,241,0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Stat Cards */
.auth-stat-cards {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.stat-card strong {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card span {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Auth Card */
.auth-card {
    width: 100%;
    max-width: 420px;
}

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

.auth-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-header a, .auth-terms a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

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

/* Alerts */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    border-left: 3px solid;
}

.alert-error {
    background: rgba(239,68,68,0.1);
    border-color: var(--error);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16,185,129,0.1);
    border-color: var(--success);
    color: #6ee7b7;
}

.alert-success a { color: #34d399; }

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group small {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.form-group small strong { color: var(--primary); }

.form-group input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

/* Input prefix/suffix */
.input-prefix, .input-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix .prefix {
    position: absolute;
    left: 0.85rem;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.input-prefix input { padding-left: 1.75rem; }

.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toggle-password:hover { opacity: 1; }

.forgot-link {
    font-size: 0.82rem;
    color: var(--primary) !important;
    text-decoration: none;
    font-weight: 400 !important;
}

/* Buttons */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 20px rgba(99,102,241,0.4);
    transform: translateY(-1px);
}

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

.btn-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
    color: var(--text);
}

.btn-full { width: 100%; }

.btn-arrow { font-size: 1.1rem; }

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

.auth-terms {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Centered variant */
.auth-page-centered {
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1040 50%, #0f1a2a 100%);
}

.auth-card-solo {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
}

.auth-brand-centered {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.text-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.text-link:hover { text-decoration: underline; }

/* Auth brand wrapper */
.auth-brand { margin-bottom: 0.5rem; }

/* Forgot password row */
.form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: -0.25rem;
}

/* Responsive */
@media (max-width: 900px) {
    .auth-left  { display: none; }
    .auth-right { width: 100%; border-left: none; }
    .form-row   { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .auth-right       { padding: 1.25rem 1rem; }
    .auth-card        { max-width: 100%; }
    .auth-card-solo   { padding: 1.5rem 1.25rem; border-radius: 12px; }
    .auth-header h2   { font-size: 1.35rem; }
    .auth-header p    { font-size: 0.85rem; }
    .form-group input { font-size: 16px; padding: 0.7rem 0.9rem; }
    .btn-primary,
    .btn-outline      { padding: 0.8rem 1rem; font-size: 0.9rem; }
    .btn-google       { font-size: 0.85rem; padding: 0.65rem 0.9rem; }
    .auth-stat-cards  { flex-direction: column; gap: 0.75rem; }
    .stat-card        { padding: 0.75rem 1rem; }
    .auth-brand-centered { margin-bottom: 1.25rem; }
}

/* Inputs : pas de zoom auto iOS */
.form-group input, .form-group textarea, .form-group select {
    font-size: max(16px, 0.95rem);
}

/* Google OAuth button */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 0.7rem 1rem;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    margin-bottom: 1rem;
}
.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    color: #3c4043;
    text-decoration: none;
}

/* Divider between Google and email form */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    color: var(--text-muted, #94a3b8);
    font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, #e2e8f0);
}
