/* ============================================================
   Rise & Close — Styles partagés
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..700;1,9..144,300..600&family=Manrope:wght@300;400;500;600;700&display=swap');

:root {
  --tc-deep:    #8B3A2A;
  --tc-primary: #C1503A;
  --tc-light:   #D4745F;
  --tc-pale:    #F2DDD9;
  --tc-mist:    #FAF0EE;

  --gold:       #B8924A;
  --gold-light: #D4AE72;
  --gold-pale:  #F5ECD8;

  --bg-cream:    #F5EFE6;
  --bg-pure:     #FDFAF7;
  --bg-elevated: #F9F4EF;

  --ink-black: #1C1714;
  --ink-soft:  #4A3F38;
  --ink-mute:  #8A7A72;
  --ink-faint: #B8ACA4;

  --border-soft:   #E8DDD6;
  --border-subtle: #EFE6DF;

  --shadow-sm: 0 1px 3px rgba(139,58,42,0.06);
  --shadow-md: 0 4px 12px rgba(139,58,42,0.08);
  --shadow-lg: 0 12px 32px rgba(139,58,42,0.10);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Manrope", -apple-system, sans-serif;
  --ease: cubic-bezier(0.22,1,0.36,1);

  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-body); font-size: 16px;
  line-height: 1.6; color: var(--ink-soft);
  background: var(--bg-cream);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(193,80,58,0.05), transparent 40%),
    radial-gradient(circle at 92% 88%, rgba(184,146,74,0.04), transparent 35%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--nav-h);
}
::selection { background: var(--tc-pale); color: var(--ink-black); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* ========== Topnav ========== */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(253,250,247,0.92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
}
.topnav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.05rem; color: var(--ink-black);
}
.topnav-brand mark {
  background: linear-gradient(135deg, var(--tc-light), var(--tc-deep));
  -webkit-background-clip: text; background-clip: text;
  color: transparent; font-weight: 600;
}
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0 auto; padding: 0; }
/* ── Barre en 3 zones : logo (gauche) · menu (centré) · boutons (droite) ──
   Les deux zones latérales ont le même poids : le menu est donc parfaitement
   centré, identique sur toutes les pages, sans positionnement absolu. */
