/* ASVLB Global Design System */

:root {
  /* Primary Colors - Sports Energy */
  --asvlb-primary: #1e40af;
  --asvlb-primary-light: #3b82f6;
  --asvlb-primary-dark: #1e3a8a;

  /* Secondary Colors - Victory & Action */
  --asvlb-secondary: #059669;
  --asvlb-accent: #ea580c;
  --asvlb-warning: #d97706;
  --asvlb-danger: #dc2626;

  /* Neutral Grays */
  --asvlb-dark: #0f172a;
  --asvlb-medium: #475569;
  --asvlb-light: #f8fafc;
  --asvlb-border: #e2e8f0;

  /* Gradients */
  --asvlb-gradient-primary: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  --asvlb-gradient-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --asvlb-gradient-energy: linear-gradient(135deg, #ea580c 0%, #f97316 100%);

  /* Spacing & Sizing */
  --asvlb-radius: 8px;
  --asvlb-radius-lg: 12px;
  --asvlb-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --asvlb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  /* Backward compatibility aliases (tournament) */
  --tournament-primary: var(--asvlb-primary);
  --tournament-primary-light: var(--asvlb-primary-light);
  --tournament-primary-dark: var(--asvlb-primary-dark);
  --tournament-secondary: var(--asvlb-secondary);
  --tournament-accent: var(--asvlb-accent);
  --tournament-warning: var(--asvlb-warning);
  --tournament-danger: var(--asvlb-danger);
  --tournament-dark: var(--asvlb-dark);
  --tournament-medium: var(--asvlb-medium);
  --tournament-light: var(--asvlb-light);
  --tournament-border: var(--asvlb-border);
  --tournament-gradient-primary: var(--asvlb-gradient-primary);
  --tournament-gradient-success: var(--asvlb-gradient-success);
  --tournament-gradient-energy: var(--asvlb-gradient-energy);
  --tournament-radius: var(--asvlb-radius);
  --tournament-radius-lg: var(--asvlb-radius-lg);
  --tournament-shadow: var(--asvlb-shadow);
  --tournament-shadow-lg: var(--asvlb-shadow-lg);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Navigation */
.navbar,
.asvlb-navbar,
.tournament-navbar {
  background-color: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
  font-weight: 700;
  color: var(--asvlb-primary) !important;
}

.navbar-nav .nav-link {
  color: var(--asvlb-medium) !important;
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--asvlb-primary) !important;
}

.navbar-toggler {
  border: 1px solid rgba(226, 232, 240, 0.5);
  padding: 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.15);
}

/* Footer */
.asvlb-footer,
.tournament-footer {
  background-color: white;
  border-top: 1px solid var(--asvlb-border);
  padding: 1.5rem 0;
}

/* Hero & Headers */
.asvlb-hero,
.asvlb-header,
.tournament-hero,
.tournament-header {
  background: var(--asvlb-gradient-primary);
  color: white;
  border-radius: var(--asvlb-radius-lg);
  padding: 3rem 0;
  margin-bottom: 2rem;
}

/* Cards */
.asvlb-card,
.tournament-card {
  border-radius: var(--asvlb-radius-lg) !important;
  box-shadow: var(--asvlb-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.asvlb-card:hover,
.tournament-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--asvlb-shadow-lg);
}

.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: var(--asvlb-radius-lg);
  border: none;
  box-shadow: var(--asvlb-shadow);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--asvlb-shadow-lg);
}

/* Tables */
.asvlb-table thead,
.tournament-table thead,
.list-table thead {
  background: var(--asvlb-gradient-primary);
  color: white;
}

.list-table {
  background: white;
  border-radius: var(--asvlb-radius-lg);
  overflow: hidden;
  padding: 1.5rem;
  box-shadow: var(--asvlb-shadow);
}

.list-table th {
  border: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
  padding: 1rem 0.75rem;
}

.list-table tbody tr {
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--asvlb-border);
}

.list-table tbody tr:hover {
  background-color: var(--asvlb-light);
}

.list-table td {
  padding: 1rem 0.75rem;
  border: none;
  vertical-align: middle;
}

/* Event cards (home page) */
.event-card {
  border-radius: var(--asvlb-radius-lg);
  box-shadow: var(--asvlb-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--asvlb-border);
  background: white;
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--asvlb-shadow-lg);
}

.event-card-date {
  color: var(--asvlb-primary);
  font-weight: 700;
}

/* Utility classes */
.text-asvlb-primary,
.text-tournament-primary {
  color: var(--asvlb-primary) !important;
}

.text-asvlb-secondary,
.text-tournament-secondary {
  color: var(--asvlb-secondary) !important;
}

.text-asvlb-accent,
.text-tournament-accent {
  color: var(--asvlb-accent) !important;
}

