/* MPIE citizen surfaces: austere, serious, institutional design system.
   Loaded ONLY by the rebuilt citizen pages via the ad_* chrome partials; the
   officer console keeps app.css untouched. Self-contained: tokens, base, chrome
   and every citizen component. No framework, no build step. British English.

   Restraint over decoration: two weights, border-radius 0, one zero-blur shadow
   (the button edge), a muted palette on a dark slate chrome, green reserved as
   the single functional accent (actions, links, "compliant"), red reserved for
   enforcement and genuine error. The GOV.UK yellow focus block is always paired
   with a black companion. Tabular reference numbers. */

/* ============================================================================
   0. FONT  (Public Sans, self-hosted, OFL; Latin subset covers FR + EN glyphs)
   ============================================================================ */
@font-face {
  font-family: "Public Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/public-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/fonts/public-sans-700.woff2") format("woff2");
}

/* ============================================================================
   1. TOKENS  (palette -> role; templates read the role layer)
   ============================================================================ */
:root {
  color-scheme: light;

  /* -- palette -- */
  --c-green-900:#063d2b; --c-green-800:#0a5c42; --c-green-700:#0b6e4f;
  --c-green-100:#e6f2ec; --c-green-050:#f2f8f5;
  --c-gold-700:#8a6d1a;
  --c-red-700:#b30000;   --c-red-900:#8a1b0f;   --c-red-100:#f4cdc6;
  --c-amber-700:#5c4200; --c-amber-600:#946a00; --c-amber-100:#fdf3d2;
  --c-blue-700:#0c2d4a;  --c-blue-600:#1a65a6;  --c-blue-500:#0f385c; --c-blue-100:#d2e2f1;
  --c-orange-100:#ffe6d1;--c-orange-700:#8a3a00;--c-orange-600:#b5521a;
  --c-white:#ffffff; --c-grey-050:#f6f7f8; --c-grey-100:#eef0f2; --c-grey-200:#e2e5e8;
  --c-grey-300:#b1b4b6; --c-grey-500:#767676; --c-grey-600:#565c65; --c-grey-700:#4f565c;
  --c-ink:#14171a;
  --c-slate-900:#1d2024; --c-slate-800:#2b2f35; --c-slate-700:#3a3f47;
  --c-focus:#ffdd00; --c-focus-ink:#14171a;

  /* -- roles (the only layer components reference) -- */
  --role-page:var(--c-grey-050);
  --role-surface:var(--c-white);
  --role-surface-alt:var(--c-grey-100);
  --role-text:var(--c-ink);
  --role-text-2:var(--c-grey-700);
  --role-text-invert:var(--c-white);
  --role-border:var(--c-grey-300);
  --role-border-ui:var(--c-grey-500);
  --role-input-border:var(--c-ink);
  --role-header:var(--c-slate-900);
  --role-header-text:#eef1f4;
  --role-header-dim:rgba(238,241,244,.72);
  --role-primary:var(--c-green-700);
  --role-primary-hover:var(--c-green-800);
  --role-primary-edge:var(--c-green-900);
  --role-accent:var(--c-slate-800);
  --role-link:var(--c-green-700);
  --role-link-hover:var(--c-green-900);
  --role-link-visited:var(--c-green-800);
  --role-enforce:var(--c-red-700);
  --role-enforce-max:var(--c-red-900);
  --role-error:var(--c-red-700);
  --role-scrim:rgba(20,23,26,.55);

  /* -- type (Public Sans with a close system fallback; woff2 added as an asset) -- */
  --font-sans:"Public Sans",system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --fs-body:1.0625rem;  --lh-body:1.5rem;
  --fs-body-console:1rem; --lh-body-console:1.25rem;
  --fs-compact:.875rem; --lh-compact:1.25rem;
  --fs-small:.9375rem;  --lh-small:1.25rem;
  --fs-h3:1.25rem;  --lh-h3:1.5rem;
  --fs-h2:1.5rem;   --lh-h2:1.875rem;
  --fs-h1:1.875rem; --lh-h1:2.1875rem;
  --fw-regular:400; --fw-bold:700;

  /* -- spacing (one 5px base) -- */
  --sp-1:5px; --sp-2:10px; --sp-3:15px; --sp-4:20px; --sp-5:25px;
  --sp-6:30px; --sp-7:40px; --sp-8:50px; --sp-9:60px;

  /* -- borders / radius / shadow -- */
  --bw-hairline:1px; --bw-form:2px; --bw-focus:3px; --bw-accent:3px; --bw-gutter:5px;
  --radius:0; --radius-sm:2px;
  --shadow-btn:0 2px 0 var(--role-primary-edge);
  --focus-ring:0 -2px var(--c-focus), 0 4px var(--c-focus-ink);
  --focus-input:0 0 0 2px var(--c-ink) inset;

  /* -- layout -- */
  --page-max:1040px; --prose-measure:68ch; --header-h:60px;
}
@media (min-width:48em){
  :root{ --fs-h1:2.375rem; --lh-h1:2.75rem; --fs-h2:1.75rem; --lh-h2:2.1875rem; }
}

