/* ═══════════════════════════════════════════
   VARIABLES & RESET
═══════════════════════════════════════════ */
:root {
  --bg:      #0a0f0f;
  --s1:      #101817;
  --s2:      #182322;
  --s3:      #202e2d;
  --border:  #223332;
  --accent:  #0891b2;
  --accent2: #06b6d4;
  --accent2-cta: #048096; /* variante assombrie de --accent2, réservée aux boutons .btn (texte blanc, contraste WCAG AA) */
  --green:   #2ecc71;
  --red:     #e74c3c;
  --orange:  #e67e22;
  --text:    #eef6f6;
  --muted:   #698685;
}
[data-theme="light"] {
  --bg:      #f2f7f7;
  --s1:      #ffffff;
  --s2:      #e6f1f1;
  --s3:      #d7e9e9;
  --border:  #c8dbdb;
  --accent:  #0e7490;
  --accent2: #0891b2;
  --accent2-cta: #07809d;
  --green:   #1fa055;
  --red:     #cc3328;
  --orange:  #c05a10;
  --text:    #0f1f1f;
  --muted:   #5c7473;
}
*  { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent }
html, body { height: 100%; overflow: hidden }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 15px }

/* ═══════════════════════════════════════════
   LAYOUT — SCREENS
═══════════════════════════════════════════ */
.screen          { position: fixed; inset: 0; display: none; flex-direction: column; overflow: hidden }
.screen.active   { display: flex }

/* ═══════════════════════════════════════════
   TOP BAR
═══════════════════════════════════════════ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1rem;
  background: var(--s1); border-bottom: 1px solid var(--border);
  flex-shrink: 0; gap: .5rem; position: relative;
}
.topbar-logo {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem; letter-spacing: .05em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.topbar-info  { font-size: .8rem; color: var(--muted); flex: 1; text-align: center }
#tb-prenom    { text-transform: uppercase }
.hamburger-btn {
  border: none; background: none; padding: .3rem .4rem; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  min-width: 44px; min-height: 44px;
}
.hamburger-btn span { display: block; width: 18px; height: 2px; background: var(--muted); border-radius: 2px; transition: background .2s }
.hamburger-btn:hover span { background: var(--accent) }
.hamburger-menu {
  display: none; position: absolute; top: calc(100% + 4px); right: .5rem;
  background: var(--s1); border: 1px solid var(--border); border-radius: 14px;
  min-width: 190px; padding: .4rem; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.hamburger-menu.open { display: block }
.hmenu-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .8rem; border-radius: 10px; cursor: pointer;
  font-size: .88rem; color: var(--text); background: none; border: none;
  width: 100%; text-align: left; font-family: 'DM Sans', sans-serif; min-height: 44px;
}
.hmenu-item:hover { background: var(--s2); color: var(--accent) }
.hmenu-separator  { height: 1px; background: var(--border); margin: .3rem 0 }

/* ═══════════════════════════════════════════
   SCROLL CONTENT / PAGES
═══════════════════════════════════════════ */
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 1rem; padding-bottom: 1.5rem }
.scroll::-webkit-scrollbar       { width: 4px }
.scroll::-webkit-scrollbar-track { background: transparent }
.scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px }

/* ═══════════════════════════════════════════
   BOTTOM NAV (emprunté à muscu/styles.css)
═══════════════════════════════════════════ */
.bottom-nav{
  display:flex;flex-shrink:0;
  background:var(--s1);border-top:1px solid var(--border);
}
.nav-btn{
  flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:.5rem .2rem;gap:2px;
  background:none;border:none;color:var(--muted);cursor:pointer;
  font-family:'DM Sans',sans-serif;font-size:.68rem;font-weight:500;
  transition:color .2s;
}
.nav-btn .nav-icon{font-size:1.2rem}
.nav-btn.active{color:var(--accent)}
.nav-btn.active .nav-icon{filter:drop-shadow(0 0 6px var(--accent))}

/* ═══════════════════════════════════════════
   BOUTONS
═══════════════════════════════════════════ */
.btn {
  display: block; width: 100%; padding: .85rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2-cta));
  border: none; border-radius: 12px;
  color: #fff; font-family: 'DM Sans', sans-serif; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: opacity .2s, transform .1s;
  text-align: center; text-decoration: none;
}
.btn:hover    { opacity: .9; transform: translateY(-1px) }
.btn:active   { transform: translateY(0) }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none }
.btn-outline  { background: none; border: 1px solid var(--border); color: var(--text) }
.btn-outline:hover { border-color: var(--accent); color: var(--accent) }

