/* =========================================================
   TurfShell · app.css
   Thème : Prairie — blanc cassé, vert gazon, or champagne
   Polices : Cormorant Garamond (titres) + Outfit (corps)
   ========================================================= */

/* ── Variables ──────────────────────────────────────────── */
:root {
  --green:        #2d7a3a;
  --green-light:  #e8f5eb;
  --green-mid:    #4a9e5a;
  --green-dim:    #c8e6cc;
  --green-glow:   rgba(45,122,58,.1);
  --gold:         #a07820;
  --gold-light:   #f5e9c8;
  --ink:          #1a2e1c;
  --surface:      #ffffff;
  --surface-2:    #f7faf7;
  --surface-3:    #edf5ee;
  --border:       rgba(45,122,58,.15);
  --border-hi:    rgba(45,122,58,.4);
  --text:         #1e3320;
  --text-muted:   #6b8570;
  --font-title:   'Cormorant Garamond', Georgia, serif;
  --font-body:    'Outfit', system-ui, sans-serif;
  --r-sm:  6px;
  --r-md:  12px;
  --r-lg:  18px;
  --ease:  .2s ease;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  background: #f2f6f2;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(ellipse 100% 35% at 50% 0%,
      rgba(45,122,58,.06) 0%, transparent 60%);
}

/* ── Navbar ─────────────────────────────────────────────── */
#topnav {
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: .7rem 0;
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: box-shadow var(--ease);
}
#topnav.nav-shadow { box-shadow: 0 4px 20px rgba(45,122,58,.12); }

.brand-horse { font-size: 1.35rem; line-height: 1; }
.brand-text  {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: .03em;
}
.navbar-brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; }

.navbar-nav .nav-link {
  color: var(--text) !important;
  font-size: .875rem;
  font-weight: 400;
  padding: .4rem .75rem !important;
  border-radius: var(--r-sm);
  transition: background var(--ease), color var(--ease);
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.show {
  background: var(--green-glow);
  color: var(--green) !important;
}

/* Dropdown */
.dropdown-menu {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  box-shadow: 0 8px 32px rgba(45,122,58,.12);
  padding: .5rem;
  min-width: 230px;
}
.dropdown-divider { border-color: var(--border); margin: .35rem 0; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--text);
  border-radius: var(--r-sm);
  padding: .55rem .8rem;
  transition: background var(--ease);
  text-decoration: none;
}
.dropdown-item:hover { background: var(--green-light); color: var(--green); }
.dropdown-item.today { color: var(--green); font-weight: 500; }

.day-marker { font-size: .65rem; width: 1.2rem; text-align: center; flex-shrink: 0; }
.day-marker.past   { color: var(--text-muted); }
.day-marker.now    { color: var(--green); }
.day-marker.future { color: var(--text-muted); }

.day-info { display: flex; flex-direction: column; }
.day-info strong { font-size: .875rem; font-weight: 500; }
.day-info em     { font-size: .75rem; font-style: normal; color: var(--text-muted); text-transform: capitalize; }

/* Auth */
.btn-login {
  border: 1px solid var(--border-hi);
  color: var(--green);
  background: transparent;
  font-size: .8rem;
  font-weight: 500;
  padding: .35rem 1rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: background var(--ease), color var(--ease);
}
.btn-login:hover { background: var(--green); color: #fff; border-color: var(--green); }

.user-btn {
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .85rem;
  padding: .3rem .8rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: border-color var(--ease);
}
.user-btn:hover { border-color: var(--border-hi); color: var(--text); }

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  background: var(--green-dim);
  color: var(--green);
  border-radius: 50%;
  font-size: .7rem;
  font-weight: 700;
}

/* ── Hero ────────────────────────────────────────────────── */
.page-hero {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(45,122,58,.05) 0%, transparent 100%);
}
.hero-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.hero-eyebrow {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: .3rem;
  font-weight: 500;
}
.hero-title {
  font-family: var(--font-title);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .6rem;
}
.hero-label { color: var(--green); }
.hero-date  {
  font-size: .45em;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 300;
  text-transform: capitalize;
}
.text-gold { color: var(--gold); }

.day-nav { display: flex; gap: .4rem; }
.btn-day-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .7rem;
  padding: .35rem .7rem;
  border-radius: var(--r-sm);
  transition: border-color var(--ease), color var(--ease);
}
.btn-day-nav:hover { border-color: var(--border-hi); color: var(--green); }
.btn-today { color: var(--green); border-color: var(--border-hi); }

/* ── KPI row ─────────────────────────────────────────────── */
.kpi-row {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.kpi-card {
  flex: 1 1 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: .9rem 1.1rem;
  text-align: center;
  transition: border-color var(--ease), box-shadow var(--ease);
  box-shadow: 0 1px 4px rgba(45,122,58,.06);
}
.kpi-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 4px 12px rgba(45,122,58,.1);
}
.kpi-val {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 700;
  color: var(--green-light);
  line-height: 1;
}
.kpi-lbl {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* ── Réunions ─────────────────────────────────────────────── */
.reunion-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(45,122,58,.07);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.reunion-block:hover {
  border-color: var(--border-hi);
  box-shadow: 0 4px 16px rgba(45,122,58,.1);
}

.reunion-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  background: var(--surface-2);
  cursor: pointer;
  user-select: none;
  transition: background var(--ease);
}
.reunion-head:hover { background: var(--green-light); }

