/* ═══════════════════════════════════════════════
   UP JOURNAL — WAR ROOM THEME
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap');

:root {
  --bg:        #0d0d14;   /* fond principal */
  --bg2:       #161622;   /* navbar, cards */
  --bg3:       #1e1e2e;   /* inputs, zones saisie */
  --border:    #2e2e45;   /* bordures plus visibles */
  --red:       #ef4444;
  --red-dim:   #991b1b;
  --violet:    #7c3aed;
  --violet-dim:#4c1d95;
  --violet-hi: #c084fc;
  --green:     #22c55e;
  --orange:    #f59e0b;
  --text:      #f1f5f9;   /* texte principal plus blanc */
  --text-dim:  #94a3b8;   /* texte secondaire plus lisible */
  --text-muted:#475569;
}

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

html { font-size: 16px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── NAVBAR ────────────────────────────────────── */
.navbar {
  background: var(--bg2);
  border-bottom: 2px solid var(--border);
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--red);
  text-decoration: none;
  text-shadow: 0 0 14px rgba(239,68,68,.6);
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: color .2s;
  padding: .3rem 0;
}

.nav-links a:hover,
.nav-links a.active { color: var(--violet-hi); }

.nav-logout {
  color: var(--red) !important;
  background: rgba(239,68,68,.12);
  border: 1px solid var(--red);
  padding: .35rem .8rem;
  border-radius: 6px;
  font-weight: 800 !important;
  transition: background .2s !important;
}
.nav-logout:hover { background: rgba(239,68,68,.25) !important; }

/* Nav hamburger mobile */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .2s;
}

@media (max-width: 600px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg2);
    border-bottom: 2px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: .5rem 0;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: .75rem 1.5rem;
    width: 100%;
    font-size: .9rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links a:last-child { border-bottom: none; }
  .nav-logout {
    margin: .5rem 1rem !important;
    text-align: center;
    border-radius: 6px !important;
    width: calc(100% - 2rem) !important;
    padding: .6rem 1rem !important;
  }
}

/* ── CONTAINER ─────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem 10rem; /* espace pour la barre citation fixe */
}

/* ── AUTH CARD ─────────────────────────────────── */
.auth-card {
  max-width: 420px;
  margin: 4rem auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem 2rem;
}

.auth-logo {
  font-size: 3rem;
  text-align: center;
  margin-bottom: .5rem;
  filter: drop-shadow(0 0 16px var(--red));
}

.auth-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
  margin-bottom: .25rem;
}

.auth-sub {
  text-align: center;
  color: var(--text-dim);
  font-size: .85rem;
  margin-bottom: 2rem;
}

/* ── FIELDS ────────────────────────────────────── */
.field {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: .4rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="time"],
input[type="date"],
textarea,
select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .65rem .9rem;
  border-radius: 4px;
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 2px rgba(124,58,237,.25);
}

.otp-input {
  font-size: 2rem !important;
  letter-spacing: .5em;
  text-align: center;
  font-weight: 900;
}

textarea { resize: vertical; min-height: 90px; }

/* Champs texte longs → auto-resize sur mobile */
textarea.auto-grow {
  min-height: 52px;
  overflow: hidden;
  resize: none;
  line-height: 1.5;
}

@media (max-width: 600px) {
  input[type="text"], textarea, input[type="number"], select {
    font-size: 1rem;
    padding: .75rem 1rem;
  }
  textarea { min-height: 80px; }

  /* Sessions sport responsive */
  .sport-session > div { flex-direction: column !important; }
}

/* ── SPORT SESSIONS ────────────────────────────── */
.sport-session {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .9rem;
  margin-bottom: .6rem;
}