/* ═══════════════════════════════════════════
   CARDS & SECTIONS
═══════════════════════════════════════════ */
.card         { background: var(--s1); border: 1px solid var(--border); border-radius: 14px; padding: 1rem; margin-bottom: .75rem }
.section-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; letter-spacing: .08em;
  color: var(--muted); margin: 1.25rem 0 .5rem;
  display: flex; align-items: center; gap: .5rem;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border) }

/* ═══════════════════════════════════════════
   FORMULAIRES
═══════════════════════════════════════════ */
.field-label {
  font-size: .75rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: .4rem; display: block;
}
select,
input[type=password] {
  width: 100%; background: var(--s2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 1rem;
  padding: .7rem .9rem; outline: none; transition: border-color .2s;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23698685' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2rem;
}
select:focus,
input:focus { border-color: var(--accent) }
.field { margin-bottom: 1rem }
.mdp-rules  { font-size: .72rem; color: var(--muted); margin-top: .35rem; line-height: 1.5 }
.error-msg  { color: var(--red); font-size: .8rem; margin-top: .5rem; display: none }

/* ═══════════════════════════════════════════
   ÉCRAN CONNEXION
═══════════════════════════════════════════ */
#screen-login {
  justify-content: center; align-items: center;
  background: radial-gradient(ellipse at 30% 40%, rgba(8,145,178,.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 70%, rgba(6,182,212,.06) 0%, transparent 60%),
              var(--bg);
  padding: 1.5rem; overflow-y: auto;
}
.login-wrap   { width: 100%; max-width: 400px; margin: auto; }
.login-hero   { text-align: center; margin-bottom: 2rem }
.login-icon   { font-size: 5.5rem; line-height: 1; margin-bottom: .5rem }
.login-logo   {
  font-family: 'Bebas Neue', sans-serif; font-size: 2.8rem; letter-spacing: .04em; line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.login-sub    { font-size: .8rem; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); margin-top: .25rem }
.login-card   {
  background: var(--s1); border: 1px solid var(--border); border-radius: 18px;
  padding: 1.5rem; width: 100%; max-width: 380px;
}
.login-card h2 { font-family: 'Bebas Neue', sans-serif; font-size: 1.4rem; letter-spacing: .05em; margin-bottom: 1.25rem }
.login-footer {
  text-align: center; margin-top: 1.25rem;
  display: flex; justify-content: center; align-items: center; gap: 1.2rem;
}
.login-theme-btn   { border: none; background: none; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 0 }

/* ═══════════════════════════════════════════
   HISTORIQUE — cartes par séance + chips tentatives
═══════════════════════════════════════════ */
.esc-seance-card { margin-bottom: .75rem }
.esc-seance-card-tinted, .esc-seance-card-tinted .esc-seance-titre { color: #1e293b }
.esc-seance-card-tinted .esc-seance-date { color: rgba(30,41,59,.72) }
.esc-seance-titre { font-weight: 700; font-size: .92rem; margin-bottom: .15rem }
.esc-seance-date  { font-size: .75rem; color: var(--muted); margin-bottom: .65rem }
.esc-chips { display: flex; flex-wrap: wrap; gap: .5rem }
.esc-chip {
  background: var(--s2); border: 1px solid var(--border); border-radius: 10px;
  padding: .4rem .6rem; min-width: 54px; text-align: center;
}
.esc-chip-chute1 { background: rgba(230,126,34,.15); border-color: rgba(230,126,34,.4) }
.esc-chip-chute2 { background: rgba(231,76,60,.15); border-color: rgba(231,76,60,.4) }
.esc-chip-tete   { border-left: 3px solid var(--accent) }
.esc-chip-cot  { font-weight: 700; font-size: .85rem; color: var(--text) }
.esc-chip-pts  { font-size: .68rem; color: var(--accent); margin-top: .1rem }
.esc-chip-mode { font-size: .6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: .15rem; white-space: nowrap }
.esc-chip-chutes { font-size: .62rem; color: var(--muted); margin-top: .15rem; white-space: nowrap }
.esc-absence-pill { display: inline-block; padding: .4rem .8rem; border-radius: 10px; font-size: .82rem; font-weight: 700 }

/* ═══════════════════════════════════════════
   SÉCURITÉ — badges + tension de corde
═══════════════════════════════════════════ */
.esc-badge-row {
  display: flex; align-items: center; gap: .65rem; padding: .6rem 0;
  border-bottom: 1px solid var(--border); font-size: .88rem;
}
.esc-badge-row:last-child { border-bottom: none }
.esc-badge-icon { width: 22px; height: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center }
.esc-badge-ok   { color: var(--green) }
.esc-badge-off  { color: var(--border) }
.esc-badge-label { flex: 1 }
.esc-tension-card { text-align: center; padding-top: .25rem }
.esc-tension-dots { display: flex; justify-content: center; gap: 1.5rem; margin: .75rem 0 .5rem }
.esc-tension-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border) }
.esc-tension-dot.active { background: var(--accent); border-color: var(--accent) }
.esc-tension-labels { display: flex; justify-content: center; gap: .75rem; font-size: .68rem; color: var(--muted) }
.esc-tension-explain { font-size: .8rem; color: var(--muted); line-height: 1.5; margin-top: .75rem }

