/* LEGENIIE · Console abonnements — feuille de style unique (écrite à la main). */
:root {
  --bg: #F8F5F4;
  --ink: #2A1517;
  --muted: #6E4448;
  --eyebrow: #8A5F66;
  --line: #EEDDDB;
  --line-soft: #F3E6E4;
  --bordeaux: #5B2C2F;
  --deep: #3A1A1D;
  --side: #2A1517;
  --gold: #D4AF37;
  --gold-soft: #FBF3DA;
  --gold-line: #E6CD7A;
  --gold-ink: #5E4A1A;
  --rose: #F6C1C7;
  --blush: #FBE9E7;
  --mauve: #B07A84;
  --red: #B4232C;
  --red-soft: #FDECEC;
  --red-line: #F2B8B8;
  --red-ink: #7A2A2F;
  --green-soft: #E6F4EA;
  --green-ink: #1E6B3C;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--bordeaux); }
a:hover { color: var(--deep); }
h1, h2, h3 { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 14px; border-radius: 10px; background: var(--gold); color: var(--ink); font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- Shell ---------- */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side {
  flex: 1 1 240px; max-width: 260px; padding: 26px 16px;
  background: var(--side); color: #fff;
  display: flex; flex-direction: column; gap: 6px;
}
.brand { padding: 4px 12px 26px; display: flex; flex-direction: column; gap: 4px; color: #fff; text-decoration: none; }
.brand b { font-size: 20px; letter-spacing: .08em; }
.brand span { font-size: 13px; color: var(--rose); }
.nav-link { padding: 12px 16px; border-radius: 12px; color: #fff; text-decoration: none; font-size: 15px; }
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-link.is-active { background: var(--gold); color: var(--ink); font-weight: 700; }
.side-foot { margin-top: auto; padding: 20px 12px 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--rose); border-top: 1px solid rgba(246, 193, 199, .18); }
.side-foot a, .side-foot button { color: #fff; font-size: 13px; }
.side-foot form { margin: 0; }
.link-btn { padding: 0; border: 0; background: none; font: inherit; text-decoration: underline; cursor: pointer; color: inherit; }

.main { flex: 999 1 560px; min-width: 0; padding: 32px 36px 48px; display: flex; flex-direction: column; gap: 26px; }

/* ---------- Headings ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head.center { align-items: center; }
.title-block { display: flex; flex-direction: column; gap: 4px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--eyebrow); text-transform: uppercase; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.subtitle { font-size: 14px; color: var(--muted); }
.back { font-size: 14px; font-weight: 600; text-decoration: none; align-self: flex-start; }
h2.card-title { font-size: 18px; font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 12px; border: 0;
  background: var(--bordeaux); color: #fff; font: inherit; font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--deep); color: #fff; }
.btn:disabled, .btn:disabled:hover { opacity: .45; cursor: not-allowed; background: #fff; color: var(--bordeaux); }
.btn-lg { min-height: 54px; border-radius: 14px; font-size: 16px; font-weight: 700; width: 100%; }
.btn-outline { background: #fff; color: var(--bordeaux); border: 1px solid var(--bordeaux); }
.btn-outline:hover { background: var(--blush); color: var(--deep); }
.btn-sm { min-height: 40px; padding: 0 14px; border-radius: 10px; font-size: 13px; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #c49f2c; color: var(--ink); }

/* ---------- Flash ---------- */
.flash { padding: 14px 18px; border-radius: 14px; font-size: 14px; border: 1px solid; }
.flash-ok { background: var(--green-soft); border-color: #b9dfc5; color: var(--green-ink); }
.flash-error { background: var(--red-soft); border-color: var(--red-line); color: var(--red-ink); }
.flash ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.kpi { padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi b { font-size: 28px; line-height: 1.1; }
.kpi-soon { background: var(--gold-soft); border-color: var(--gold-line); }
.kpi-soon span { color: var(--gold-ink); }
.kpi-expired { background: var(--red-soft); border-color: var(--red-line); }
.kpi-expired span { color: var(--red-ink); }
.kpi-money { background: var(--bordeaux); border-color: var(--bordeaux); color: #fff; }
.kpi-money span { color: var(--rose); }
.kpi-money b { font-size: 24px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.search:focus-within { border-color: var(--bordeaux); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 14px; background: transparent; color: var(--ink); }
.pill-link { display: inline-flex; align-items: center; height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 14px; text-decoration: none; }
.pill-link:hover { border-color: var(--bordeaux); color: var(--ink); }
.pill-link.is-active { background: var(--side); border-color: var(--side); color: #fff; font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data.wide { min-width: 900px; }
table.data thead tr { background: var(--bordeaux); color: #fff; text-align: left; }
table.data th { padding: 14px 18px; font-weight: 600; white-space: nowrap; }
table.data td { padding: 14px 18px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data tfoot td { border-top: 2px solid var(--line); font-weight: 700; }
.cell-main { display: flex; flex-direction: column; gap: 3px; }
.cell-main span, .muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }

/* ---------- Pills ---------- */
.pill { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill-lg { padding: 8px 14px; font-size: 14px; }
.pill-active { background: var(--green-soft); color: var(--green-ink); }
.pill-trial { background: var(--blush); color: var(--bordeaux); }
.pill-soon { background: var(--gold-soft); color: var(--gold-ink); }
.pill-grace { background: var(--red-soft); color: #8E1A22; }
.pill-expired { background: var(--side); color: var(--rose); }
.chip { display: inline-block; padding: 3px 9px; border-radius: 8px; background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 800; }

/* ---------- Cards & layout ---------- */
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.card { padding: 24px; border-radius: 18px; background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-strong { padding: 26px; border-radius: 20px; border: 2px solid var(--bordeaux); gap: 18px; }
.card-strong h2 { font-size: 20px; font-weight: 800; }
.card p { margin: 0; }

/* Timeline */
.timeline { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.timeline li { display: flex; gap: 14px; }
.timeline li > div { padding-bottom: 18px; display: flex; flex-direction: column; gap: 2px; }
.timeline li:last-child > div { padding-bottom: 0; }
.timeline b { font-size: 14px; }
.timeline span { font-size: 13px; color: var(--muted); }
.dot { flex: none; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; background: var(--bordeaux); }
.dot-trial { background: var(--mauve); }
.dot-next { background: transparent; border: 2px dashed var(--gold); }
.dot-now { box-shadow: 0 0 0 4px var(--gold-soft); }

/* App banner preview (same tones as L'Brille) */
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.banner-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--rose); color: var(--bordeaux); }
.banner-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.banner-text b { font-size: 14px; }
.banner-text span { font-size: 13px; color: var(--muted); }
.tone-trial { background: var(--blush); border-color: var(--rose); }
.tone-trial .banner-icon { background: var(--mauve); color: #fff; }
.tone-warning { background: var(--gold-soft); border-color: var(--gold-line); }
.tone-warning .banner-icon { background: var(--gold); color: var(--ink); }
.tone-warning .banner-text span { color: var(--gold-ink); }
.tone-dark { background: var(--bordeaux); border-color: var(--bordeaux); color: #fff; }
.tone-dark .banner-icon { background: var(--gold); color: var(--ink); }
.tone-dark .banner-text span { color: var(--rose); }
.tone-danger { background: var(--red-soft); border-color: var(--red-line); }
.tone-danger .banner-icon { background: var(--red); color: #fff; }
.tone-danger .banner-text span { color: var(--red-ink); }
.tone-deep { background: var(--deep); border-color: var(--deep); color: #fff; }
.tone-deep .banner-icon { background: var(--rose); color: var(--deep); }
.tone-deep .banner-text span { color: var(--rose); }
.tone-none { background: var(--green-soft); border-color: #b9dfc5; }
.tone-none .banner-icon { background: var(--green-ink); color: #fff; }
.tone-none .banner-text span { color: var(--green-ink); }

/* Grid lists (payment history) */
.grid-list { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px 16px; font-size: 14px; align-items: center; }
.grid-list .h { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.grid-list .r { text-align: right; white-space: nowrap; }

/* Definition list (instance) */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row form { margin: 0; }

/* One-time key */
.keybox { padding: 20px; border-radius: 18px; background: var(--deep); color: #fff; display: flex; flex-direction: column; gap: 12px; }
.keybox h2 { font-size: 18px; }
.keybox p { margin: 0; color: var(--rose); font-size: 14px; }
.keybox-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.keybox input { flex: 1 1 320px; min-width: 0; height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--gold); background: #fff; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 14px; }
.keybox pre { margin: 0; padding: 12px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff; font-size: 13px; overflow-x: auto; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.field.full { grid-column: 1 / -1; }
.field input, .field select, .field textarea, .input {
  min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line);
  font: inherit; font-size: 14px; font-weight: 400; background: #fff; color: var(--ink); width: 100%;
}
.field textarea { padding: 10px 12px; min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--bordeaux); outline: 2px solid var(--gold-soft); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.field .error, .error-text { font-weight: 500; color: var(--red); font-size: 12px; }
.field input[aria-invalid="true"] { border-color: var(--red); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--bordeaux); flex: none; }

/* Plan cards (radio) */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border: 0; margin: 0; padding: 0; min-width: 0; }
.plan-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; border-radius: 16px; cursor: pointer; background: #fff; color: var(--ink); border: 2px solid var(--line); }
.plan-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.plan-card:hover { border-color: var(--mauve); }
.plan-card:has(input:checked) { background: var(--bordeaux); color: #fff; border-color: var(--bordeaux); }
.plan-card:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.plan-top { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 8px; }
.plan-top b { font-size: 15px; }
.plan-price { font-size: 22px; font-weight: 700; }
.plan-per { font-size: 13px; opacity: .85; }

.preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.preview div { padding: 14px 16px; border-radius: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 4px; }
.preview span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.preview b { font-size: 16px; }
.note { font-size: 13px; color: var(--muted); text-align: center; margin: 0; }

/* Settings */
.price-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px 16px; align-items: center; font-size: 14px; }
.price-grid .h { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.price-grid input { min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); font: inherit; width: 100%; }
.reminder { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-soft); }
.reminder .rdot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--mauve); }
.rdot-gold { background: var(--gold) !important; }
.rdot-bordeaux { background: var(--bordeaux) !important; }
.rdot-red { background: var(--red) !important; }
.reminder-text { flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px; }
.reminder-text b { font-size: 14px; }
.reminder-text span { font-size: 13px; color: var(--muted); }
.toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #fff; color: var(--eyebrow); border: 1px dashed #D9C3C1; cursor: pointer; }
.toggle input { width: 14px; height: 14px; accent-color: #fff; margin: 0; }
.toggle:has(input:checked) { background: var(--bordeaux); color: #fff; border: 1px solid var(--bordeaux); }
.toggle:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.toggle-fixed { background: var(--bg); color: var(--ink); border: 0; cursor: default; }

/* Pagination */
.pager { display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 14px; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--side); }
.login-card { width: 100%; max-width: 420px; padding: 32px; border-radius: 22px; background: #fff; display: flex; flex-direction: column; gap: 18px; }
.login-card .brand-dark { display: flex; flex-direction: column; gap: 4px; }
.login-card .brand-dark b { font-size: 22px; letter-spacing: .08em; color: var(--bordeaux); }
.login-card .brand-dark span { font-size: 13px; color: var(--eyebrow); }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { align-content: flex-start; }
  .side { flex: 1 1 100%; max-width: none; padding: 14px 16px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
  .brand { padding: 0 8px 0 0; flex: 1 1 100%; flex-direction: row; align-items: baseline; gap: 10px; }
  .nav-link { padding: 9px 12px; font-size: 14px; }
  .side-foot { margin: 6px 0 0; padding: 10px 4px 0; flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; gap: 14px; }
  .main { flex-basis: 100%; padding: 22px 16px 40px; gap: 20px; }
  .subtitle { overflow-wrap: anywhere; }
  h1 { font-size: 25px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-money { grid-column: 1 / -1; }
  .kpi b { font-size: 24px; }
  .card, .card-strong { padding: 18px; }
}
@media (max-width: 520px) {
  .form-grid, .preview { grid-template-columns: minmax(0, 1fr); }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .grid-list { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .grid-list .hide-sm { display: none; }
  .price-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .price-grid .hide-sm { display: none; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .pill-link { height: 40px; padding: 0 14px; }
}

/* ---------- Renewal code (offline) ---------- */
.card-offer { border: 2px solid var(--gold); }
.code-result { display: flex; flex-direction: column; gap: 12px; }
.code-box { font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important; font-size: 13px !important; min-height: 0 !important; padding: 10px 12px !important; line-height: 1.5; word-break: break-all; resize: none !important; }
.qr { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.qr svg { width: 220px; height: 220px; max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0; }
.inline-form .field { flex: 1 1 260px; }
