/* ============================================================
   Portail BTS SIO SISR — NextGen
   Thème harmonisé avec la page originale apprends.net
   Structure conservée : index.php NextGen
   ============================================================ */

:root {
  --navy: #15283f;
  --ink: #1f2d3d;
  --muted: #5f6f80;
  --line: #dce4ea;
  --paper: #fff;
  --wash: #f4f7f9;
  --blue: #176b87;
  --blue-dark: #0d526a;
  --blue-pale: #e9f4f7;
  --green: #176b4d;
  --violet: #7864a8;
  --violet-dark: #4c3b78;
  --violet-pale: #f0edf7;
  --green-pale: #eaf4ee;
  --amber: #c49a39;
  --amber-dark: #6f5212;
  --amber-pale: #fff4d9;
  --shadow: 0 10px 26px rgba(20, 42, 64, .06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.58;
}

a {
  color: var(--blue-dark);
  text-underline-offset: 3px;
}

a:hover { color: #083e53; }

.skip-link {
  position: absolute;
  top: 0;
  left: -9999px;
  z-index: 99;
  background: #fff;
  padding: 10px;
}

.skip-link:focus { left: 10px; }

/* ---------- En-tête : même identité visuelle que l'original ---------- */
.hero {
  background: var(--navy);
  color: #fff;
  padding: 48px 24px 40px;
}

.hero-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.eyebrow,
.section-kicker {
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.eyebrow {
  color: #a9d5e3;
  margin-bottom: 13px;
}

.hero h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 3.7rem);
  letter-spacing: -.04em;
  line-height: 1.08;
}

.hero h1 span { color: #8bd0df; }

.lead {
  color: #e1ebf1;
  font-size: 1.15rem;
  max-width: 760px;
  margin: 19px 0;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.hero-meta span {
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: .84rem;
  color: #eef7fa;
}

.hero-callout {
  max-width: 860px;
  border-left: 4px solid #8bd0df;
  padding: 10px 16px;
  color: #e5f2f6;
  background: rgba(255,255,255,.055);
}

.hero-callout strong {
  display: block;
  color: #a9e2ed;
  margin-bottom: 3px;
}

/* ---------- Corps de page ---------- */
.main-wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 34px 24px 54px;
}

.section-intro { margin-bottom: 22px; }

.section-kicker {
  color: var(--blue);
  margin-bottom: 5px;
}

.section-intro h2,
.upcoming h2,
.howto h2 {
  color: var(--navy);
  font-size: clamp(1.55rem, 2.7vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -.025em;
  margin: 0 0 10px;
}

.section-intro p,
.upcoming-note {
  color: var(--muted);
  max-width: 760px;
  margin: 0;
}

/* ---------- Cartes des TP et quiz ---------- */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.resource-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.theme-violet { border-top-color: var(--violet); }
.theme-blue   { border-top-color: var(--blue); }
.theme-green  { border-top-color: #3c8063; }
.theme-amber  { border-top-color: var(--amber); }

.card-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin-bottom: 19px;
}

/* Les identifiants NextGen sont des libellés complets : « TP 01 », « Q1 ».
   La pastille doit donc s'adapter au texte au lieu de rester bloquée à 38 px. */
.number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 38px;
  min-height: 38px;
  padding: 0 10px;
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1;
  text-align: center;
  border-radius: 9px;
  background: #edf3f6;
  color: var(--navy);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.theme-violet .number-badge {
  background: var(--violet-pale);
  color: #594785;
}

.theme-blue .number-badge {
  background: var(--blue-pale);
  color: var(--blue-dark);
}

.theme-green .number-badge {
  background: var(--green-pale);
  color: #276447;
}

.theme-amber .number-badge {
  background: var(--amber-pale);
  color: #71520c;
}

.kind-label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
}

.resource-card h3 {
  color: var(--navy);
  font-size: 1.25rem;
  line-height: 1.28;
  margin: 0 0 12px;
}

.card-description {
  color: #3f5060;
  margin: 0 0 17px;
  font-size: .96rem;
}

.card-detail {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  margin: auto 0 15px;
  padding-top: 12px;
}

.card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  color: #fff;
  background: var(--blue);
  padding: 11px 13px;
  border-radius: 7px;
  transition: background .15s ease, transform .15s ease;
}

.card-action:hover,
.card-action:focus-visible {
  color: #fff;
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.theme-violet .card-action { background: #62508d; }
.theme-violet .card-action:hover,
.theme-violet .card-action:focus-visible { background: var(--violet-dark); }

.theme-green .card-action { background: #286c4d; }
.theme-green .card-action:hover,
.theme-green .card-action:focus-visible { background: #1d543a; }

.theme-amber .card-action { background: #8a6819; }
.theme-amber .card-action:hover,
.theme-amber .card-action:focus-visible { background: var(--amber-dark); }

/* ---------- Ressources à venir : même carte, action désactivée ---------- */
.upcoming {
  margin-top: 42px;
}

.upcoming-note { margin: 0 0 18px; }

.resource-card--upcoming {
  background: #fbfcfd;
  border-top-color: #aebdca;
}

.resource-card--upcoming .number-badge {
  background: #edf2f5;
  color: #68798a;
}

.resource-card--upcoming .kind-label,
.resource-card--upcoming .card-description,
.resource-card--upcoming .card-detail,
.resource-card--upcoming h3 {
  color: #718091;
}

.card-action--upcoming {
  cursor: default;
  user-select: none;
  color: #647487;
  background: #edf2f5;
  border: 1px dashed #cbd6df;
  font-weight: 700;
}

.card-action--upcoming:hover,
.card-action--upcoming:focus-visible {
  color: #647487;
  background: #edf2f5;
  transform: none;
}

/* ---------- Bonnes pratiques ---------- */
.howto { margin-top: 42px; }

.howto > p { color: var(--muted); }

.tips-grid {
  display: grid;
  gap: 10px;
  margin-top: 17px;
}

.tip-card {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255,255,255,.8);
}

.tip-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 7px;
  background: var(--blue-pale);
  color: var(--blue-dark);
  font-weight: 850;
  font-size: .82rem;
}

.tip-card h3 {
  color: var(--navy);
  margin: 1px 0 4px;
  font-size: 1.02rem;
}

.tip-card p {
  margin: 0;
  color: #506071;
  font-size: .94rem;
}

/* ---------- Pied de page ---------- */
.footer {
  margin-top: 35px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .84rem;
}

.footer p { margin: 4px 0 7px; }
.footer strong { color: var(--navy); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #edf2f5;
  border-radius: 4px;
  padding: .08em .3em;
}

/* ---------- États de focus et accessibilité ---------- */
.card-action:focus-visible,
a:focus-visible,
.skip-link:focus-visible {
  outline: 3px solid #e0a72e;
  outline-offset: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .hero { padding: 32px 18px 28px; }
  .main-wrap { padding: 25px 14px 38px; }
  .resource-grid { grid-template-columns: 1fr; }
  .resource-card:last-child:nth-child(odd) { grid-column: auto; }
  .resource-card { padding: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
