/* InazukiDark — effets visuels communs (reprise du style de l'accueil) :
   grain, halos animés, entrées en fondu, cartes à bordure lumineuse,
   survol avec spot lumineux, bandes de bougies, boutons vivants.
   Chargé APRÈS le <style> de chaque page pour pouvoir surcharger. */

@property --fx-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

@keyframes fxAurora1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(46px,-34px) scale(1.15); } }
@keyframes fxAurora2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-38px,38px) scale(1.1); } }
@keyframes fxAurora3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(28px,40px) scale(0.9); } }
@keyframes fxEnter   { from { opacity: 0; transform: translateY(16px); } }
@keyframes fxLine    { from { transform: scaleX(0); } }
@keyframes fxSpin    { to { --fx-angle: 360deg; } }
@keyframes fxPulse   { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes fxSheen   { from { transform: translateX(-120%) skewX(-18deg); } to { transform: translateX(260%) skewX(-18deg); } }

::selection { background: rgba(216,162,74,0.35); color: #fff; }

/* ---------- grain + halos ---------- */
body { position: relative; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.page-aurora { display: none !important; }
.fx-aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; mix-blend-mode: screen; opacity: 0.9; pointer-events: none; }
.fx-aurora span { position: absolute; border-radius: 50%; filter: blur(6px); }
.fx-aurora .a1 { top: -220px; right: -140px; width: 640px; height: 640px; background: radial-gradient(circle, rgba(216,162,74,0.24) 0%, rgba(216,162,74,0) 70%); animation: fxAurora1 16s ease-in-out infinite; }
.fx-aurora .a2 { bottom: -240px; left: -160px; width: 560px; height: 560px; background: radial-gradient(circle, rgba(139,111,214,0.18) 0%, rgba(139,111,214,0) 70%); animation: fxAurora2 20s ease-in-out infinite; }
.fx-aurora .a3 { top: 30%; left: 35%; width: 420px; height: 420px; background: radial-gradient(circle, rgba(45,189,126,0.1) 0%, rgba(45,189,126,0) 70%); animation: fxAurora3 24s ease-in-out infinite; }
.wrap { position: relative; z-index: 1; }

/* ---------- bande de bougies sous le logo ---------- */
.ambient-ticker {
  position: relative;
  height: 110px;
  margin: 8px 0 26px;
  overflow: hidden;
  opacity: 0.9;
  border-bottom: 1px solid var(--border);
  -webkit-mask-image: linear-gradient(to bottom, black 82%, transparent);
  mask-image: linear-gradient(to bottom, black 82%, transparent);
}
.ambient-ticker canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 640px) { .ambient-ticker { height: 84px; } }

/* ---------- entrées en fondu (aussi pour les éléments ajoutés par JS) ---------- */
.wordmark, h1, .subtitle, .account-nav, .formation-tabs, .legal-tabs, .admin-tabs,
.toolbar, .field, .row-2, .card, .notice, .section-title, .section-sub, .phase-block,
.module, .module-row, .stat-tile, .todo-box, .locked-state, .msg-state, .no-account,
.back-link, .consent, .panel.active, .table-wrap, .support-bubble, .form-status.show {
  animation: fxEnter 0.45s cubic-bezier(.16,.8,.3,1) backwards;
}
.subtitle { animation-delay: 0.08s; }
.account-nav, .formation-tabs, .legal-tabs, .toolbar { animation-delay: 0.1s; }
.card, .notice, .field:nth-child(1), .stat-tile:nth-child(1), .module:nth-child(1), .module-row:nth-child(1) { animation-delay: 0.14s; }
.field:nth-child(2), .stat-tile:nth-child(2), .module:nth-child(2), .module-row:nth-child(2) { animation-delay: 0.2s; }
.field:nth-child(3), .stat-tile:nth-child(3), .module:nth-child(3), .module-row:nth-child(3) { animation-delay: 0.26s; }
.field:nth-child(4), .stat-tile:nth-child(4), .module:nth-child(4), .module-row:nth-child(4) { animation-delay: 0.32s; }
.field:nth-child(n+5), .stat-tile:nth-child(n+5), .module:nth-child(n+5), .module-row:nth-child(n+5) { animation-delay: 0.38s; }

h1::after {
  content: "";
  display: block;
  width: 64px;
  height: 2px;
  margin-top: 12px;
  background: linear-gradient(90deg, var(--accent), rgba(216,162,74,0));
  transform-origin: left;
  animation: fxLine 0.9s 0.25s cubic-bezier(.16,.8,.3,1) backwards;
}

/* ---------- cartes : bordure lumineuse, spot au survol ---------- */
.card, .fx-panel, .stat-tile, .module, .module-row {
  position: relative;
}
.card, .fx-panel {
  background: linear-gradient(180deg, rgba(26,30,37,0.94) 0%, rgba(20,23,28,0.96) 100%);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.42);
}
.card::after, .fx-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--fx-angle), transparent 0deg, rgba(240,190,110,0.9) 30deg, transparent 80deg, transparent 280deg, rgba(139,111,214,0.7) 330deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: fxSpin 5.5s linear infinite;
  pointer-events: none;
}
.fx-panel { padding: 28px; }
@media (max-width: 480px) { .fx-panel { padding: 20px; } }

