/* The portal's styles: the Pegovio Brand design system applied to the shell. Every value is a token from brand-tokens.css. */

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  font-weight: var(--type-body-weight);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* Skip link: off screen until focused. */
.skip { position: absolute; left: -999px; top: var(--space-2); }
.skip:focus { left: var(--space-2); z-index: 1; padding: var(--space-2) var(--space-4); background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }

/* Header band: the one emerald fill, carrying the all-white one-ink wordmark (the two-ink reversed file's emerald dial would vanish on emerald) and the account navigation in on-emerald. */
.band { background: var(--emerald); color: var(--on-emerald); }
.band-inner { max-width: 72rem; margin: 0 auto; padding: var(--space-5) var(--space-6); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4) var(--space-6); }
.band .brand { display: block; line-height: 0; }
/* The wordmark is 128px wide (96px is the minimum); the band padding is more than the height of its o on every side. */
.band .brand img { display: block; width: 128px; height: auto; }
.band nav ul { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-5); margin: 0; padding: 0; font-size: var(--type-body-sm-size); line-height: var(--type-body-sm-line); }
.band a { color: var(--on-emerald); }
/* The emerald-text focus ring is too close to the emerald band to read there, so the ring on the band is on-emerald. */
.band a:focus-visible { outline-color: var(--on-emerald); }

/* Page content. */
main { max-width: 72rem; margin: 0 auto; padding: var(--space-7) var(--space-6); }
main:focus { outline: none; }
main > * { max-width: 68ch; }
main > table, main > form, main > dl { max-width: 100%; }

h1, h2, h3 { text-wrap: balance; margin: 0; }
h1 { font-family: var(--font-display); font-size: var(--type-heading-1-size); line-height: var(--type-heading-1-line); font-weight: var(--type-heading-1-weight); margin-bottom: var(--space-5); }
h2 { font-size: var(--type-heading-2-size); line-height: var(--type-heading-2-line); font-weight: var(--type-heading-2-weight); margin: var(--space-7) 0 var(--space-4); }
h3 { font-size: var(--type-heading-3-size); line-height: var(--type-heading-3-line); font-weight: var(--type-heading-3-weight); }
p { margin: 0 0 var(--space-3); }
h1:focus { outline: none; }

/* Links: emerald-text, always underlined. */
a { color: var(--emerald-text); text-decoration: underline; text-underline-offset: 3px; transition: color 120ms; }
a:hover { text-decoration-thickness: 2px; }

/* Focus: a solid 2px ring offset 2px on every interactive element. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Tables: square, surface, hairlines, a sunken label row. */
table { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-none); }
caption { text-align: left; padding: var(--space-3) var(--space-4); font-size: var(--type-heading-3-size); line-height: var(--type-heading-3-line); font-weight: var(--type-heading-3-weight); caption-side: top; background: var(--surface); border-bottom: 1px solid var(--line); }
th, td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); font-size: var(--type-body-sm-size); line-height: var(--type-body-sm-line); }
thead th { background: var(--surface-sunken); color: var(--ink-muted); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: var(--type-label-weight); letter-spacing: var(--type-label-tracking); text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }

/* Codes, ids and numbers: IBM Plex Mono with tabular figures. */
.data { font-family: var(--font-mono); font-size: var(--type-data-size); line-height: var(--type-data-line); font-weight: var(--type-data-weight); font-variant-numeric: tabular-nums; }

/* Definition lists: a panel of label and value pairs. */
dl { display: grid; grid-template-columns: max-content 1fr; margin: 0 0 var(--space-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-none); }
dt, dd { margin: 0; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); }
dt { color: var(--ink-muted); font-size: var(--type-label-size); line-height: var(--type-label-line); font-weight: var(--type-label-weight); letter-spacing: var(--type-label-tracking); text-transform: uppercase; padding-top: calc(var(--space-3) + 2px); }
dl > :nth-last-child(-n+2) { border-bottom: 0; }

/* Forms. */
form { margin: 0 0 var(--space-5); }
fieldset { margin: 0 0 var(--space-5); padding: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-none); }
legend { padding: 0 var(--space-2); font-size: var(--type-heading-3-size); line-height: var(--type-heading-3-line); font-weight: var(--type-heading-3-weight); }
fieldset p { display: flex; gap: var(--space-2); align-items: baseline; margin: 0 0 var(--space-3); }
fieldset p:last-child { margin-bottom: 0; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--emerald); }
input[type="text"], input[type="email"], select, textarea { font: inherit; padding: var(--space-2) var(--space-3); color: var(--ink); background: var(--surface-sunken); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }

/* Buttons: secondary by default, primary for the one committing action per view. */
button, .button { font-family: var(--font-sans); font-size: 14px; font-weight: 600; line-height: 20px; height: 36px; padding: 0 var(--space-4); border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; transition: background-color 120ms, color 120ms, border-color 120ms; }
button:hover { background: var(--surface-sunken); }
button.primary { background: var(--emerald); border-color: var(--emerald); color: var(--on-emerald); }
button.primary:hover { background: var(--ink); border-color: var(--ink); }
button:disabled { background: var(--surface-sunken); border-color: var(--surface-sunken); color: var(--ink-muted); cursor: not-allowed; }

/* A refusal or note: the one callout ground, ink text. It is not a status colour. */
[role="alert"] { background: var(--emerald-tint); color: var(--ink); border-left: 4px solid var(--emerald); padding: var(--space-3) var(--space-4); }

@media (prefers-reduced-motion: reduce) {
  a, button { transition: none; }
}

@media (max-width: 40rem) {
  .band-inner, main { padding-left: var(--space-4); padding-right: var(--space-4); }
  main { padding-top: var(--space-5); }
  dl { grid-template-columns: 1fr; }
  dt { border-bottom: 0; padding-bottom: 0; }
}
