/*
  Customers Exchange – Portail client
  Version : 1.5.0 – 2026-11-22 (charte Fidag : couleurs, logo et typographie de dev.fidag-sa.ch)
  Auteur  : FRE (Fidag)

  Charte relevée sur dev.fidag-sa.ch :
    bleu Fidag   #0A168A  titres, boutons, logo
    bleu clair   #CAD5ED  aplats, pied de page, accents
    fond clair   #F7F9FC  zones d'information
    anthracite   #292A37  texte courant
    angles droits, boutons en capitales grasses
  Titres : Euclid Circular B si la police est fournie (licence Fidag), sinon Inter.
*/

/* Inter – SIL Open Font License 1.1 (assets/fonts/Inter-OFL.txt) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-700.woff2") format("woff2"); }

:root {
  --blue: #0a168a;
  --blue-dark: #070f63;
  --blue-200: #cad5ed;
  --blue-50: #f7f9fc;
  --ink: #292a37;
  --muted: #5c6075;
  --line: #cad5ed;
  --white: #ffffff;
  --ok: #1d7a4a;
  --ok-soft: #e3f2ea;
  --warn: #a8401a;
  --warn-soft: #fbece4;
  --danger: #b42318;
  --font-title: "Euclid Circular B", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; line-height: 1.55; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }

/* En-tête */
.topbar { background: var(--white); border-bottom: 1px solid var(--blue-200); }
.brand { max-width: 1040px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; gap: 16px; }
.brand-logo { display: block; color: var(--blue); line-height: 0; }
.brand-logo svg { width: 84px; height: auto; display: block; }
.brand-sep { width: 1px; height: 22px; background: var(--blue-200); }
.brand-sub { color: var(--blue); font-weight: 600; font-size: .95rem; letter-spacing: .01em; }
.lang { margin-left: auto; display: flex; border: 1px solid var(--blue); }
.lang button { font: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .06em; color: var(--blue); background: var(--white); border: 0; padding: 6px 11px; cursor: pointer; }
.lang button + button { border-left: 1px solid var(--blue); }
.lang button:hover { background: var(--blue-50); }
.lang button[aria-pressed="true"] { background: var(--blue); color: var(--white); }

/* Bandeau bleu clair derrière la carte */
.shell {
  flex: 1; width: 100%; display: flex; justify-content: center; align-items: flex-start;
  padding: 56px 20px 72px;
  background: linear-gradient(to bottom, var(--blue-200) 0, var(--blue-200) 180px, var(--white) 180px);
}

/* Carte : angles droits + petit carré décoratif en haut à gauche, comme sur le site Fidag */
.card {
  position: relative; width: 100%; max-width: 460px; background: var(--white);
  border: 1px solid var(--blue-200); padding: 40px 36px 36px;
  box-shadow: 0 18px 40px -24px rgba(10, 22, 138, .35);
}
.card::before {
  content: ""; position: absolute; top: -14px; left: -14px; width: 14px; height: 14px; background: var(--blue);
}
.card.wide { max-width: 660px; }
.view { animation: rise .2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 { font-family: var(--font-title); font-weight: 600; color: var(--blue); font-size: 1.75rem; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 12px; }
.eyebrow { margin: 0 0 10px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--blue); display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 8px; height: 8px; background: var(--blue-200); flex: none; }
.muted { color: var(--muted); margin: 0 0 24px; }
.hint { color: var(--muted); font-size: .85rem; margin: 16px 0 0; }
.center { text-align: center; }
.center.eyebrow, h1.center { justify-content: center; }

/* Formulaires */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 8px; color: var(--ink); }
input[type="email"], input[type="text"] {
  width: 100%; font: inherit; padding: 13px 14px; border: 1px solid #aab7d9; border-radius: 0;
  background: var(--white); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #9aa1b8; }
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 22, 138, .15); }
input[aria-invalid="true"] { border-color: var(--danger); }
.code-input { font-size: 1.7rem !important; letter-spacing: .55em; text-align: center; font-variant-numeric: tabular-nums; padding-left: .55em !important; font-weight: 600; color: var(--blue) !important; }
.field-error { color: var(--danger); font-size: .88rem; margin: 10px 0 0; }

