/* =====================================================
   SPORT CONNECT MOROCCO · main.css
   Palette : NEON RUNNER (Dark + Light auto-switch)
   ===================================================== */

/* ===== VARIABLES NEON RUNNER · DARK MODE (default) ===== */
:root {
  /* Backgrounds */
  --bg-page: #06080C;
  --bg-surface: #0B0F14;
  --bg-elevated: #11161D;
  --bg-card-hi: #1A2026;
  
  /* Texts */
  --text-hi: #E8F2EC;
  --text-md: #9CA8AC;
  --text-lo: #5C6770;
  --text-dim: #3A4148;
  
  /* Primary lime + secondary cyan (signature Neon Runner) */
  --lime: #C7FB3A;
  --lime-deep: #9FCC2E;
  --cyan: #76FBFF;
  --cyan-deep: #3FD4D9;
  
  /* Accents (kept for sport variety) */
  --amber: #FFB627;
  --purple: #B084F7;
  --pink: #FF6FA1;
  --gold: #FFD700;
  
  /* Status */
  --success: #C7FB3A;
  --danger: #F87171;
  --warning: #FFB627;
  
  /* Borders */
  --border: rgba(199, 251, 58, 0.08);
  --border-hi: rgba(199, 251, 58, 0.16);
  --border-mid: rgba(255, 255, 255, 0.08);
  
  /* Fonts */
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Theme flag */
  --mode: 'dark';
}

/* ===== LIGHT MODE · auto via prefers-color-scheme ===== */
@media (prefers-color-scheme: light) {
  :root {
    --bg-page: #F9FAF7;
    --bg-surface: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --bg-card-hi: #F0F4ED;
    
    --text-hi: #020405;
    --text-md: #404952;
    --text-lo: #6B7480;
    --text-dim: #9CA3AF;
    
    /* Lime + cyan UNCHANGED — they remain the signature */
    
    --border: rgba(2, 4, 5, 0.08);
    --border-hi: rgba(2, 4, 5, 0.16);
    --border-mid: rgba(2, 4, 5, 0.06);
    
    --mode: 'light';
  }
}

/* ===== MANUAL OVERRIDE via [data-theme] ===== */
html[data-theme="dark"] {
  --bg-page: #06080C; --bg-surface: #0B0F14;
  --bg-elevated: #11161D; --bg-card-hi: #1A2026;
  --text-hi: #E8F2EC; --text-md: #9CA8AC;
  --text-lo: #5C6770; --text-dim: #3A4148;
  --border: rgba(199, 251, 58, 0.08);
  --border-hi: rgba(199, 251, 58, 0.16);
  --mode: 'dark';
}
html[data-theme="light"] {
  --bg-page: #F9FAF7; --bg-surface: #FFFFFF;
  --bg-elevated: #FFFFFF; --bg-card-hi: #F0F4ED;
  --text-hi: #020405; --text-md: #404952;
  --text-lo: #6B7480; --text-dim: #9CA3AF;
  --border: rgba(2, 4, 5, 0.08);
  --border-hi: rgba(2, 4, 5, 0.16);
  --mode: 'light';
}

/* ===== RESET ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-page);
  color: var(--text-hi);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .3s, color .3s;
}

button { cursor: pointer; font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ===== UTILITIES ===== */
.ac { color: var(--lime); }
.cy { color: var(--cyan); }

