:root {
  --ink: #18212f;
  --muted: #657283;
  --line: #dbe4e7;
  --paper: #f6f8f5;
  --surface: #ffffff;
  --soft: #eef6f0;
  --green: #126d54;
  --blue: #286fb5;
  --amber: #a76f18;
  --red: #b94130;
  --violet: #6750a4;
  --shadow: 0 18px 42px rgba(24, 33, 47, 0.1);
  --soft-shadow: 0 10px 26px rgba(24, 33, 47, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #fbfcf8 0, var(--paper) 420px, #eef3f1 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 0 max(18px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(219, 228, 231, 0.82);
  background: rgba(255, 255, 255, 0.9);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand::before {
  content: "LB";
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 0.84rem;
}

nav,
.topbar-nav,
.navbar,
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

nav a,
.topbar-nav a,
.navbar a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 8px 11px;
  font-weight: 800;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.topbar-nav a:hover,
.topbar-nav a.active {
  background: var(--soft);
  color: var(--green);
}

.navbar {
  margin: -6px 0 20px;
}

.navbar a {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(24, 33, 47, 0.04);
}

.navbar a.active,
.navbar a:hover {
  border-color: var(--green);
  background: var(--soft);
  color: var(--green);
}

.hero {
  min-height: 560px;
  display: grid;
  align-items: end;
  padding: 86px max(18px, calc((100vw - 1180px) / 2)) 66px;
  color: white;
  background:
    linear-gradient(90deg, rgba(12, 19, 26, 0.9), rgba(18, 109, 84, 0.62), rgba(12, 19, 26, 0.38)),
    url("https://www.esbly.fr/wp-content/uploads/2022/08/College-lycee-1200x630-1-1200x630.png") center / cover;
}

.class-hero {
  min-height: 500px;
}

.compact-hero {
  min-height: 390px;
}

.hero-copy {
  max-width: 880px;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  line-height: 0.98;
}

.hero p {
  max-width: 760px;
  font-size: 1.16rem;
  line-height: 1.58;
}

.hero strong {
  color: #f8f0cc;
}

.overview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: -34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
}

.overview-strip article {
  background: rgba(255, 255, 255, 0.96);
  padding: 22px;
}

.overview-strip span,
.metric-card span,
.status-pill {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.overview-strip span {
  color: var(--blue);
}

.overview-strip strong {
  display: block;
  margin: 7px 0;
  font-size: 1.08rem;
}

.section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 50px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 22px;
  margin-bottom: 24px;
}

.section-head.compact {
  margin-bottom: 14px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--green);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.05;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.12;
}

p,
li {
  line-height: 1.62;
}

.muted,
footer,
td span {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.panel,
.feature-card,
.page-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  padding: 22px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

a.card:hover,
a.page-tile:hover,
.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(18, 109, 84, 0.45);
  box-shadow: var(--shadow);
}

.class-card {
  min-height: 154px;
}

.feature-card,
.page-tile {
  position: relative;
  overflow: hidden;
}

.feature-card::before,
.page-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--green);
}

.feature-card span,
.page-tile span {
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.text-link {
  display: inline-flex;
  margin-top: 8px;
  color: var(--green);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.feature-card h3,
.page-tile h3 {
  margin: 8px 0 8px;
}

.page-grid {
  margin-top: 22px;
}

.highlight-band {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: start;
  border-top: 1px solid var(--line);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 24px;
  align-items: start;
  border-top: 1px solid var(--line);
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: white;
  padding: 9px 14px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(24, 33, 47, 0.12);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.button:hover {
  transform: translateY(-1px);
}

.counts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--soft-shadow);
}

.metric-card span {
  color: var(--green);
}

.metric-card strong {
  display: block;
  margin: 7px 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 20px;
}

.form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd8d4;
  border-radius: 8px;
  padding: 10px 12px;
}

.notice {
  border: 1px solid #d8c68c;
  border-radius: 8px;
  background: #fff8dd;
  color: #604b12;
  padding: 12px 14px;
}

.notice.error {
  border-color: #efb5aa;
  background: #fff0ed;
  color: var(--red);
}

.preview-header {
  padding-bottom: 18px;
}

.preview-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 56px;
}

.student-frame {
  display: block;
  width: 100%;
  min-height: 780px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 1140px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #edf3ef;
  color: #2d3847;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.status-pill.ok {
  border-color: rgba(18, 109, 84, 0.25);
  background: var(--soft);
  color: var(--green);
}

.status-pill.danger {
  border-color: rgba(185, 65, 48, 0.28);
  background: #fff0ed;
  color: var(--red);
}

.actions-cell {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.logs {
  margin-top: 18px;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.board-card {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 22px;
  box-shadow: var(--soft-shadow);
}

.board-card h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.board-card dl,
.legal-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.board-card dt,
.account-card dt,
.legal-list dt {
  color: var(--muted);
  font-weight: 850;
}

.board-card dd,
.account-card dd,
.legal-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.board-card dd,
.account-card dd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.board-password {
  color: var(--red);
  font-size: clamp(2rem, 5vw, 3.6rem) !important;
  font-weight: 900;
  line-height: 1.1;
}

.print-note {
  display: none;
}

.print-class {
  margin-top: 28px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.account-card {
  break-inside: avoid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 16px;
}

.account-card h3 {
  margin-bottom: 12px;
}

.account-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.account-card dl div,
.legal-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
}

.student-lines {
  margin-top: 12px;
}

.student-lines p {
  margin-bottom: 8px;
  font-weight: 800;
}

.student-lines span {
  display: block;
  min-height: 26px;
  border-bottom: 1px solid #bfcac5;
  color: var(--muted);
}

.subject-group + .subject-group,
.legal-page .panel + .panel {
  margin-top: 18px;
}

pre {
  overflow-x: auto;
  margin: 0 0 10px;
  padding: 12px;
  border-radius: 8px;
  background: #17202a;
  color: #edf2ee;
  font-size: 0.82rem;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 22px;
  padding: 34px max(18px, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.site-footer p {
  margin-bottom: 0;
}

.site-footer nav {
  justify-content: flex-end;
}

.site-footer a {
  border: 1px solid var(--line);
  background: var(--paper);
}

@media (max-width: 900px) {
  .topbar,
  .section-head,
  .site-footer {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .grid.two,
  .grid.three,
  .login-layout,
  .counts-grid,
  .metric-grid,
  .overview-strip,
  .account-grid,
  .board-grid,
  .highlight-band,
  .split-section {
    grid-template-columns: 1fr;
  }

  .site-footer nav {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .account-card dl div,
  .legal-list div {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: white;
  }

  .topbar,
  footer,
  .print-hide {
    display: none !important;
  }

  .section {
    width: auto;
    margin: 0;
    padding: 0;
  }

  .print-note {
    display: block;
    margin-bottom: 12mm;
  }

  .print-class {
    page-break-before: always;
  }

  .print-note + .print-class {
    page-break-before: auto;
  }

  .account-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8mm;
  }

  .account-card {
    box-shadow: none;
    min-height: 62mm;
    padding: 7mm;
  }

  .button,
  .card {
    box-shadow: none;
  }
}