.card::before, .fx-panel::before, .stat-tile::before, .module:not(.locked)::before, .module-row::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(216,162,74,0.13), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card:hover::before, .fx-panel:hover::before, .stat-tile:hover::before,
.module:not(.locked):hover::before, .module-row:hover::before { opacity: 1; }

.stat-tile { border-radius: 10px; transition: transform 0.2s ease, border-color 0.2s ease; }
.stat-tile:hover { transform: translateY(-2px); border-color: var(--text-faint); }
.module { border-radius: 10px; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.module:not(.locked):hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,0.4), 0 0 0 1px rgba(240,190,110,0.25); }
.module-row { border-radius: 8px; transition: background 0.2s ease; }
.module-row:hover { background: rgba(216,162,74,0.04); }
.notice { border-radius: 10px; }

/* ---------- formulaires ---------- */
input, textarea, select { transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; }
input:focus, textarea:focus, select:focus {
  outline: none !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(216,162,74,0.2);
}

/* ---------- boutons vivants (balayage lumineux) ---------- */
button.submit, #login-form button[type="submit"], .module-row button.save, .support-form button[type="submit"] {
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(216,162,74,0.32);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
button.submit:hover:not(:disabled), #login-form button[type="submit"]:hover, .module-row button.save:hover, .support-form button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(216,162,74,0.5);
}
button.submit::after, #login-form button[type="submit"]::after, .module-row button.save::after, .support-form button[type="submit"]::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-120%) skewX(-18deg);
  pointer-events: none;
}
button.submit:hover:not(:disabled)::after, #login-form button[type="submit"]:hover::after, .module-row button.save:hover::after, .support-form button[type="submit"]:hover::after {
  animation: fxSheen 0.9s ease;
}

/* ---------- onglets et navigation ---------- */
.tab-btn, .formation-tab, .legal-tab, .account-nav a { transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease, background 0.2s ease; }
.tab-btn:hover, .formation-tab:hover, .legal-tab:hover, .account-nav a:hover { transform: translateY(-1px); }
.tab-btn.active, .legal-tab.active, .account-nav a.active { box-shadow: 0 8px 22px rgba(216,162,74,0.32); }
.formation-tab.active { box-shadow: 0 0 0 1px currentColor, 0 8px 24px rgba(0,0,0,0.35); }

/* ---------- tableaux, pastilles ---------- */
tbody tr { transition: background 0.2s ease; }
tbody tr:hover { background: rgba(216,162,74,0.05); }
.status-pill.active::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
  animation: fxPulse 1.8s ease-in-out infinite;
}