.topnav-brand { flex: 1 1 0; white-space: nowrap; }
.topnav-right { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.nav-links a {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 5px 11px; text-align: center;
  font-size: 0.72rem; font-weight: 500; color: var(--ink-mute);
  border-radius: var(--radius-md);
  transition: all 0.2s var(--ease);
}
.nav-ic { display: inline-flex; flex-shrink: 0; }
.nav-ic svg { width: 21px; height: 21px; }
.nav-skool .nav-ic svg { width: 16px; height: 16px; }
/* Icônes inline qui s'adaptent à la taille du texte du conteneur */
.ic { display: inline-flex; align-items: center; justify-content: center; line-height: 0; vertical-align: -0.14em; }
.ic svg { width: 1em; height: 1em; }
/* Style global des icônes : trait fin et arrondi pour un rendu doux */
.ic svg, .nav-ic svg { stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav-skool { margin-left: 4px; }
.nav-links a:hover:not(.active) { color: var(--ink-black); background: var(--tc-mist); }
.nav-links a.active { color: var(--tc-primary); background: var(--tc-pale); font-weight: 700; box-shadow: inset 0 0 0 2px currentColor; }

/* ── Couleurs par menu (Option A) — robuste : cible le svg, quel que soit le wrapper ou l'extension du lien ── */
.nav-links a[href*="accueil"]   svg, .nav-links a[href*="accueil"]   .nav-ic { color: #C1503A; }
.nav-links a[href*="routines"]  svg, .nav-links a[href*="routines"]  .nav-ic { color: #C98A2E; }
.nav-links a[href*="objectifs"] svg, .nav-links a[href*="objectifs"] .nav-ic { color: #6E8B5B; }
.nav-links a[href*="avancee"]   svg, .nav-links a[href*="avancee"]   .nav-ic { color: #4E7A96; }
.nav-links a[href*="outils"]    svg, .nav-links a[href*="outils"]    .nav-ic { color: #8E6E9E; }
.nav-links a[href*="roleplay"]  svg, .nav-links a[href*="roleplay"]  .nav-ic { color: #C26B8A; }
.nav-links a[href*="documents"] svg, .nav-links a[href*="documents"] .nav-ic { color: #5B8C7B; }

.nav-links a[href*="accueil"].active   { color: #C1503A; background: rgba(193,80,58,0.20); }
.nav-links a[href*="routines"].active  { color: #B97C22; background: rgba(201,138,46,0.22); }
.nav-links a[href*="objectifs"].active { color: #5C7A49; background: rgba(110,139,91,0.22); }
.nav-links a[href*="avancee"].active   { color: #436A85; background: rgba(78,122,150,0.22); }
.nav-links a[href*="outils"].active    { color: #7E5E8E; background: rgba(142,110,158,0.22); }
.nav-links a[href*="roleplay"].active  { color: #B25A7B; background: rgba(194,107,138,0.20); }
.nav-links a[href*="documents"].active { color: #4C7A6A; background: rgba(91,140,123,0.22); }

/* Au survol, on garde l'icône colorée (le fond neutre reste) */
.nav-links a:hover .nav-ic { filter: none; }


/* ── Lien admin ── */
.nav-admin {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: var(--radius-md);
  font-size: 0.76rem; font-weight: 600;
  background: var(--bg-cream); color: var(--ink-mute);
  text-decoration: none; border: 1px solid var(--border-soft);
  transition: all .2s; margin-right: 4px;
}
.nav-admin:hover { background: var(--tc-mist); color: var(--tc-primary); border-color: var(--tc-pale); }

.nav-skool {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--radius-md);
  font-size: 0.82rem; font-weight: 600;
  background: var(--gold); color: white;
  text-decoration: none; transition: background 0.2s, transform 0.15s;
  white-space: nowrap; margin-right: 4px;
}
.nav-skool:hover { background: #92702A; transform: translateY(-1px); }

.nav-logout {
  font-size: 0.8rem; color: var(--ink-soft); font-weight: 600;
  padding: 6px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--ink-faint); background: var(--bg-cream);
  transition: all 0.2s;
}
.nav-logout:hover { color: var(--tc-primary); border-color: var(--tc-pale); }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .topnav { padding: 0 16px; }
}

/* ========== Container ========== */
.container { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* ========== Section ========== */
section { scroll-margin-top: 80px; }
.section-head { margin: 80px 0 32px; text-align: center; }
.section-kicker {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--tc-primary); margin-bottom: 10px;
}
.section-head h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem); color: var(--ink-black);
  margin: 0 0 12px; letter-spacing: -0.015em;
}
.section-head p { color: var(--ink-mute); max-width: 540px; margin: 0 auto; font-size: 0.95rem; }
.divider { width: 40px; height: 1px; background: var(--tc-primary); margin: 0 auto 18px; }

/* ========== Cards ========== */
.card {
  background: var(--bg-pure); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ========== Boutons ========== */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; font-size: 0.9rem; font-weight: 600;
  color: white; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--tc-primary), var(--tc-deep));
  box-shadow: var(--shadow-md);
  transition: opacity 0.2s, transform 0.2s;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; font-size: 0.88rem; font-weight: 500;
  color: var(--tc-primary); border-radius: var(--radius-md);
  border: 1px solid var(--tc-pale);
  background: var(--tc-mist);
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--tc-pale); }

/* ========== Inputs ========== */
.input-field {
  width: 100%; padding: 11px 14px;
  font-family: var(--font-body); font-size: 0.93rem; color: var(--ink-black);
  background: var(--bg-cream); border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-field:focus {
  outline: none; border-color: var(--tc-primary);
  box-shadow: 0 0 0 3px rgba(193,80,58,0.20);
}
textarea.input-field { resize: vertical; min-height: 80px; line-height: 1.6; }

/* ── Champ mot de passe avec œil ── */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input-field { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: var(--ink-mute); border-radius: 8px;
  transition: color .2s, background .2s;
}
.pw-toggle:hover { color: var(--tc-primary); background: var(--tc-mist); }
.pw-toggle svg { width: 19px; height: 19px; }

/* ========== Save badge ========== */
.save-badge {
  font-size: 0.78rem; font-weight: 500; color: var(--tc-primary);
  opacity: 0; transition: opacity 0.3s;
  display: inline-flex; align-items: center; gap: 5px;
}
.save-badge::before {
  content: "✓"; display: inline-flex; align-items: center;
  justify-content: center; width: 16px; height: 16px;
  background: var(--tc-primary); color: white;
  border-radius: 50%; font-size: 0.7rem;
}
.save-badge.visible { opacity: 1; }
.save-badge.offline::before { background: var(--gold); }
/* Bouton de sauvegarde explicite */
.btn-save {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border: none; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--tc-primary), var(--tc-deep));
  color: #fff; font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: opacity .2s, transform .15s;
}
.btn-save:hover { opacity: .92; transform: translateY(-1px); }
.btn-save:disabled { opacity: .55; cursor: default; transform: none; }
.btn-save .ic svg { stroke: #fff; }
.save-feedback { font-size: 0.82rem; font-weight: 600; margin: 0; min-height: 18px; }
.save-feedback.ok { color: #166534; }
.save-feedback.local { color: #92702A; }
.save-feedback.err { color: #DC2626; }
.save-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }

/* ========== Tabs ========== */
.tabs {
  display: flex; overflow-x: auto; gap: 0;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-cream); padding: 0 8px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 13px 18px; font-size: 0.85rem; font-weight: 500;
  color: var(--ink-mute); white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--ink-black); background: var(--tc-mist); }
.tab-btn.active { color: var(--tc-primary); border-bottom-color: var(--tc-primary); font-weight: 600; }
.tab-panel { display: none; padding: 28px 32px; }
.tab-panel.active { display: block; }

/* ========== Progress bar ========== */
.progress-wrap { background: var(--bg-cream); border-radius: 100px; overflow: hidden; border: 1px solid var(--border-soft); height: 10px; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tc-light), var(--tc-primary), var(--tc-deep));
  border-radius: 100px;
  transition: width 0.5s var(--ease);
  box-shadow: 0 0 8px rgba(193,80,58,0.3);
}

/* ========== Checkboxes ========== */
input[type="checkbox"].check {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 5px; background: var(--bg-pure);
  cursor: pointer; position: relative; flex-shrink: 0;
  transition: all 0.2s;
}
input[type="checkbox"].check:checked {
  background: linear-gradient(135deg, var(--tc-primary), var(--tc-deep));
  border-color: var(--tc-deep);
}
input[type="checkbox"].check:checked::after {
  content: ""; position: absolute;
  left: 5px; top: 2px; width: 5px; height: 9px;
  border: solid white; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="checkbox"].check:checked + span { text-decoration: line-through; color: var(--ink-mute); }

/* ========== Auth overlay ========== */
#auth-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-cream);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
#auth-overlay.hidden { display: none; }
.auth-card {
  background: var(--bg-pure); border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl); padding: 48px 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg); text-align: center;
}
.auth-logo {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 500;
  color: var(--tc-primary); letter-spacing: 0.06em; margin: 0 0 6px;
}
.auth-title {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 500;
  color: var(--ink-black); margin: 0 0 6px;
}
.auth-subtitle { font-size: 0.9rem; color: var(--ink-mute); margin: 0 0 32px; }
.auth-tabs {
  display: flex; border: 1px solid var(--border-soft);
  border-radius: var(--radius-md); overflow: hidden; margin-bottom: 28px;
}
.auth-tab {
  flex: 1; padding: 10px; font-family: var(--font-body);
  font-size: 0.88rem; font-weight: 500; color: var(--ink-mute);
  background: var(--bg-cream); transition: all 0.2s;
}
.auth-tab.active { background: var(--tc-primary); color: white; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-btn {
  width: 100%; padding: 14px; font-family: var(--font-body);
  font-size: 0.95rem; font-weight: 600; color: white;
  background: linear-gradient(135deg, var(--tc-primary), var(--tc-deep));
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  transition: opacity 0.2s, transform 0.2s; margin-top: 4px;
}
.auth-btn:hover { opacity: 0.92; transform: translateY(-1px); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth-msg { font-size: 0.85rem; margin-top: 12px; min-height: 20px; border-radius: var(--radius-sm); padding: 8px 12px; }
.auth-msg.error { background: #FEF2F2; color: #DC2626; }
.auth-msg.success { background: #F0FDF4; color: #166534; }
.auth-msg:empty { display: none; }

/* ========== Modale Handicap ========== */
.handicap-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--ink-faint); font-family: var(--font-body);
  background: none; border: none; cursor: pointer;
  padding: 0; transition: color 0.2s;
  text-decoration: underline; text-underline-offset: 3px;
}
.handicap-btn:hover { color: var(--tc-primary); }

.handicap-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(28,23,20,0.5);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.handicap-overlay.open { display: flex; }
.handicap-modal {
  background: var(--bg-pure); border-radius: var(--radius-xl);
  padding: 40px; max-width: 540px; width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s var(--ease);
  position: relative; max-height: 90vh; overflow-y: auto;
}
@keyframes modalIn { from { opacity:0; transform:translateY(16px) scale(0.97); } to { opacity:1; transform:none; } }
.handicap-modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--bg-cream); border: 1px solid var(--border-soft);
  border-radius: 50%; width: 32px; height: 32px;
  font-size: 1rem; color: var(--ink-mute); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.handicap-modal-close:hover { background: var(--tc-pale); color: var(--tc-primary); }
.handicap-modal-icon { font-size: 2.2rem; margin-bottom: 12px; }
.handicap-modal h3 {
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 500;
  color: var(--ink-black); margin: 0 0 8px;
}
.handicap-modal-sub { font-size: 0.88rem; color: var(--ink-mute); margin: 0 0 24px; line-height: 1.6; }
.handicap-section { margin-bottom: 20px; }
.handicap-section-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--tc-primary); margin: 0 0 10px;
}
.handicap-adapt-list { list-style: none; padding: 0; margin: 0; }
.handicap-adapt-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.86rem; color: var(--ink-soft); line-height: 1.5;
  padding: 7px 0; border-bottom: 1px solid var(--border-subtle);
}
.handicap-adapt-list li:last-child { border-bottom: none; }
.handicap-adapt-list li::before { content: "✦"; color: var(--tc-primary); font-size: 0.65rem; margin-top: 4px; flex-shrink: 0; }
.handicap-contact {
  background: linear-gradient(135deg, var(--tc-mist), var(--bg-elevated));
  border: 1px solid var(--tc-pale); border-radius: var(--radius-lg);
  padding: 18px 20px; margin-top: 20px;
}
.handicap-contact p { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.6; }
.handicap-contact-name { font-size: 0.88rem; font-weight: 600; color: var(--ink-black); margin: 0 0 6px; }
.handicap-contact-detail { font-size: 0.82rem; color: var(--ink-mute); margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.handicap-confidential { font-size: 0.75rem; color: var(--ink-faint); margin-top: 10px; font-style: italic; }

.site-footer {
  text-align: center; padding: 32px 28px;
  font-size: 0.82rem; color: var(--ink-faint);
  border-top: 1px solid var(--border-subtle);
  margin-top: 80px;
  display: flex; align-items: center;
  justify-content: center; gap: 20px; flex-wrap: wrap;
}

/* ========== Reveal animation ========== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }
