/* =====================================================================
   WESTSIDE LEGACY : fondations communes (site public + panel)
   Palette tirée du logo : noir nuit, or, blanc cassé du lettrage.
   Typographie : Barlow, dessinée d'après la signalisation californienne.
   ===================================================================== */

@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/barlow-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/barlow-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/barlow-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/barlow-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/barlow-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/barlow-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/barlow-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/barlow-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/barlow-condensed-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/barlow-condensed-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../fonts/barlow-condensed-latin-800-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../fonts/barlow-condensed-latin-ext-800-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: dark;
  --night: #0c0a07;
  --asphalt: #16130e;
  --asphalt-2: #1e1a13;
  --curb: #332d20;
  --curb-hi: #50472f;
  --gold: #f2b50c;
  --gold-hi: #ffc933;
  --gold-deep: #9c7208;
  --bone: #f1eee6;
  --smoke: #b8b1a1;
  --smoke-dim: #918a7a;
  --red: #ee7660;
  --red-deep: #a8392a;
  --green: #7cc98a;
  --blue: #8ab8dc;

  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Barlow Condensed', 'Arial Narrow', 'Barlow', sans-serif;

  --radius: 4px;
  --cut: 10px;
  --surface: var(--night);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, video { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0 0 .5em; line-height: 1.05; text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(2.5rem, 5.6vw, 4.4rem); line-height: .98; }