/* ---------- accessibilité ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-aurora span, .card::after, .fx-panel::after, h1::after,
  .wordmark, h1, .subtitle, .account-nav, .formation-tabs, .legal-tabs, .admin-tabs,
  .toolbar, .field, .row-2, .card, .notice, .section-title, .section-sub, .phase-block,
  .module, .module-row, .stat-tile, .todo-box, .locked-state, .msg-state, .no-account,
  .back-link, .consent, .panel.active, .table-wrap, .support-bubble, .form-status.show,
  .status-pill.active::before {
    animation: none !important;
  }
  .card::after, .fx-panel::after { --fx-angle: 40deg; }
}

/* bouton "Envoyer" du support : même style que les boutons principaux */
.support-form button[type="submit"] {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 4px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
}

/* admin : le bouton "Enregistrer" tient dans sa colonne (le balayage lumineux rogne le débordement) */
.module-row button.save { padding-inline: 10px; white-space: nowrap; }
@media (min-width: 861px) { .module-row { grid-template-columns: 32px 1fr 260px 90px 108px; } }

/* nouveau logo (emblème sans fond) dans l'en-tête des pages */
.wordmark-icon { width: 2.2em; height: 2.2em; margin-block: -0.35em; border-radius: 0; object-fit: contain; }

/* =====================================================================
   Passe "beauté" pages intérieures : même langage visuel que les diapositives de l'accueil
   ===================================================================== */
@keyframes fxGoldShine { to { background-position: -200% center; } }

/* halos de fond colorés par page (couleurs posées par fx.js) */
.fx-aurora .a1 { background: radial-gradient(circle, var(--c1, rgba(216,162,74,0.24)) 0%, rgba(0,0,0,0) 70%) !important; }
.fx-aurora .a2 { background: radial-gradient(circle, var(--c2, rgba(139,111,214,0.18)) 0%, rgba(0,0,0,0) 70%) !important; }
.fx-aurora .a3 { background: radial-gradient(circle, var(--c3, rgba(45,189,126,0.10)) 0%, rgba(0,0,0,0) 70%) !important; }
.fx-aurora { opacity: 1; }