/* ============================================================================
   2. BASE
   ============================================================================ */
*{box-sizing:border-box;}
html{-webkit-text-size-adjust:100%; scroll-padding-top:calc(var(--header-h) + var(--sp-3));}
body{margin:0; background:var(--role-page); color:var(--role-text);
  font-family:var(--font-sans); font-size:var(--fs-body); line-height:var(--lh-body); font-weight:var(--fw-regular);}
h1,h2,h3,h4{margin:0 0 var(--sp-4); font-weight:var(--fw-bold); color:var(--role-text); line-height:1.15;}
h1{font-size:var(--fs-h1); line-height:var(--lh-h1); letter-spacing:-.01em;}
h2{font-size:var(--fs-h2); line-height:var(--lh-h2);}
h3{font-size:var(--fs-h3); line-height:var(--lh-h3);}
p{margin:0 0 var(--sp-4);}
p,li{max-width:var(--prose-measure);}
ul,ol{margin:0 0 var(--sp-4); padding-left:var(--sp-5);}
li{margin-bottom:var(--sp-1);}
strong,b{font-weight:var(--fw-bold);}
.num,.tabular{font-variant-numeric:tabular-nums slashed-zero;}
.imei{font-variant-numeric:tabular-nums slashed-zero; white-space:nowrap;}

a{color:var(--role-link); text-decoration:underline; text-decoration-thickness:max(1px,.0625rem); text-underline-offset:.1578em;}
a:visited{color:var(--role-link-visited);}
a:hover{color:var(--role-link-hover); text-decoration-thickness:max(3px,.1875rem); text-decoration-skip-ink:none;}
a:focus-visible{outline:3px solid transparent; color:var(--c-focus-ink); background:var(--c-focus); box-shadow:var(--focus-ring); text-decoration:none;}

.visually-hidden{position:absolute!important; width:1px; height:1px; margin:0; padding:0; border:0;
  overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap;}

.container{max-width:var(--page-max); margin:0 auto; padding:0 var(--sp-4);}
main{display:block; padding:var(--sp-7) 0 var(--sp-9);}
.lede{font-size:1.1875rem; line-height:1.75rem; color:var(--role-text); max-width:var(--prose-measure);}

.skip-link{position:absolute; left:var(--sp-2); top:var(--sp-2); z-index:200; transform:translateY(-250%);
  background:var(--c-focus); color:var(--c-focus-ink); padding:var(--sp-2) var(--sp-3); text-decoration:none; font-weight:var(--fw-bold);}
.skip-link:focus{transform:none; outline:var(--bw-focus) solid var(--c-focus-ink); outline-offset:0;}

/* ============================================================================
   3. CHROME  (dark institutional masthead + footer; no flag, no national motifs)
   ============================================================================ */
