/* ============================================================
   MindLab GC Power Pages Accelerator — core stylesheet
   Aligned to the Government of Canada Design System (Canada.ca / GCWeb)
   WCAG 2.1 / 2.2 AA. All colours verified for ≥4.5:1 text contrast.
   In Power Pages this file is uploaded as a Web File and linked in the
   site header. Tokenised so departments can re-theme without editing rules.
   ============================================================ */

:root{
  /* GC palette (Canada.ca) */
  --gc-red:#af3c43;          /* signature / accent rule */
  --gc-text:#333333;         /* body text — 12.6:1 on white */
  --gc-link:#284162;         /* default link — 9.7:1 on white */
  --gc-link-hover:#0535d2;   /* hover — AA on white */
  --gc-link-visited:#7834bc;
  --gc-btn:#26374a;          /* primary button bg — 10.9:1 with #fff */
  --gc-btn-hover:#1c578a;
  --gc-footer:#26374a;       /* footer band */
  --gc-band:#f8f8f8;         /* light utility band */
  --gc-border:#cccccc;
  --gc-danger:#d3080c;       /* error — 5.9:1 on white */
  --gc-danger-bg:#f3e9e8;
  --gc-success:#278400;      /* 4.6:1 on white */
  --gc-focus:#0535d2;        /* focus ring */
  --gc-focus-bg:#ffbf47;     /* high-vis focus fill (WET style) */
  --maxw:1140px;
  --fh:'Lato', 'Segoe UI', Arial, sans-serif;   /* headings */
  --fb:'Noto Sans', 'Segoe UI', Arial, sans-serif; /* body */
}