/* ===== FLASH MESSAGES ===== */
.flash-messages {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
  max-width: 400px;
}
.flash {
  padding: 14px 20px; border-radius: 12px;
  font-family: var(--font-display); font-weight: 500; font-size: 13px;
  border: 1px solid; backdrop-filter: blur(10px);
  animation: flashIn 0.3s ease-out;
}
.flash-success {
  background: rgba(199, 251, 58, 0.15);
  border-color: var(--lime);
  color: var(--lime);
}
.flash-error {
  background: rgba(248, 113, 113, 0.15);
  border-color: var(--danger);
  color: var(--danger);
}
.flash-warning {
  background: rgba(255, 182, 39, 0.15);
  border-color: var(--warning);
  color: var(--warning);
}
.flash-info {
  background: rgba(118, 251, 255, 0.1);
  border-color: var(--cyan);
  color: var(--cyan);
}
@keyframes flashIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== LANDING PAGE ===== */
.landing-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background-image:
    radial-gradient(ellipse at top, rgba(199, 251, 58, 0.06), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(118, 251, 255, 0.05), transparent 50%);
}
.landing-hero {
  max-width: 720px; text-align: center;
}
.landing-eb {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--cyan);
  text-transform: uppercase; letter-spacing: 0.2em;
  margin-bottom: 24px; font-weight: 700;
}
.landing-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 56px;
  line-height: 1.1; letter-spacing: -0.025em;
  color: var(--text-hi); margin-bottom: 24px;
}
.landing-title .ac {
  /* ============================================================
     SIGNATURE NEON RUNNER · lime + cyan (adaptatif)
     Couleurs vives en dark, version contrastée en light
     ============================================================ */
  
  /* DARK MODE (défaut) · lime + cyan vifs */
  background: linear-gradient(135deg, #C7FB3A 0%, #76FBFF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* LIGHT MODE auto · couleurs profondes pour contraste sur fond clair */
@media (prefers-color-scheme: light) {
  .landing-title .ac {
    background: linear-gradient(135deg, #5A8B22 0%, #2A8B8E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
}

/* LIGHT MODE forcé */
html[data-theme="light"] .landing-title .ac {
  background: linear-gradient(135deg, #5A8B22 0%, #2A8B8E 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* DARK MODE forcé */
html[data-theme="dark"] .landing-title .ac {
  background: linear-gradient(135deg, #C7FB3A 0%, #76FBFF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-sub {
  font-size: 18px; color: var(--text-md);
  line-height: 1.6; margin-bottom: 40px;
}
.landing-cta {
  display: flex; gap: 14px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 32px;
}
.btn-primary, .btn-secondary {
  padding: 14px 28px; border-radius: 12px;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: -0.01em; border: none; cursor: pointer;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  color: #06080C;
  box-shadow: 0 8px 24px rgba(199, 251, 58, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(199, 251, 58, 0.4);
}
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-hi);
  border: 1px solid var(--border-hi);
}
.btn-secondary:hover {
  border-color: var(--lime);
  color: var(--lime);
}

.landing-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-md); text-transform: uppercase;
  letter-spacing: 0.15em; font-weight: 600;
}
.landing-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== AUTH PAGES (login / register) ===== */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
  background-image:
    radial-gradient(ellipse at top, rgba(199, 251, 58, 0.04), transparent 60%);
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hi);
  border-radius: 20px; padding: 36px 32px;
  position: relative; overflow: hidden;
}
.auth-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--lime), var(--cyan), transparent);
}
.auth-logo {
  display: flex; align-items: center; gap: 12px; margin-bottom: 28px;
}
.auth-logo-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  color: #06080C;
}
.auth-logo-icon svg { width: 22px; height: 22px; }
.auth-logo-text {
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
  letter-spacing: -0.01em;
}
.auth-logo-sub {
  font-family: var(--font-mono); font-size: 9px; color: var(--text-lo);
  text-transform: uppercase; letter-spacing: 0.2em;
  margin-top: 2px; font-weight: 600;
}
.auth-eb {
  font-family: var(--font-mono); font-size: 11px; color: var(--cyan);
  text-transform: uppercase; letter-spacing: 0.2em;
  margin-bottom: 8px; font-weight: 700;
}
.auth-title {
  font-family: var(--font-display); font-weight: 600; font-size: 26px;
  letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 8px;
}
.auth-sub {
  font-size: 13px; color: var(--text-md); margin-bottom: 28px;
}

.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: 12px; color: var(--text-md); margin-bottom: 8px;
  letter-spacing: -0.005em;
}
.form-input {
  width: 100%; padding: 13px 16px;
  background: var(--bg-page); color: var(--text-hi);
  border: 1px solid var(--border-hi); border-radius: 10px;
  font-family: var(--font-body); font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(199, 251, 58, 0.1);
}
.form-input::placeholder { color: var(--text-lo); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-help {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-lo);
  margin-top: 6px; letter-spacing: 0.05em;
}

.btn-submit {
  width: 100%; padding: 14px 20px;
  background: linear-gradient(135deg, var(--lime), var(--cyan));
  color: #06080C; border: none; border-radius: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  letter-spacing: -0.01em; cursor: pointer; transition: all 0.2s;
  margin-top: 8px;
}
.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(199, 251, 58, 0.3);
}
.btn-submit:disabled {
  opacity: 0.6; cursor: not-allowed; transform: none;
}

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0; color: var(--text-lo);
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.15em;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-hi);
}

.auth-link-row {
  text-align: center; font-size: 13px; color: var(--text-md);
  margin-top: 8px;
}
.auth-link-row a {
  color: var(--lime); font-weight: 600;
}
.auth-link-row a:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .landing-title { font-size: 36px; }
  .landing-sub { font-size: 16px; }
  .auth-card { padding: 28px 24px; }
  .form-row { grid-template-columns: 1fr; }
}