/* sur-titre doré en italique + titre à mot doré (comme les titres de l'accueil) */
.fx-eyebrow { display: block; font-family: "Fraunces", Georgia, serif; font-style: italic; font-weight: 500; font-size: 1.05rem; color: var(--accent-strong); margin-bottom: 10px; animation: fxEnter 0.75s cubic-bezier(.16,.8,.3,1) backwards; }
h1 { font-size: clamp(2rem, 4.6vw, 2.9rem) !important; line-height: 1.08 !important; letter-spacing: -0.01em; color: #fff; }
h1 .fx-gold {
  background: linear-gradient(90deg, #e6ae55 0%, #fff3d6 35%, #e6ae55 70%, #f0be6e 100%); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: fxGoldShine 4.5s linear infinite;
}
.section-title, .panel h2 { font-family: "Fraunces", Georgia, serif; }

/* cartes : filet doré en haut + halo (comme les cartes de l'accueil) */
.card, .panel, .fx-panel, .todo-box, .stat-tile {
  border-color: rgba(255,255,255,0.07);
  background-image: linear-gradient(90deg, transparent, rgba(240,190,110,0.85), transparent), linear-gradient(165deg, rgba(27,31,39,0.95), rgba(14,16,21,0.98));
  background-size: 100% 2px, 100% 100%; background-repeat: no-repeat; background-position: top, center;
  box-shadow: 0 30px 70px rgba(0,0,0,0.45), 0 0 60px rgba(216,162,74,0.06);
}

/* pages légales : onglets en pastilles lumineuses, contenu en carte verre */
.legal-tabs { gap: 10px; }
.legal-tab { border-radius: 999px; padding: 10px 20px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
.legal-tab:hover { border-color: rgba(240,190,110,0.5); }
.legal-tab.active { background: linear-gradient(120deg, #f8d894, #e6ae55 50%, #c98a2b); border-color: transparent; box-shadow: 0 10px 30px rgba(216,162,74,0.4); }
.panel { position: relative; overflow: hidden; padding: 34px 36px; border-radius: 18px; border: 1px solid rgba(255,255,255,0.07); }
@media (max-width: 560px) { .panel { padding: 24px 20px; } }
.panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(360px circle at var(--mx, 85%) var(--my, 0%), rgba(216,162,74,0.10), transparent 62%);
}
.panel h2 {
  position: relative; margin: 34px 0 12px; padding-left: 16px; font-size: 1.3rem; color: #fff;
}
.panel h2::before { content: ""; position: absolute; left: 0; top: 0.18em; bottom: 0.18em; width: 4px; border-radius: 4px; background: linear-gradient(180deg, #f0be6e, #8b6fd6); box-shadow: 0 0 12px rgba(240,190,110,0.5); }
.panel p, .panel li { color: #b3aca4; }
.panel strong { color: #fff; }
.panel a { text-decoration-color: rgba(240,190,110,0.5); }
.todo-box { border-radius: 14px; border-color: rgba(216,162,74,0.35); }

/* formation : intitulés de phase comme les sur-titres de l'accueil */
.phase-title { font-family: "Fraunces", Georgia, serif; font-style: italic; font-weight: 500; text-transform: none !important; letter-spacing: 0 !important; font-size: 1.1rem !important; color: var(--accent-strong) !important; }
.module .num { color: var(--accent-strong); }

/* compte / admin : titres de section */
.section-title { font-size: 1.35rem; position: relative; padding-bottom: 10px; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); }

/* pages étroites : un peu plus d'air sous le bandeau */
.wrap { padding-top: 34px !important; }

/* ---------- sélecteur Espace membre / Administration ---------- */
.role-switch { display: flex; gap: 6px; padding: 5px; margin-bottom: 26px; width: fit-content; max-width: 100%; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
.role-switch button { background: none; border: 0; color: var(--text-muted); padding: 10px 18px; border-radius: 10px; font-size: 0.9rem; font-family: inherit; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.role-switch button:hover { color: #fff; }
.role-switch button.active { background: linear-gradient(120deg, #f8d894, #e6ae55 55%, #c98a2b); color: #241a0a; font-weight: 600; box-shadow: 0 8px 24px rgba(216,162,74,0.35); }
.role-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .role-buttons { grid-template-columns: 1fr; } }
.role-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.04); color: #fff; font-family: inherit; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s, background .2s; }
.role-btn .ico { font-size: 1.9rem; }
.role-btn strong { font-family: "Fraunces", Georgia, serif; font-size: 1.15rem; }
.role-btn small { color: var(--text-muted); font-size: 0.8rem; }
.role-btn:hover { transform: translateY(-3px); border-color: rgba(240,190,110,0.6); box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 40px rgba(216,162,74,0.18); background: rgba(216,162,74,0.08); }
.role-btn.admin { border-color: rgba(139,111,214,0.45); }
.role-btn.admin:hover { border-color: rgba(139,111,214,0.9); box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 40px rgba(139,111,214,0.28); background: rgba(139,111,214,0.10); }

/* admin : modules séparés par formation */
.formation-group { display: flex; align-items: baseline; gap: 10px; margin: 34px 0 6px; font-family: "Fraunces", Georgia, serif; font-size: 1.35rem; color: #fff; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.formation-group:first-child { margin-top: 8px; }
.formation-group .dot { width: 10px; height: 10px; border-radius: 50%; align-self: center; }
.formation-group.dark .dot { background: var(--safe); box-shadow: 0 0 14px var(--safe); }
.formation-group.ina .dot { background: var(--agressive); box-shadow: 0 0 14px var(--agressive); }
.formation-group small { font-family: "IBM Plex Sans", sans-serif; font-size: 0.78rem; color: var(--text-faint); font-weight: 400; }