*{box-sizing:border-box}
html{font-size:100%}
body{
  margin:0;font-family:var(--fb);color:var(--gc-text);
  background:#fff;line-height:1.6;font-size:1rem;
}
h1,h2,h3,h4{font-family:var(--fh);color:#333;line-height:1.3;font-weight:700}
h1{font-size:2.07rem;border-bottom:4px solid var(--gc-red);padding-bottom:.4rem;margin:0 0 1.2rem}
h2{font-size:1.59rem;margin:2rem 0 .8rem}
h3{font-size:1.26rem;margin:1.4rem 0 .5rem}
p{margin:0 0 1rem;max-width:70ch}

a{color:var(--gc-link);text-decoration:underline}
a:hover{color:var(--gc-link-hover)}
a:visited{color:var(--gc-link-visited)}

/* ---- Visible keyboard focus everywhere (WCAG 2.4.7 / 2.4.11) ---- */
a:focus,button:focus,input:focus,select:focus,textarea:focus,[tabindex]:focus{
  outline:3px solid var(--gc-focus);
  outline-offset:1px;
  background-color:var(--gc-focus-bg);
  color:#000;
}
input:focus,select:focus,textarea:focus{background-color:#fff} /* keep fields white */

/* ---- Skip link (WCAG 2.4.1) ---- */
.skip-link{
  position:absolute;left:-999px;top:0;z-index:100;
  background:#fff;color:var(--gc-link);padding:.6rem 1rem;border:2px solid var(--gc-link);
}
.skip-link:focus{left:.5rem;top:.5rem}

.container{max-width:var(--maxw);margin:0 auto;padding:0 1rem}

/* ===================== Header ===================== */
.gc-header{border-bottom:1px solid var(--gc-border)}
.gc-header-top{background:#fff}
.gc-header-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem;max-width:var(--maxw);margin:0 auto;flex-wrap:wrap}
.gc-signature{font-family:var(--fh);font-weight:700;color:#333;display:flex;align-items:center;gap:.6rem}
.gc-signature .placeholder{
  border:1px dashed #999;padding:.35rem .6rem;font-size:.8rem;color:#666;background:#fafafa;font-family:var(--fb)
}
.gc-lang{font-size:.95rem}
.gc-lang a{font-weight:700}

/* ===================== Breadcrumb ===================== */
.gc-breadcrumb{background:var(--gc-band);border-bottom:1px solid var(--gc-border)}
.gc-breadcrumb ol{max-width:var(--maxw);margin:0 auto;padding:.6rem 1rem;list-style:none;display:flex;flex-wrap:wrap;gap:.4rem;font-size:.9rem}
.gc-breadcrumb li:not(:last-child)::after{content:"›";margin-left:.4rem;color:#666}

/* ===================== Main ===================== */
main{padding:2rem 0 3rem}
.lead{font-size:1.15rem;color:#555;max-width:70ch}

/* ===================== Forms ===================== */
.form-card{max-width:46rem}
fieldset{border:0;margin:0 0 1.5rem;padding:0}
legend{font-family:var(--fh);font-size:1.26rem;font-weight:700;padding:0;margin:1.6rem 0 .8rem}
.form-group{margin-bottom:1.4rem}
label.field-label{display:block;font-weight:700;margin-bottom:.3rem}
.required-tag{color:var(--gc-danger);font-weight:400;font-size:.85rem;margin-left:.25rem}
.hint{display:block;color:#5c5c5c;font-size:.9rem;margin-bottom:.4rem}
input[type=text],input[type=email],input[type=tel],select,textarea{
  width:100%;max-width:34rem;padding:.55rem .6rem;font-size:1rem;font-family:var(--fb);
  border:2px solid #555;border-radius:2px;background:#fff;color:var(--gc-text)
}
textarea{min-height:7rem;resize:vertical}
input[aria-invalid="true"],select[aria-invalid="true"],textarea[aria-invalid="true"]{
  border-color:var(--gc-danger);box-shadow:inset 0 0 0 1px var(--gc-danger)
}
.field-error{display:block;color:var(--gc-danger);font-weight:700;margin-top:.35rem}
.field-error::before{content:"⚠ "}

/* ---- Error summary (WET pattern; WCAG 3.3.1 / 3.3.3) ---- */
.error-summary{
  border:2px solid var(--gc-danger);background:var(--gc-danger-bg);
  padding:1rem 1.2rem;margin:0 0 1.6rem;max-width:46rem
}
.error-summary h2{margin:.2rem 0 .6rem;color:var(--gc-danger);font-size:1.2rem}
.error-summary ol{margin:0;padding-left:1.2rem}
.error-summary a{color:var(--gc-danger);font-weight:700}
.error-summary[hidden]{display:none}

/* ===================== Buttons ===================== */
.btn{
  display:inline-flex;align-items:center;gap:.5rem;font-family:var(--fb);font-weight:700;
  font-size:1rem;padding:.6rem 1.4rem;border-radius:3px;border:2px solid transparent;
  cursor:pointer;text-decoration:none;line-height:1.2
}
.btn-primary{background:var(--gc-btn);color:#fff}
.btn-primary:hover{background:var(--gc-btn-hover);color:#fff}
.btn-secondary{background:#fff;color:var(--gc-btn);border-color:var(--gc-btn)}
.btn-secondary:hover{background:#f0f0f0}

/* ===================== File upload ===================== */
.upload{border:2px dashed #888;border-radius:4px;padding:1.2rem;max-width:34rem;background:#fcfcfc}
.upload.is-drag{border-color:var(--gc-link);background:#eef3f8}
.upload__row{display:flex;align-items:center;gap:1rem;flex-wrap:wrap}
.upload__list{list-style:none;margin:1rem 0 0;padding:0}
.upload__item{display:flex;align-items:center;justify-content:space-between;gap:1rem;
  padding:.5rem .7rem;border:1px solid var(--gc-border);border-radius:3px;margin-bottom:.5rem;background:#fff}
.upload__item .name{font-weight:700;word-break:break-all}
.upload__item .meta{font-size:.85rem;color:#666}
.upload__progress{height:.6rem;background:#e0e0e0;border-radius:3px;overflow:hidden;margin-top:.35rem}
.upload__bar{height:100%;width:0;background:var(--gc-btn);transition:width .15s linear}
.upload__status{margin-top:.4rem;font-weight:700}
.upload__status.ok{color:var(--gc-success)}
.upload__status.err{color:var(--gc-danger)}
.link-btn{background:none;border:0;color:var(--gc-link);text-decoration:underline;cursor:pointer;font-size:.9rem;padding:.2rem}

/* ===================== Footer ===================== */
.gc-footer{margin-top:3rem}
.gc-footer__main{background:var(--gc-footer);color:#fff;padding:2rem 0}
.gc-footer__main a{color:#fff}
.gc-footer__grid{max-width:var(--maxw);margin:0 auto;padding:0 1rem;display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:1rem}
.gc-footer__sub{background:var(--gc-band);padding:1.2rem 0}
.gc-footer__sub .container{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:1rem}
.gc-wordmark-placeholder{border:1px dashed #999;padding:.4rem .7rem;font-size:.8rem;color:#666;background:#fff}

/* ===================== Utility ===================== */
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.notice{border-left:4px solid var(--gc-link);background:var(--gc-band);padding:.8rem 1rem;margin:1.2rem 0;max-width:60rem}

@media (max-width:600px){
  h1{font-size:1.7rem}
  .gc-header-row{flex-direction:column;align-items:flex-start}
}

/* Respect reduced-motion (WCAG 2.3.3) */
@media (prefers-reduced-motion:reduce){
  *{transition:none!important;animation:none!important;scroll-behavior:auto!important}
}