/* Boutons : aplat bleu, capitales grasses, angles droits */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  margin-top: 22px; padding: 15px 18px; font: inherit; font-size: .9rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; border-radius: 0;
  border: 1px solid transparent; cursor: pointer; transition: background .15s, color .15s, opacity .15s;
}
.btn.primary { background: var(--blue); color: var(--white); }
.btn.primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn.secondary { background: var(--white); color: var(--blue); border-color: var(--blue); }
.btn.secondary:hover:not(:disabled) { background: var(--blue-50); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .link:focus-visible, .dropzone:focus-visible, .lang button:focus-visible { outline: 3px solid rgba(10, 22, 138, .35); outline-offset: 2px; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; margin: 0; border-color: rgba(255,255,255,.35); border-top-color: #fff; }

.row-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.link { background: none; border: 0; padding: 0; font: inherit; font-size: .9rem; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.link-like { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }

/* Faits */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: var(--blue-50); border: 1px solid var(--blue-200); margin: 0 0 24px; }
.facts div { padding: 12px 14px; }
.facts div + div { border-left: 1px solid var(--blue-200); }
.facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-weight: 600; color: var(--blue); font-variant-numeric: tabular-nums; }

/* Listes de fichiers */
.file-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--blue-200); max-height: 320px; overflow: auto; }
.file-list:empty { display: none; }
.file-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--blue-200); }
.file-list li:first-child { border-top: 0; }
.file-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .size { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.file-list .status { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
.file-list .status.ok { color: var(--ok); }
.file-list .status.err { color: var(--danger); }
.file-list .remove { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.15rem; line-height: 1; padding: 2px 4px; }
.file-list .remove:hover { color: var(--danger); }
.file-list.compact li { padding: 7px 14px; }
.progress { grid-column: 1 / -1; height: 4px; background: var(--blue-200); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.progress.ok > span { background: var(--ok); }
.progress.err > span { background: var(--danger); }

/* Zone de dépôt */
.dropzone {
  border: 2px dashed #aab7d9; padding: 30px 16px; text-align: center; cursor: pointer;
  background: var(--blue-50); margin-bottom: 18px; transition: border-color .15s, background .15s;
}
.dropzone p { margin: 4px 0; }
.dropzone.over { border-color: var(--blue); background: var(--blue-200); }
.dropzone.disabled { pointer-events: none; opacity: .5; }
.dz-icon { color: var(--blue); margin-bottom: 6px; }

/* États (pastilles carrées) */
.state-icon { width: 60px; height: 60px; display: grid; place-items: center; margin: 0 auto 18px; }
.state-icon.ok { background: var(--blue); color: var(--white); }
.state-icon.warn { background: var(--blue-200); color: var(--blue); }

.spinner { width: 28px; height: 28px; margin: 8px auto 12px; border: 3px solid var(--blue-200); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Pied de page bleu clair, comme le site Fidag */
.footer { background: var(--blue-200); color: var(--ink); }
.footer-inner { max-width: 1040px; margin: 0 auto; padding: 22px 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .82rem; }
.footer-logo { color: var(--blue); line-height: 0; }
.footer-logo svg { width: 56px; height: auto; display: block; }
.footer-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.footer a { color: var(--blue); }

/* Mode démo */
.demo-badge { position: fixed; bottom: 12px; right: 12px; background: var(--blue); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .04em; padding: 5px 10px; }

@media (max-width: 600px) {
  .brand { padding: 14px 16px; gap: 12px; }
  .brand-logo svg { width: 70px; }
  .brand-sep, .brand-sub { display: none; }
  .shell { padding: 36px 14px 48px; background: linear-gradient(to bottom, var(--blue-200) 0, var(--blue-200) 120px, var(--white) 120px); }
  .card { padding: 30px 22px 26px; }
  .card::before { top: -10px; left: -10px; width: 10px; height: 10px; }
  h1 { font-size: 1.45rem; }
  .facts { grid-template-columns: 1fr; }
  .facts div + div { border-left: 0; border-top: 1px solid var(--blue-200); }
  .footer-meta { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .view, .spinner { animation: none; }
}