/* ═══════════════════════════════════════════
   NOTE — hero + composantes
═══════════════════════════════════════════ */
.resultat-hero {
  background: var(--s1); border: 1px solid var(--border); border-radius: 16px;
  padding: 1.1rem 1.25rem; margin-bottom: .75rem; text-align: center;
}
.resultat-note-globale {
  font-family: 'Bebas Neue', sans-serif; font-size: 2.3rem; letter-spacing: .04em;
  color: var(--accent); line-height: 1;
}
.resultat-note-sur20 { font-size: 1rem; color: var(--muted) }
.resultat-note-sous { font-size: .74rem; color: var(--muted); margin-top: .4rem }

.detail-notes { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .75rem }
.detail-note-card {
  background: var(--s1); border: 1px solid var(--border); border-radius: 12px;
  padding: .85rem; text-align: center;
}
.detail-note-val { font-family: 'Bebas Neue', sans-serif; font-size: 1.6rem; color: var(--accent) }
.detail-note-key { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-top: .1rem }

/* ═══════════════════════════════════════════
   TOAST
═══════════════════════════════════════════ */
.toast {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%) translateY(-80px);
  background: var(--green); color: #fff; font-weight: 700; font-size: .9rem;
  padding: .55rem 1.25rem; border-radius: 30px; z-index: 999;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1); white-space: nowrap; pointer-events: none;
}
.toast.show  { transform: translateX(-50%) translateY(0) }
.toast.error { background: var(--red) }
.toast.warn  { background: var(--orange) }

/* ═══════════════════════════════════════════
   LOADING / OVERLAYS
═══════════════════════════════════════════ */
.overlay { position: fixed; inset: 0; background: rgba(5,12,12,.88); display: flex; flex-direction: column; gap: 1rem; align-items: center; justify-content: center; z-index: 200 }
.overlay.hidden { display: none }
.spinner {
  width: 32px; height: 32px; border: 3px solid rgba(8,145,178,.2);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }
#loading-msg { color: #fff; font-size: .88rem; text-align: center; line-height: 1.5; display: none }
#loading-retry {
  display: none; margin-top: .5rem; padding: .6rem 1.4rem;
  border: none; border-radius: 8px; background: #fff; color: #333;
  font-size: .95rem; font-weight: 600; cursor: pointer;
}
#acces-bloque { flex-direction: column; gap: 1.2rem; padding: 2rem; text-align: center }
#acces-bloque-icon { font-size: 2.5rem }
#acces-bloque-titre { font-family: 'Bebas Neue', sans-serif; font-size: 1.6rem; letter-spacing: .05em; color: #fff }
#acces-bloque #msg-bloque { font-size: .95rem; color: rgba(255,255,255,.8); line-height: 1.6; max-width: 280px }

/* ═══════════════════════════════════════════
   UTILITAIRES
═══════════════════════════════════════════ */
.no-data-msg { text-align: center; color: var(--muted); padding: 2rem 1rem; font-size: .88rem; line-height: 1.6 }
.info-label { font-weight: 700; color: var(--accent); margin-bottom: .25rem }

/* ═══════════════════════════════════════════
   PAGE TUTORIEL
═══════════════════════════════════════════ */
.tuto-step {
  background: var(--s1); border: 1px solid var(--border); border-radius: 12px;
  padding: .9rem 1rem; margin-bottom: .6rem; display: flex; gap: .85rem; align-items: flex-start;
}
.tuto-step-num {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 700; font-size: .82rem;
  min-width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tuto-step-content { font-size: .87rem; line-height: 1.55 }
.tuto-step-title   { font-weight: 700; margin-bottom: .2rem }
.ressource-header {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border);
}
.ressource-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.4rem; letter-spacing: .05em }