.rh-num {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
  min-width: 2.8rem;
}
.rh-info  { flex: 1; min-width: 0; }
.rh-hippo { font-weight: 500; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.rh-sub   { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }

.rh-meteo { text-align: right; font-size: .75rem; color: var(--text-muted); flex-shrink: 0; }
.meteo-temp { display: block; color: var(--text); font-weight: 500; }

.rh-count {
  background: var(--green-dim);
  color: var(--green);
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .65rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.toggle-arrow {
  color: var(--text-muted);
  font-size: .65rem;
  display: block;
  transition: transform .3s ease;
}
.reunion-head:not(.collapsed) .toggle-arrow { transform: rotate(180deg); }

/* ── Table courses ───────────────────────────────────────── */
.courses-wrap { overflow-x: auto; }

.table-courses {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-hover-bg: var(--green-light);
  --bs-table-border-color: var(--border);
  margin: 0;
  font-size: .85rem;
}
.table-courses thead th {
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-muted);
  font-weight: 600;
  padding: .55rem 1rem;
  border-bottom: 2px solid var(--green-dim);
  white-space: nowrap;
  background: var(--surface-2);
}
.table-courses tbody td {
  padding: .7rem 1rem;
  vertical-align: middle;
  border-color: var(--border);
}
.course-row { cursor: pointer; transition: background var(--ease); }

.td-num   { font-family: var(--font-title); font-size: 1rem; color: var(--green); font-weight: 700; white-space: nowrap; }
.c-name   { font-weight: 500; color: var(--ink); }
.c-cond   { font-size: .73rem; color: var(--text-muted); margin-top: .15rem; }
.td-heure, .td-dist, .td-dot { white-space: nowrap; }

/* Discipline badges */
.disc-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .18rem .55rem;
  border-radius: 4px;
}
.disc-plat     { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.disc-attele   { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.disc-monte    { background: #f3e8ff; color: #7c3aed; border: 1px solid #e9d5ff; }
.disc-obstacle { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.disc-other    { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }

/* Statut badges */
.stat-badge {
  display: inline-block;
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .18rem .55rem;
  border-radius: 20px;
  white-space: nowrap;
}
.stat-arrivee  { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.stat-encours  { background: #fef9c3; color: #a16207; border: 1px solid #fde047; }
.stat-imminent { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.stat-fin      { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }
.stat-prog     { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── Login ────────────────────────────────────────────────── */
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  min-height: calc(100vh - 120px);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-lg);
  padding: 2.5rem;
  box-shadow: 0 8px 40px rgba(45,122,58,.1), 0 2px 8px rgba(0,0,0,.05);
}
.login-horse  { font-size: 2.5rem; display: block; text-align: center; margin-bottom: .5rem; }
.login-title  { font-family: var(--font-title); font-size: 1.9rem; color: var(--green); text-align: center; margin: 0 0 .2rem; }
.login-sub    { text-align: center; color: var(--text-muted); font-size: .8rem; margin-bottom: 2rem; }

.form-label {
  font-size: .73rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .35rem;
}
.form-control {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: .55rem .8rem;
  font-size: .9rem;
}
.form-control:focus {
  background: var(--surface);
  border-color: var(--green);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(45,122,58,.15);
}
.btn-submit {
  background: var(--green);
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  letter-spacing: .05em;
  padding: .65rem;
  border-radius: var(--r-sm);
  width: 100%;
  transition: filter var(--ease), transform var(--ease);
}
.btn-submit:hover  { filter: brightness(1.1); transform: translateY(-1px); }
.btn-submit:active { transform: translateY(0); }

/* ── Accueil — Quick-links ───────────────────────────────── */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
@media(max-width:600px) { .quick-grid { grid-template-columns: 1fr; } }

.quick-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
  box-shadow: 0 1px 4px rgba(45,122,58,.06);
}
.quick-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(45,122,58,.12);
  text-decoration: none;
}
.quick-card.active {
  border-color: var(--green);
  background: var(--green-light);
}
.qc-label { font-family: var(--font-title); font-size: 1.3rem; font-weight: 700; color: var(--green); }
.qc-date  { font-size: .78rem; color: var(--text-muted); text-transform: capitalize; margin-top: .2rem; }

/* Aperçu hippodromes */
.hippo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.hippo-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem 1.2rem;
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
  box-shadow: 0 1px 4px rgba(45,122,58,.05);
}
.hippo-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45,122,58,.1);
  text-decoration: none;
}
.hippo-r    { font-family: var(--font-title); font-size: 1.3rem; color: var(--green); font-weight: 700; }
.hippo-name { font-size: .9rem; font-weight: 500; color: var(--ink); margin-top: .1rem; }
.hippo-meta { font-size: .73rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-icon  { font-size: 4rem; opacity: .35; display: block; margin-bottom: 1rem; }
.empty-msg   { color: var(--text-muted); }

/* ── Footer ──────────────────────────────────────────────── */
#sitefooter {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  margin-top: auto;
}

/* ── Responsive tables ───────────────────────────────────── */
@media(max-width:768px) {
  .td-dist, .td-dot { display: none; }
  .table-courses thead th:nth-child(5),
  .table-courses thead th:nth-child(7) { display: none; }
}
@media(max-width:576px) {
  .table-courses thead th:nth-child(6),
  .table-courses tbody td:nth-child(6) { display: none; }
  .kpi-row { gap: .5rem; }
}

/* ── Casaque ─────────────────────────────────────────────── */
.casaque-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .35rem;
}
.casaque-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.15));
  transition: transform var(--ease);
}
.casaque-img:hover { transform: scale(1.15); }

/* ── Météo icônes ────────────────────────────────────────── */
.rh-meteo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  flex-shrink: 0;
}
.meteo-icon {
  font-size: 1.6rem;
  color: var(--text);
  line-height: 1;
}
.meteo-temp {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
}
.meteo-label {
  font-size: .6rem;
  color: var(--text-muted);
  text-transform: capitalize;
  text-align: center;
  max-width: 60px;
  line-height: 1.2;
}