.text-asvlb-warning,
.text-tournament-warning {
  color: var(--asvlb-warning) !important;
}

.bg-asvlb-light,
.bg-tournament-light {
  background-color: var(--asvlb-light) !important;
}

/* Buttons */
.btn-asvlb-primary,
.btn-tournament-primary {
  background: var(--asvlb-gradient-primary);
  border: none;
  color: white;
  font-weight: 600;
}

.btn-asvlb-primary:hover,
.btn-tournament-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--asvlb-shadow-lg);
  color: white;
}

.btn-asvlb-success,
.btn-tournament-success {
  background: var(--asvlb-gradient-success);
  border: none;
  color: white;
  font-weight: 600;
}

.btn-asvlb-success:hover,
.btn-tournament-success:hover {
  transform: translateY(-2px);
  color: white;
}

.btn-primary {
  background: var(--asvlb-primary);
  border-color: var(--asvlb-primary);
  border-radius: var(--asvlb-radius);
  font-weight: 500;
}

.btn-primary:hover {
  background: var(--asvlb-primary-dark);
  border-color: var(--asvlb-primary-dark);
}

.btn-tournament-action {
  background: var(--asvlb-gradient-energy);
  border: none;
  border-radius: var(--asvlb-radius);
  color: white;
  font-weight: 500;
  transition: filter 0.3s ease;
}

.btn-tournament-action:hover {
  filter: brightness(1.1);
  color: white;
}

/* Forms */
.form-control,
.form-select {
  border-radius: var(--asvlb-radius) !important;
  border: 1px solid var(--asvlb-border);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--asvlb-primary);
  box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.25);
}

.form-participant-card {
  border: 1px solid var(--asvlb-border);
  border-radius: var(--asvlb-radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: white;
  box-shadow: var(--asvlb-shadow);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.form-participant-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--asvlb-shadow-lg);
}

/* Badges & indicators */
.category-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: var(--asvlb-radius);
  font-size: 0.875rem;
  font-weight: 500;
}

.category-age {
  background: var(--asvlb-primary);
  color: white;
}

.category-weight {
  background: var(--asvlb-secondary);
  color: white;
}

.gender-badge {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.875rem;
}

.gender-male {
  background: #3b82f6;
  color: white;
}

.gender-female {
  background: #ec4899;
  color: white;
}

.presence-indicator {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  display: inline-block;
}

.presence-yes {
  background: var(--asvlb-secondary);
}

.presence-no {
  background: var(--asvlb-danger);
}

.presence-waitlist {
  background: var(--asvlb-primary);
}

/* ===================== Auth pages ===================== */

body.auth-page {
  background:
    radial-gradient(circle at 0% 0%, rgba(59, 130, 246, 0.12), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(5, 150, 105, 0.1), transparent 40%),
    var(--asvlb-light);
}

.auth-main {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}

.auth-shell {
  width: 100%;
}

.auth-card {
  background: #fff;
  border-radius: var(--asvlb-radius-lg);
  box-shadow: var(--asvlb-shadow-lg);
  border: 1px solid var(--asvlb-border);
  overflow: hidden;
}

.auth-card::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--asvlb-gradient-primary);
}

.auth-card-body {
  padding: 2rem 1.75rem;
}

@media (min-width: 768px) {
  .auth-card-body {
    padding: 2.5rem 2.25rem;
  }
}

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

.auth-brand-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.auth-brand-icon {
  font-size: 2.75rem;
  color: var(--asvlb-primary);
  line-height: 1;
}

.auth-brand-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--asvlb-primary);
  letter-spacing: 0.02em;
}

.auth-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--asvlb-dark);
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-lead {
  color: var(--asvlb-medium);
  font-size: 0.925rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-footer-note {
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--asvlb-medium);
}

.auth-link {
  color: var(--asvlb-primary);
  font-weight: 500;
  text-decoration: none;
}

.auth-link:hover {
  color: var(--asvlb-primary-dark);
  text-decoration: underline;
}

/* Formulaires auth (login manuel + crispy) */
.auth-form .form-label,
.auth-card .form-label {
  font-weight: 500;
  color: var(--asvlb-dark);
  margin-bottom: 0.35rem;
}

.auth-form .input-group-text {
  background: var(--asvlb-light);
  border-color: var(--asvlb-border);
  color: var(--asvlb-primary);
}

.auth-form .input-group .form-control {
  border-left: 0;
}

.auth-form .input-group:focus-within .input-group-text {
  border-color: var(--asvlb-primary);
  color: var(--asvlb-primary-dark);
}

.auth-form .input-group:focus-within .form-control {
  border-color: var(--asvlb-primary);
}

