:root {
  /* Colors - Premium dark blue & gold theme */
  --primary: #1e3a5f;
  --primary-light: #2d5280;
  --primary-dark: #0f1f33;
  --accent: #c9a227;
  --accent-light: #e6c347;
  --background: #0a0f1a;
  --surface: #111827;
  --surface-light: #1f2937;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;

  /* Card background */
  --card-bg: rgba(17, 24, 39, 0.8);
  --border: rgba(255, 255, 255, 0.05);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', var(--font-sans);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(201, 162, 39, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Header background */
  --header-bg: rgba(10, 15, 26, 0.8);
}



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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(30, 58, 95, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(201, 162, 39, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

p {
  color: var(--text-muted);
  max-width: 65ch;
}

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

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

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--primary-dark);
  box-shadow: 0 4px 15px rgba(201, 162, 39, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 162, 39, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--surface-light);
}

.btn-secondary:hover {
  background: var(--surface-light);
  border-color: var(--primary-light);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Cards */
.card {
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-light) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.card-glass {
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Form elements */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 500;
  color: var(--text);
}

.form-input,
.form-select {
  width: 100%;
  padding: var(--space-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--surface-light);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

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

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.5rem;
  padding-right: 3rem;
}

.form-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: var(--space-xs);
}

/* Stats display */
.stat-card {
  text-align: center;
  padding: var(--space-xl);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Grid layouts */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: var(--space-md) 0;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  z-index: 10;
}

.logo-img {
  height: 50px;
  width: auto;
  transition: transform 0.3s ease;
  /* Masque radial strict pour ne garder que le centre (le dôme) et supprimer le rectangle de fond */
  -webkit-mask-image: radial-gradient(closest-side, black 65%, transparent 100%);
  mask-image: radial-gradient(closest-side, black 65%, transparent 100%);
  mix-blend-mode: lighten;
}

.logo:hover .logo-img {
  transform: scale(1.05);
  filter: brightness(1.2);
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text);
}

/* Hero section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 80px;
  position: relative;
  overflow: hidden;
  /* Fond sombre profond pour faire ressortir l'or */
  background: radial-gradient(circle at top, #0a1628 0%, #040810 100%);
}

.hero-bg-logo {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vw;
  height: 100vh;

  background-image: url('../images/logo-assascore.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: 70vh;
  /* Larger for visual impact */

  opacity: 0.25;
  /* More visible gold */
  pointer-events: none;
  z-index: 0;

  /* Gentle radial mask - fade only at edges */
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 70%);
  mask-image: radial-gradient(circle at center, black 30%, transparent 70%);

  /* Keep gold coloration */
  filter: saturate(1.3) brightness(1.1);
}

.hero .container {
  position: relative;
  z-index: 1;
  /* Au dessus du logo */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-content {
  max-width: 700px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 50px;
  font-size: 0.875rem;
  color: var(--accent);
  margin-bottom: var(--space-lg);
}

.hero h1 {
  margin-bottom: var(--space-lg);
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: var(--space-xl);
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--surface-light);
}

.hero-stat {
  text-align: left;
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.hero-stat-label {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Steps section */
.steps {
  padding: var(--space-3xl) 0;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
}

.step-card {
  position: relative;
  padding: var(--space-xl);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-light);
  transition: all var(--transition-base);
}

.step-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.step-number {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: var(--primary-dark);
  font-weight: 700;
  border-radius: 50%;
}

.step-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: 1.5rem;
}

.step-title {
  margin-bottom: var(--space-sm);
}

@media (max-width: 768px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

/* Ad banner */
.ad-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-banner-content {
  flex: 1;
}

.ad-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
}

.ad-banner h4 {
  margin-bottom: var(--space-xs);
}

.ad-banner p {
  font-size: 0.875rem;
}

.ad-banner .btn {
  white-space: nowrap;
}

/* Footer */
.footer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--surface-light);
  text-align: center;
}

.footer p {
  margin: 0 auto;
  font-size: 0.875rem;
}

/* Auth page */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-header .logo {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.auth-success {
  text-align: center;
  padding: var(--space-xl);
}

.auth-success-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-radius: 50%;
  margin: 0 auto var(--space-lg);
  font-size: 2rem;
}

/* Submit page */
.submit-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  padding-top: 100px;
}

.submit-card {
  width: 100%;
  max-width: 500px;
}

.submit-info {
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-xl);
  font-size: 0.875rem;
  color: var(--accent);
}

/* Dashboard */
.dashboard {
  padding-top: 100px;
  padding-bottom: var(--space-3xl);
}

.dashboard-header {
  margin-bottom: var(--space-2xl);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.rank-card {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-xl);
}

.rank-position {
  text-align: center;
}

.rank-number {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.rank-suffix {
  font-size: 1.5rem;
  color: var(--accent-light);
}

.rank-total {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.rank-details {
  flex: 1;
}

.percentile-bar {
  height: 8px;
  background: var(--surface-light);
  border-radius: 4px;
  overflow: hidden;
  margin-top: var(--space-md);
}

.percentile-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
  border-radius: 4px;
  transition: width var(--transition-slow);
}

/* Chart container */
.chart-container {
  height: 300px;
  margin-top: var(--space-lg);
}

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Toast notifications */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-base);
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--success);
}

.toast.error {
  border-color: var(--error);
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.mt-sm {
  margin-top: var(--space-sm);
}

.mt-md {
  margin-top: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.mb-xl {
  margin-bottom: var(--space-xl);
}

.hidden {
  display: none !important;
}