/* Apex Arena - styles globaux
   Direction visuelle B (placeholder simple en attendant pick B1/B2/B3/B4 final).
   Aesthetic : dark + bold + game-feel + accessible mobile-first.
*/

:root {
  --bg: #0a0a0a;
  --bg-elev: #1a1a1a;
  --bg-card: #1f1f33;
  --fg: #ffffff;
  --fg-muted: #b3b3b3;
  --fg-soft: #888888;
  --accent: #f59e0b;          /* gold - CTA + highlight */
  --accent-hover: #fbbf24;
  --secondary: #8b5cf6;       /* purple - magic / rare */
  --danger: #ef4444;
  --success: #4ade80;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --radius: 12px;
  --radius-lg: 16px;
  --maxw-content: 560px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

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

button { font-family: inherit; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #1a1000;
}
.btn-primary:hover { background: var(--accent-hover); color: #1a1000; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { color: var(--fg); border-color: var(--fg-muted); }

.btn-full {
  display: block;
  width: 100%;
  margin-top: 12px;
}

/* ============================================================
   PAGE LANDING (index.html)
   ============================================================ */

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  background: radial-gradient(ellipse at top, rgba(245, 158, 11, 0.08), transparent 60%), var(--bg);
}

.hero-stack {
  max-width: var(--maxw-content);
  width: 100%;
  text-align: center;
}

.hero-brand { margin-bottom: 32px; }

.hero-title {
  margin: 0;
  font-size: clamp(48px, 12vw, 80px);
  font-weight: 900;
  letter-spacing: -2px;
  background: linear-gradient(180deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  margin-top: 4px;
  font-size: 14px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--fg-soft);
  font-weight: 600;
}

.hero-tagline {
  margin: 24px 0 40px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-muted);
}

.hero-fineprint {
  margin-top: 32px;
  font-size: 12px;
  color: var(--fg-soft);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: rgba(74, 222, 128, 0.1);
  border: 2px solid var(--success);
  border-radius: 50%;
  font-size: 36px;
  color: var(--success);
  font-weight: 700;
}
.success-title {
  margin: 0 0 16px;
  font-size: clamp(36px, 9vw, 56px);
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--success);
}
.error-title {
  margin: 0 0 16px;
  font-size: clamp(32px, 8vw, 48px);
  font-weight: 900;
  color: var(--danger);
}

/* ============================================================
   PAGE ONBOARDING
   ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  padding: 12px 16px;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--fg);
  font-size: 22px;
}
.topbar-back:hover { background: var(--bg-elev); }
.topbar-title {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.onboarding {
  max-width: var(--maxw-content);
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.onboarding-step {
  position: relative;
  margin-top: 32px;
  padding: 24px 20px;
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.onboarding-step h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
}

.step-num {
  position: absolute;
  top: -16px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #1a1000;
  border-radius: 50%;
  font-weight: 800;
  font-size: 15px;
}

.install-steps {
  margin: 12px 0;
  padding-left: 22px;
  color: var(--fg-muted);
  line-height: 1.7;
}
.install-steps strong { color: var(--fg); }

details {
  margin-top: 16px;
  padding: 12px 0 0;
  border-top: 1px solid var(--border);
  color: var(--fg-soft);
  font-size: 14px;
}
details summary {
  cursor: pointer;
  color: var(--fg-muted);
  font-weight: 600;
}

.step-intro {
  margin: 0 0 16px;
  color: var(--fg-muted);
}

.step-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--fg-soft);
  line-height: 1.5;
}

/* Form fields */
.field {
  display: block;
  margin-bottom: 20px;
}
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.field-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
}
.field-input:focus {
  outline: none;
  border-color: var(--accent);
}

.source-pick {
  border: none;
  margin: 0 0 20px;
  padding: 0;
}
.source-pick legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.radio-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.radio-card:has(input:checked) {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.06);
}
.radio-card input[type="radio"] {
  margin-top: 4px;
  accent-color: var(--accent);
}
.radio-card-title {
  font-weight: 700;
  margin-bottom: 2px;
}
.radio-card-desc {
  font-size: 13px;
  color: var(--fg-soft);
}

.form-error {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--danger);
  border-radius: 4px;
  color: #ffb4b4;
  font-size: 14px;
}

.success-state {
  text-align: center;
  padding: 24px 8px;
}
.success-state h3 {
  margin: 0 0 12px;
  font-size: 22px;
  color: var(--success);
}
.success-state .hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--fg-soft);
}

/* ============================================================
   PAGE LOGIN (error state handler)
   ============================================================ */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}
.login-card {
  max-width: 420px;
  width: 100%;
  padding: 32px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}
.login-title {
  margin: 0 0 20px;
  font-size: 24px;
}
.login-message {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}
.login-message-error {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--danger);
  color: #ffb4b4;
}
.login-message-info {
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--fg-soft);
  color: var(--fg-muted);
}
