/* Victory Caisse — application mobile pour les service centers. Une seule apparence (claire), couleurs Redeem. */
@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/PlusJakartaSans.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }

:root {
  --navy: #00076A; --navy-2: #1B237E; --green: #1F7A3A; --green-soft: #E7F3EA;
  --paper: #F4F6F5; --card: #FFFFFF; --ink: #00076A; --text: #33445E; --muted: #5B6B82;
  --line: #E3E8EE; --danger: #B3261E; --danger-soft: #FCE8E6; --amber-soft: #FDF0E6; --amber: #8A4B14;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  background: var(--navy); color: #fff; }
.topbar-title { flex: 1 1 auto; min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #9FD3AE;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255,255,255,.14);
  color: #fff; font-size: 18px; font-weight: 700; cursor: pointer; }
.icon-btn:focus-visible, .btn:focus-visible, .tile:focus-visible, .row-link:focus-visible { outline: 3px solid #9FD3AE; outline-offset: 2px; }

.app { max-width: 640px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 16px; }

/* Connexion */
.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 24px; padding-top: env(safe-area-inset-top, 0px); }
.auth-brand { display: flex; flex-direction: column; gap: 14px; }
.auth-brand img { height: 56px; width: auto; align-self: flex-start; }
.auth h1 { margin: 0; color: var(--ink); font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.auth p { margin: 0; color: var(--muted); }

.card { background: var(--card); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 1px 0 #DDE3EA; }
.card h2 { margin: 0; color: var(--ink); font-size: 18px; font-weight: 800; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; color: var(--ink); }
.field .hint { font-size: 13px; color: var(--muted); }
.input { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid #D5DCE5; background: #fff; color: var(--ink); font-size: 16px; }
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .grid-2 { grid-template-columns: 1fr; } }

.btn { min-height: 50px; padding: 0 20px; border-radius: 14px; border: 0; font-weight: 700; font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--green); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-block { width: 100%; }

.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--green-soft); color: #1F6B33; }
.alert-info { background: var(--amber-soft); color: var(--amber); }

/* Accueil */
.hello { display: flex; flex-direction: column; gap: 4px; }
.hello h1 { margin: 0; font-size: 26px; font-weight: 800; color: var(--ink); }
.hello p { margin: 0; color: var(--muted); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { position: relative; text-align: left; border: 0; cursor: pointer; background: var(--card); border-radius: var(--r); padding: 18px 16px;
  display: flex; flex-direction: column; gap: 6px; min-height: 112px; box-shadow: 0 1px 0 #DDE3EA; color: var(--ink); }
.tile b { font-size: 17px; font-weight: 800; }
.tile span { font-size: 13px; color: var(--muted); }
.tile .k { width: 36px; height: 36px; border-radius: 10px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.tile.soon { cursor: default; opacity: .62; }
.tile .badge { position: absolute; top: 12px; right: 12px; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.badge-green { background: var(--green-soft); color: #1F6B33; }
.badge-red { background: var(--danger-soft); color: var(--danger); }

/* Listes */
.search { display: flex; gap: 10px; }
.search .input { flex: 1 1 auto; min-width: 0; }
.list { display: flex; flex-direction: column; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: 0 1px 0 #DDE3EA; }
.row-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; width: 100%; color: var(--ink); }
.row-link:last-child { border-bottom: 0; }
.row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.row-main b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.copybox { display: flex; flex-direction: column; gap: 10px; }
.copybox code { display: block; padding: 12px; border-radius: 12px; background: var(--paper); color: var(--ink); font-size: 13px; overflow-wrap: anywhere; user-select: all; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 140px; }
.footer-note { text-align: center; font-size: 12px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50;
  max-width: calc(100% - 32px); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,7,106,.3); }
.noscript { padding: 24px; }
@media (prefers-reduced-motion: no-preference) { .card, .list, .tile { transition: transform .12s ease; } .tile:active:not(.soon) { transform: scale(.98); } }
.app-stack { display: flex; flex-direction: column; gap: 16px; }
.list .row-link .btn { min-height: 40px; padding: 0 12px; font-size: 14px; flex: none; }