h2 { font-weight: 800; font-size: clamp(1.85rem, 3.2vw, 2.7rem); }
h3 { font-weight: 700; font-size: 1.45rem; letter-spacing: .005em; }
h4 { font-weight: 700; font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--gold); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--gold-hi); }
strong { font-weight: 600; }
code { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: .95em; }
hr { border: 0; border-top: 1px solid var(--curb); margin: 2rem 0; }
::selection { background: var(--gold); color: var(--night); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.skip-link { position: absolute; left: 12px; top: -80px; z-index: 200; background: var(--gold); color: var(--night); padding: 10px 16px; font-weight: 700; }
.skip-link:focus { top: 12px; color: var(--night); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Boutons : angles coupés, comme le contour du logo ---------- */
.btn {
  --notch: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 46px;
  padding: .65rem 1.5rem;
  border: 0;
  clip-path: var(--notch);
  background: var(--curb);
  color: var(--bone);
  font: 700 1rem/1.2 var(--font-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.btn:hover { color: var(--bone); background: var(--curb-hi); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--bone); outline-offset: -5px; }
.btn-gold { background: var(--gold); color: var(--night); }
.btn-gold:hover { background: var(--gold-hi); color: var(--night); }
.btn-gold:focus-visible { outline-color: var(--night); }
.btn-line { background: var(--gold-deep); color: var(--bone); }
.btn-line::before { content: ''; position: absolute; inset: 1.5px; z-index: -1; background: var(--surface); clip-path: var(--notch); transition: background-color .18s var(--ease); }
.btn-line:hover { background: var(--gold); color: var(--gold-hi); }
.btn-line:hover::before { background: var(--asphalt-2); }
.btn-quiet { background: transparent; color: var(--smoke); }
.btn-quiet:hover { background: var(--asphalt-2); color: var(--bone); }
.btn-danger { background: var(--red-deep); color: #fff; }
.btn-danger:hover { background: #c4452f; color: #fff; }
.btn-sm { min-height: 36px; padding: .35rem .95rem; font-size: .9375rem; --cut: 7px; }
.btn-lg { min-height: 54px; padding: .85rem 1.9rem; font-size: 1.0625rem; --cut: 13px; }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: progress; }
.btn.is-loading::after { content: ''; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.link { font-weight: 600; text-decoration: underline; }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.form-grid > * { grid-column: 1 / -1; }
.form-grid > .field-half { grid-column: span 1; }
.field { margin: 0 0 1.25rem; min-width: 0; }
fieldset.field, fieldset.form-section { border: 0; padding: 0; }
.field > label, .field > legend { display: block; font-weight: 600; margin: 0 0 .4rem; padding: 0; line-height: 1.4; }
.optional { font-weight: 400; color: var(--smoke-dim); font-size: .9em; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=search], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: .65rem .8rem;
  background: #100e0a;
  color: var(--bone);
  border: 1px solid var(--curb);
  border-radius: var(--radius);
  font: 400 1rem/1.4 var(--font-body);
  transition: border-color .15s;
}
textarea { resize: vertical; min-height: 90px; }
select { appearance: none; padding-right: 2.4rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f2b50c' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; }
input:hover, select:hover, textarea:hover { border-color: var(--curb-hi); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent; }
input[type=file] { padding: .5rem; }
input[type=file]::file-selector-button { margin-right: .8rem; padding: .35rem .8rem; border: 0; border-radius: 2px; background: var(--curb); color: var(--bone); font: 600 .9rem var(--font-body); cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--gold); }
.check { display: flex; gap: .65rem; align-items: flex-start; cursor: pointer; font-weight: 400; line-height: 1.45; }
.radios { display: flex; flex-wrap: wrap; gap: 1.5rem; padding-top: .25rem; }
.help { margin: .4rem 0 0; color: var(--smoke-dim); font-size: .9rem; line-height: 1.45; }
.field-error { margin: .4rem 0 0; color: var(--red); font-size: .9375rem; font-weight: 600; line-height: 1.4; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.counter { margin: .3rem 0 0; text-align: right; font-size: .85rem; color: var(--smoke-dim); font-variant-numeric: tabular-nums; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Messages ---------- */
.alert, .notice { margin: 0 0 1.5rem; padding: .9rem 1.1rem; border: 1px solid var(--curb); border-radius: var(--radius); background: var(--asphalt); }
.alert p:last-child, .notice p:last-child { margin: 0; }
.notice { border-color: var(--gold-deep); background: #1b1608; }
.alert-error { border-color: var(--red-deep); background: #23110d; }
.alert-success { border-color: #3d7a4a; background: #101c12; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 150; display: grid; gap: .6rem; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: .75rem; padding: .85rem 1rem; background: var(--asphalt-2); border: 1px solid var(--curb-hi); border-top: 3px solid var(--gold); border-radius: var(--radius); box-shadow: 0 14px 34px rgba(0, 0, 0, .55); pointer-events: auto; animation: toast-in .3s var(--ease); transition: opacity .25s, transform .25s; }
.toast p { margin: 0; flex: 1; line-height: 1.45; }
.toast button { background: none; border: 0; color: var(--smoke); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }
.toast-success { border-top-color: var(--green); }
.toast-error { border-top-color: var(--red); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Menu mobile (bouton) ---------- */
.nav-toggle { display: none; align-items: center; gap: .6rem; min-height: 44px; padding: .4rem .8rem; background: none; border: 1px solid var(--curb); border-radius: var(--radius); color: var(--bone); font: 600 .95rem var(--font-body); cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 18px; height: 2px; background: var(--gold); transition: transform .2s var(--ease), background-color .2s; }
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ''; position: absolute; left: 0; }
.nav-toggle-bars::before { transform: translateY(-6px); }
.nav-toggle-bars::after { transform: translateY(6px); }
.nav-toggle[aria-expanded=true] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded=true] .nav-toggle-bars::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded=true] .nav-toggle-bars::after { transform: rotate(-45deg); }

/* ---------- Texte rédigé dans le panel ---------- */
.prose { max-width: 68ch; }
.prose h3 { margin-top: 1.6em; }
.prose ul { margin: 0 0 1em; padding-left: 1.2rem; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--gold); }
.prose > :last-child { margin-bottom: 0; }
.lead { font-size: 1.1875rem; color: var(--smoke); }

/* ---------- Pagination et filtres ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin: 2.5rem 0 0; }
.pagination a { min-width: 42px; padding: .45rem .7rem; text-align: center; border: 1px solid var(--curb); border-radius: var(--radius); color: var(--bone); text-decoration: none; }
.pagination a:hover { border-color: var(--gold-deep); }
.pagination a[aria-current=page] { background: var(--gold); border-color: var(--gold); color: var(--night); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 2rem; }
.chips a { padding: .45rem 1rem; border: 1px solid var(--curb); border-radius: var(--radius); color: var(--smoke); font-weight: 600; text-decoration: none; transition: border-color .15s, color .15s; }
.chips a:hover { color: var(--bone); border-color: var(--gold-deep); }
.chips a[aria-current=page] { background: var(--gold); border-color: var(--gold); color: var(--night); }
.empty { padding: 1.5rem; border: 1px dashed var(--curb-hi); border-radius: var(--radius); color: var(--smoke); }

/* ---------- Pages autonomes : erreurs et installation ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.error-box { width: min(520px, 100%); text-align: center; }
.error-box img { width: 240px; margin: 0 auto 1.5rem; }
.error-box h1 { font-size: 2.2rem; }
.error-code { margin: 0; font: 800 4rem/1 var(--font-display); color: var(--gold); }
.error-box pre { margin-top: 2rem; padding: 1rem; overflow: auto; text-align: left; background: #000; font-size: .8rem; }
.install-box .form, .install-box .checks { text-align: left; }
.checks { list-style: none; padding: 0; }
.checks li { padding: .35rem 0; border-bottom: 1px solid var(--curb); }
.checks .ok { color: var(--green); }
.checks .ko { color: var(--red); }

@media (max-width: 600px) {
  .form-grid > .field-half { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