.auth-form .btn-primary,
.auth-card button[type="submit"].btn-primary,
.auth-card input[type="submit"].btn-primary {
  background: var(--asvlb-gradient-primary);
  border: none;
  font-weight: 600;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.auth-form .btn-primary:hover,
.auth-card button[type="submit"].btn-primary:hover,
.auth-card input[type="submit"].btn-primary:hover {
  background: var(--asvlb-primary-dark);
  border: none;
}

.auth-btn-passkey {
  border-color: var(--asvlb-border);
  color: var(--asvlb-dark);
  font-weight: 500;
}

.auth-btn-passkey:hover {
  background: var(--asvlb-light);
  border-color: var(--asvlb-primary-light);
  color: var(--asvlb-primary);
}

.auth-form-actions .btn + .btn,
.auth-form-actions .btn + a.btn {
  margin-top: 0;
}

.auth-form-footer {
  margin-top: 1rem;
  text-align: center;
}

.auth-card .asteriskField {
  color: var(--asvlb-danger);
  margin-left: 0.15rem;
}

.auth-card .invalid-feedback,
.auth-card .text-danger {
  font-size: 0.8125rem;
}

.auth-card .alert {
  border-radius: var(--asvlb-radius);
  font-size: 0.925rem;
}

/* Pages de statut (activation, confirmation…) */
.auth-status {
  text-align: center;
}

.auth-status-icon {
  font-size: 3rem;
  line-height: 1;
  display: block;
  margin-bottom: 0.75rem;
}

.auth-status-icon--success {
  color: var(--asvlb-secondary);
}

.auth-status-icon--primary {
  color: var(--asvlb-primary);
}

.auth-status-icon--danger {
  color: var(--asvlb-danger);
}

.auth-status-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--asvlb-dark);
  margin-bottom: 0.75rem;
}

.auth-status-text {
  color: var(--asvlb-medium);
  margin-bottom: 0;
}

.auth-status .btn {
  margin-top: 1.25rem;
}

/* Alerts auth (legacy) */
.alert-auth {
  background: var(--asvlb-gradient-energy);
  color: white;
  border: none;
  border-radius: var(--asvlb-radius-lg);
}

.alert-auth .alert-link {
  color: white;
  font-weight: 600;
  text-decoration: underline;
}

/* Breadcrumbs */
.breadcrumb {
  background: none;
  padding: 0;
  margin-bottom: 2rem;
}

.breadcrumb-item a {
  color: var(--asvlb-primary);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--asvlb-medium);
}

/* List pages */
.list-stats {
  background: var(--asvlb-light);
  padding: 1rem;
  border-radius: var(--asvlb-radius);
  margin-bottom: 2rem;
}

.list-filter {
  background: white;
  border-radius: var(--asvlb-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--asvlb-shadow);
  margin-bottom: 2rem;
}

.pagination-modern {
  background: white;
  border-radius: var(--asvlb-radius-lg);
  padding: 1rem;
  box-shadow: var(--asvlb-shadow);
  margin-top: 1rem;
}

.pagination-modern .btn {
  border-radius: var(--asvlb-radius);
  font-weight: 500;
  margin: 0 0.25rem;
}

/* Schedule tabs */
.schedule-tabs .nav-link {
  font-weight: 500;
  color: var(--asvlb-medium);
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.schedule-tabs .nav-link.active {
  background: var(--asvlb-primary);
  color: white;
  border-color: var(--asvlb-primary);
}

.schedule-tabs .nav-link:hover:not(.active) {
  border-color: var(--asvlb-primary);
  color: var(--asvlb-primary);
}

.schedule-time {
  font-weight: 600;
  color: var(--asvlb-primary);
  font-size: 1.1rem;
}

/* Breadcrumbs */
.table thead {
  background: var(--asvlb-gradient-primary);
  color: white;
}

.table > thead th,
.table thead th {
  border: none;
  color: white;
  font-weight: 600;
}

/* table-light + en-tête ASVLB : éviter texte blanc sur fond gris clair */
.table-light thead,
.table-light thead th {
  background: var(--asvlb-light) !important;
  color: var(--asvlb-dark) !important;
  border-bottom: 2px solid var(--asvlb-primary);
}

.map-container {
  border-radius: var(--asvlb-radius-lg);
  overflow: hidden;
  box-shadow: var(--asvlb-shadow);
}

.contact-section {
  background: var(--asvlb-light);
  border-radius: var(--asvlb-radius-lg);
  padding: 2rem;
}

.service-icon {
  font-size: 3rem;
  color: var(--asvlb-accent);
}

.tracking-wide {
  letter-spacing: 0.05em;
}

.tournament-stat-item {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
  .asvlb-hero,
  .tournament-hero {
    padding: 2rem 0;
  }

  .asvlb-card,
  .tournament-card {
    margin-bottom: 1rem;
  }
}