.siteheader{position:sticky; top:0; z-index:100; background:var(--role-header);
  color:var(--role-header-text); border-bottom:1px solid #0d1013;}
.masthead{display:flex; align-items:center; gap:var(--sp-3); flex-wrap:wrap;
  max-width:var(--page-max); margin:0 auto; min-height:var(--header-h); padding:var(--sp-2) var(--sp-4);}
.masthead__brand{display:flex; align-items:center; gap:var(--sp-3); color:var(--role-header-text); text-decoration:none;}
.masthead__brand:hover{color:var(--role-header-text); text-decoration:none;}
.masthead__brand:focus-visible{outline:var(--bw-focus) solid var(--c-focus); outline-offset:3px; background:none; box-shadow:none; color:var(--role-header-text);}
.masthead__mark{width:38px; height:34px; flex:none;}
.masthead__lockup{display:flex; flex-direction:column; justify-content:center;}
.masthead__wordmark{font-weight:var(--fw-bold); font-size:1.375rem; letter-spacing:.02em; line-height:1.1;}
.masthead__subline{font-size:var(--fs-small); line-height:1.2; color:var(--role-header-dim);}
.masthead__lang{margin-left:auto; display:flex; gap:2px; align-items:center;}
.masthead__lang a{color:var(--role-header-text); text-decoration:none; padding:var(--sp-1) var(--sp-2); font-weight:var(--fw-regular); border:1px solid transparent;}
.masthead__lang a[aria-current]{font-weight:var(--fw-bold); border-color:rgba(255,255,255,.35);}
.masthead__lang a:hover{text-decoration:underline; color:var(--role-header-text);}
.masthead__lang a:focus-visible{outline:none; background:var(--c-focus); color:var(--c-focus-ink); box-shadow:0 2px 0 var(--c-focus-ink); border-color:transparent;}

.ad-footer{border-top:var(--bw-accent) solid var(--role-header); background:var(--role-surface);
  margin-top:var(--sp-9); padding:var(--sp-6) 0; color:var(--role-text-2); font-size:var(--fs-small);}
.ad-footer .container{display:flex; flex-wrap:wrap; gap:var(--sp-2) var(--sp-5); align-items:baseline;}
.ad-footer a{color:var(--role-link);}
.ad-footer__spacer{margin-left:auto;}

/* ============================================================================
   4. BUTTONS
   ============================================================================ */
.btn{display:inline-block; box-sizing:border-box; position:relative; font-family:var(--font-sans);
  font-size:var(--fs-body); line-height:1.25rem; font-weight:var(--fw-bold);
  padding:9px 16px 8px; border:2px solid transparent; border-radius:0; cursor:pointer;
  width:100%; text-align:center; text-decoration:none;}
@media (min-width:40em){.btn{width:auto;}}
.btn--primary{background:var(--role-primary); color:var(--role-text-invert); box-shadow:var(--shadow-btn);}
.btn--primary:hover{background:var(--role-primary-hover); color:var(--role-text-invert); text-decoration:none;}
.btn--secondary{background:var(--role-surface); color:var(--role-text); border-color:var(--role-input-border); box-shadow:0 2px 0 var(--c-grey-500);}
.btn--secondary:hover{color:var(--role-text); text-decoration:none; background:var(--role-surface-alt);}
.btn--enforce{background:var(--role-enforce); color:var(--role-text-invert); box-shadow:0 2px 0 var(--c-red-900);}
/* A .btn is a control, not a prose link: pin its label colour across :link and
   :visited so the generic a:visited rule cannot repaint a button's text green
   once it has been clicked. */
.btn--primary:link,.btn--primary:visited,.btn--enforce:link,.btn--enforce:visited{color:var(--role-text-invert);}
.btn--secondary:link,.btn--secondary:visited{color:var(--role-text);}
.btn:active{top:2px; box-shadow:none;}
.btn:disabled,.btn[aria-disabled="true"]{opacity:.5; pointer-events:none;}
.btn:focus-visible{outline:3px solid transparent; background:var(--c-focus); color:var(--c-focus-ink); box-shadow:0 2px 0 var(--c-focus-ink);}

/* ============================================================================
   5. FORMS
   ============================================================================ */
.form-group{margin-bottom:var(--sp-5); max-width:none;}
.form-group--error{padding-left:var(--sp-3); border-left:var(--bw-gutter) solid var(--role-error);}
.label{display:block; font-weight:var(--fw-bold); margin-bottom:var(--sp-1); color:var(--role-text);}
.label--lg{font-size:var(--fs-h3); line-height:var(--lh-h3); margin-bottom:var(--sp-2);}
.hint{display:block; color:var(--role-text-2); margin-bottom:var(--sp-3); max-width:var(--prose-measure);}
.input{box-sizing:border-box; height:44px; width:100%; max-width:22em; padding:6px 10px; font-family:var(--font-sans);
  font-size:var(--fs-body); color:var(--role-text); background:var(--role-surface);
  border:var(--bw-form) solid var(--role-input-border); border-radius:0;}
textarea.input{height:auto; min-height:120px; max-width:42em; padding:8px 10px;}
select.input{max-width:28em;}
.input:focus-visible{outline:var(--bw-focus) solid var(--c-focus); outline-offset:0; box-shadow:var(--focus-input);}
.input--error{border-color:var(--role-error);}
.input--w-10{max-width:12em;} .input--w-5{max-width:6em;}
.error-message{display:block; font-weight:var(--fw-bold); color:var(--role-error); margin-bottom:var(--sp-2);}
.error-summary{border:var(--bw-form) solid var(--role-error); padding:var(--sp-4); margin-bottom:var(--sp-6);}
.error-summary:focus{outline:var(--bw-focus) solid var(--c-focus-ink); outline-offset:0;}
.error-summary__title{margin:0 0 var(--sp-3); font-size:var(--fs-h3); line-height:var(--lh-h3);}
.error-summary ul{margin:0; padding-left:var(--sp-5);}
.error-summary a{color:var(--role-error); font-weight:var(--fw-bold);}

/* ============================================================================
   6. STATUS TAGS  (colour never alone: label + distinct icon shape + treatment)
   ============================================================================ */
.tag{display:inline-flex; align-items:flex-start; gap:var(--sp-1); max-width:200px;
  font-size:var(--fs-body-console); font-weight:var(--fw-bold); line-height:1.25rem;
  padding:2px 8px 3px; border-radius:0; border:1px solid transparent; white-space:normal; overflow-wrap:break-word;}
.tag__icon{width:1em; height:1em; flex:none; margin-top:3px; fill:none; stroke:currentColor; stroke-width:1.8;}
.tag--conforme,.tag--paye,.tag--regularise,.tag--exempt,.tag--actif{color:#005a30; background:var(--c-green-100); border-color:#3a8a63;}
.tag--risque,.tag--du,.tag--nondeclare{color:var(--c-amber-700); background:var(--c-amber-100); border-color:var(--c-amber-600);}
.tag--declare,.tag--evalue,.tag--transmis,.tag--tourist{color:var(--c-blue-700); background:var(--c-blue-100); border-color:var(--c-blue-600);}
.tag--attente,.tag--attente-paiement{color:#594d00; background:#fff7bf; border-color:var(--c-amber-600);}
.tag--inactif,.tag--inconnu,.tag--annule{color:#282d30; background:var(--c-grey-200); border-color:var(--c-grey-500);}
.tag--signale,.tag--echec{color:#942514; background:var(--c-red-100); border-color:#d4351c;}
.tag--infraction,.tag--bloque{color:var(--role-text-invert); background:var(--role-enforce); border-color:var(--c-red-900);}
@media (forced-colors:active){.tag{font-weight:var(--fw-bold); border:1px solid;}}

/* ============================================================================
   7. SUMMARY LIST  (check-your-answers / duty breakdown / receipt)
   ============================================================================ */
.summary{display:table; width:100%; border-collapse:collapse; margin:0 0 var(--sp-5);}
.summary__row{display:table-row;}
.summary__key,.summary__val{display:table-cell; padding:var(--sp-2) var(--sp-4) var(--sp-2) 0;
  border-bottom:1px solid var(--role-border); vertical-align:top;}
.summary__key{width:40%; font-weight:var(--fw-bold);}
.summary__val{max-width:none;}
.summary__row--total .summary__key,.summary__row--total .summary__val{font-weight:var(--fw-bold); font-size:var(--fs-h3);}
/* Narrow screens: stack key over value so a long nowrap IMEI/amount never forces
   horizontal scroll at 320px. */
@media (max-width:30em){
  .summary,.summary__row,.summary__key,.summary__val{display:block; width:auto;}
  .summary__key{border-bottom:0; padding:var(--sp-2) 0 0;}
  .summary__val{padding:var(--sp-1) 0 var(--sp-3);}
}

/* ============================================================================
   8. NOTICE BANNER + WARNING TEXT
   ============================================================================ */
.notice-banner{border:var(--bw-gutter) solid var(--role-text); background:var(--role-surface); margin-bottom:var(--sp-6);}
.notice-banner:focus{outline:var(--bw-focus) solid var(--c-focus); outline-offset:0; box-shadow:var(--focus-input);}
.notice-banner__header{display:flex; align-items:center; gap:var(--sp-2); padding:var(--sp-2) var(--sp-4); background:var(--role-text); color:var(--role-text-invert);}
.notice-banner__icon{flex:none; width:1.25em; height:1.25em; fill:currentColor;}
.notice-banner__title{margin:0; font-size:var(--fs-body); line-height:var(--lh-body); font-weight:var(--fw-bold);}
.notice-banner__body{padding:var(--sp-3) var(--sp-4);}
.notice-banner__body>:first-child{margin-top:0;} .notice-banner__body>:last-child{margin-bottom:0;}
.notice-banner--success{border-color:var(--role-primary);} .notice-banner--success .notice-banner__header{background:var(--role-primary);}
.notice-banner--error{border-color:var(--role-error);} .notice-banner--error .notice-banner__header{background:var(--role-error);}
.notice-banner--info{border-color:var(--c-slate-800);} .notice-banner--info .notice-banner__header{background:var(--c-slate-800);}

.warning-text{display:flex; align-items:flex-start; gap:var(--sp-3); margin-bottom:var(--sp-6);}
.warning-text__icon{flex:none; box-sizing:border-box; width:35px; height:35px; border-radius:50%;
  background:var(--role-text); color:var(--role-text-invert); font-weight:var(--fw-bold); font-size:1.875rem; line-height:35px; text-align:center;}
.warning-text__text{margin:0; align-self:center; font-weight:var(--fw-bold);}

/* ============================================================================
   9. STEP INDICATOR
   ============================================================================ */
.steps{margin-bottom:var(--sp-6);}
.steps__state{font-size:var(--fs-body-console); color:var(--role-text-2);}
.steps__title{font-size:var(--fs-h3); line-height:var(--lh-h3); font-weight:var(--fw-bold); margin:var(--sp-1) 0 var(--sp-3);}
.steps__bar{display:flex; gap:var(--sp-1); height:8px; max-width:30em;}
.steps__bar>span{flex:1; background:var(--role-surface-alt);}
.steps__bar>span[data-done]{background:var(--role-primary-edge);}
.steps__bar>span[data-current]{background:var(--role-primary);}

/* ============================================================================
   10. RESULT PANEL  (lookup outcome)
   ============================================================================ */
.result{border:var(--bw-hairline) solid var(--role-border); background:var(--role-surface);
  padding:var(--sp-5); margin-bottom:var(--sp-6);}
.result--cleared{border-left:var(--bw-gutter) solid var(--role-primary);}
.result--pending{border-left:var(--bw-gutter) solid var(--c-amber-600);}
.result--breach{border-left:var(--bw-gutter) solid var(--role-enforce);}
.result--unknown{border-left:var(--bw-gutter) solid var(--role-border-ui);}
.result__head{display:flex; flex-wrap:wrap; align-items:baseline; gap:var(--sp-1) var(--sp-3); margin-bottom:var(--sp-3);}
.result__model{font-size:var(--fs-h3); line-height:var(--lh-h3); font-weight:var(--fw-bold); margin:0;}
.result__note{font-weight:var(--fw-bold); margin:var(--sp-3) 0 0;}
.result__actions{margin-top:var(--sp-4);}
.result__actions .hint{margin:var(--sp-2) 0 0;}

/* ============================================================================
   11. PAYMENT-METHOD SELECTOR  (PCI SAQ A: no card field, ever)
   ============================================================================ */
.pay-fieldset{border:0; margin:0 0 var(--sp-6); padding:0; max-width:36em;}
.pay-fieldset>legend{padding:0;}
.pay-option{position:relative; border:var(--bw-form) solid var(--role-input-border); background:var(--role-surface); margin-bottom:var(--sp-3);}
.pay-option__input{position:absolute; top:50%; left:var(--sp-3); width:24px; height:24px; margin:0; transform:translateY(-50%); accent-color:var(--role-primary);}
.pay-option__label{display:flex; align-items:center; gap:var(--sp-3); min-height:48px; padding:var(--sp-3) var(--sp-3) var(--sp-3) 44px; cursor:pointer;}
.pay-option__text{display:flex; flex-direction:column;}
.pay-option__name{font-weight:var(--fw-regular);}
.pay-option__hint{font-size:var(--fs-small); color:var(--role-text-2);}
.pay-option__input:checked+.pay-option__label{box-shadow:inset 0 0 0 var(--bw-form) var(--role-primary);}
.pay-option__input:checked+.pay-option__label .pay-option__name{font-weight:var(--fw-bold);}
.pay-option__input:focus-visible+.pay-option__label{outline:var(--bw-focus) solid var(--c-focus); outline-offset:0; box-shadow:var(--focus-input);}

/* ============================================================================
   12. PAGE LAYOUT HELPERS  (used by home + lookup + declare + pay)
   ============================================================================ */
.page-head{margin-bottom:var(--sp-6);}
.cols{display:grid; grid-template-columns:1fr; gap:var(--sp-6); align-items:start;}
@media (min-width:52em){.cols{grid-template-columns:minmax(0,1fr) minmax(0,21em);}}
.panel{border:1px solid var(--role-border); background:var(--role-surface); padding:var(--sp-5);}
.panel>:last-child{margin-bottom:0;}
.panel h2{font-size:var(--fs-h3); line-height:var(--lh-h3); margin-bottom:var(--sp-4);}
.aside{border:1px solid var(--role-border); border-top:var(--bw-accent) solid var(--role-accent); background:var(--role-surface); padding:var(--sp-4) var(--sp-5);}
.aside h2{font-size:var(--fs-body); line-height:var(--lh-body); margin-bottom:var(--sp-3);}
.help-list{list-style:none; margin:0; padding:0;}
.help-list li{display:flex; gap:var(--sp-2); align-items:baseline; margin-bottom:var(--sp-3); max-width:none; color:var(--role-text-2);}
.help-list li:last-child{margin-bottom:0;}
.help-list .dot{flex:none; width:8px; height:8px; margin-top:6px; background:var(--role-accent);}

/* ---- home ---- */
.intro{margin-bottom:var(--sp-7);}
.tasks{display:grid; grid-template-columns:1fr; gap:var(--sp-4); margin-bottom:var(--sp-8);}
@media (min-width:48em){.tasks{grid-template-columns:repeat(3,1fr);}}
.task-card{display:flex; flex-direction:column; border:1px solid var(--role-border);
  border-top:var(--bw-accent) solid var(--role-accent); background:var(--role-surface); padding:var(--sp-5);}
.task-card h2{font-size:var(--fs-h3); line-height:var(--lh-h3); margin-bottom:var(--sp-2);}
.task-card p{color:var(--role-text-2); flex:1 1 auto; max-width:none;}
.task-card .btn{margin-top:var(--sp-4);}

.section-label{font-size:var(--fs-h3); line-height:var(--lh-h3); margin-bottom:var(--sp-4);
  padding-bottom:var(--sp-2); border-bottom:2px solid var(--role-border);}
.features{display:grid; grid-template-columns:1fr; gap:var(--sp-4); margin-bottom:var(--sp-7);}
@media (min-width:40em){.features{grid-template-columns:repeat(2,1fr);}}
@media (min-width:60em){.features{grid-template-columns:repeat(3,1fr);}}
.feature{border:1px solid var(--role-border); background:var(--role-surface); padding:var(--sp-4) var(--sp-5);}
.feature h3{font-size:var(--fs-body); line-height:var(--lh-body); margin-bottom:var(--sp-1);}
.feature p{color:var(--role-text-2); margin:0;}