/* ── BUTTONS ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: filter .2s, transform .1s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--violet) 0%, var(--red) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,.35);
}

.btn-danger {
  background: linear-gradient(135deg, var(--red) 0%, #991b1b 100%);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover { border-color: var(--violet); color: var(--violet-hi); }

.btn-full { width: 100%; margin-top: .5rem; }

/* ── ALERTS ────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: 4px;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  border-left: 3px solid;
}
.alert-error  { background: rgba(220,38,38,.1);  border-color: var(--red);    color: #fca5a5; }
.alert-warn   { background: rgba(217,119,6,.1);  border-color: var(--orange); color: #fcd34d; }
.alert-info   { background: rgba(124,58,237,.1); border-color: var(--violet); color: var(--violet-hi); }
.alert-green  { background: rgba(22,163,74,.1);  border-color: var(--green);  color: #86efac; }

/* ── PAGE TITLES ───────────────────────────────── */
.page-title {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: .25rem;
}
.page-sub {
  color: var(--text-dim);
  font-size: .85rem;
  margin-bottom: 2rem;
}

/* ── SECTION BLOCKS ────────────────────────────── */
.section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--violet-hi);
  border-bottom: 1px solid var(--border);
  padding-bottom: .75rem;
  margin-bottom: 1.25rem;
}

/* ── GRID ──────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

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

/* ── STAR RATING ───────────────────────────────── */
.stars {
  display: flex;
  gap: .35rem;
  align-items: center;
  flex-wrap: wrap;
}
.stars input[type=radio] { display: none; }
.stars label {
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color .15s;
  text-transform: none;
  letter-spacing: 0;
}
.stars input[type=radio]:checked ~ label,
.stars label:hover ~ label,
.stars label:hover { color: #fbbf24; }

/* ── CHECKBOX TOGGLE ───────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .75rem;
}
.toggle-row input[type=checkbox] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--violet);
  cursor: pointer;
}
.toggle-row label {
  font-size: .9rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  cursor: pointer;
  margin: 0;
}

/* ── RANGE SLIDER ──────────────────────────────── */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  padding: 0;
  border: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--violet);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(124,58,237,.6);
}

.range-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.range-row input[type=range] { flex: 1; }
.range-val {
  min-width: 2rem;
  text-align: center;
  font-weight: 700;
  color: var(--violet-hi);
  font-size: .95rem;
}

/* ── STAT CARDS ────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1rem;
  text-align: center;
}

.stat-card .label {
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: .4rem;
  font-weight: 700;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.color-green { color: #4ade80; }
.color-orange { color: #fb923c; }
.color-red { color: #f87171; }

.badge-red {
  display: inline-block;
  background: var(--red);
  color: #fff;
  padding: .2rem .7rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ── CHART WRAPPER ─────────────────────────────── */
.chart-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.chart-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

/* ── CALENDAR ──────────────────────────────────── */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-name {
  text-align: center;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: .4rem 0;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  position: relative;
}

.cal-day.empty { background: transparent; cursor: default; }
.cal-day.no-entry { background: var(--bg3); color: var(--text-muted); }
.cal-day.has-entry { background: rgba(124,58,237,.2); border-color: var(--violet); color: var(--violet-hi); }
.cal-day.today { border-color: var(--red) !important; color: #fff; }
.cal-day.has-entry:hover { background: rgba(124,58,237,.35); }

/* ── LINK ──────────────────────────────────────── */
.link-subtle {
  color: var(--text-dim);
  text-decoration: none;
  font-size: .85rem;
}
.link-subtle:hover { color: var(--violet-hi); }

/* ── QUOTE BAR ─────────────────────────────────── */
.quote-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: .6rem 1.5rem;
  font-size: .75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: .5rem;
  z-index: 50;
}
.quote-bar .q-icon {
  color: var(--red);
  font-size: .9rem;
  flex-shrink: 0;
}
.quote-bar .q-text {
  font-style: italic;
  flex: 1;
  white-space: normal;
  overflow: visible;
  line-height: 1.4;
}
.quote-bar .q-author {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: .7rem;
  letter-spacing: .05em;
}

@media (max-width: 600px) {
  .quote-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
    padding: .6rem 1rem;
    font-size: .7rem;
  }
  .quote-bar .q-author { align-self: flex-end; }
}

/* ── MODAL ─────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
}

/* ── MISC ──────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.text-center { text-align: center; }
.mt1 { margin-top: .5rem; }
.mt2 { margin-top: 1rem; }
.mt3 { margin-top: 1.5rem; }
.mb1 { margin-bottom: .5rem; }

.flex { display: flex; }
.flex-gap { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
