/* Franchetti Portal. Every colour comes from the tokens below (shown on the Design guide page).
   Indigo = you can press it. Selvedge red = the thread: where you are, how far you have come. */
@font-face { font-family: "Sofia Sans"; src: url(../fonts/sofia-sans.woff2) format("woff2"); font-weight: 300 800; font-display: swap; }
@font-face { font-family: "Sofia Sans Condensed"; src: url(../fonts/sofia-sans-condensed.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }
:root {
  --ink: #100c08; --navy: #1a2c3c; --indigo: #2f5d8c; --thread: #c8283c; --chalk: #d5dee4; --cotton: #f3f6f7; --white: #fff;
  --ink-2: #52606b; --indigo-deep: #244a71; --navy-2: #243a4d; --navy-line: #31475a; --on-navy: #f3f6f7; --on-navy-2: #a9bac7; --basting: #93a5b2;
  --good: #24674a; --warn: #8a4b00;
  --text: "Sofia Sans", system-ui, sans-serif; --display: "Sofia Sans Condensed", "Arial Narrow", sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--cotton); color: var(--ink); font: 400 1rem/1.5 var(--text); }
h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.08; margin: 0; text-wrap: balance; }
h1 { font-size: 2.5rem; letter-spacing: -.015em; }
h2 { font-size: 1.5rem; }
p { margin: 0; }
a { color: var(--indigo); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.btn { background: var(--indigo); color: var(--white); border: 0; border-radius: 4px; padding: .8rem 1.25rem; font-weight: 600; }
.btn:hover { background: var(--indigo-deep); }

/* Sign-in */
.login { position: relative; min-height: 100svh; background: var(--navy); color: var(--on-navy); display: grid; grid-template-columns: 1fr minmax(360px, 440px); overflow: hidden; }
#cloth { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-brand { position: relative; pointer-events: none; display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(24px, 4vw, 56px); }
.login-brand h1 { font-size: clamp(1.375rem, 2.3vw, 2.125rem); text-shadow: 0 2px 24px rgba(16, 30, 43, .75); }
.login-panel { position: relative; background: var(--white); color: var(--ink); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: clamp(24px, 3vw, 44px); border-left: 4px solid var(--thread); }
.login-panel .top { display: flex; justify-content: space-between; align-items: center; }
.login-panel .top img { width: 132px; filter: invert(1); }
.lang a { padding: .4rem .5rem; color: var(--ink-2); text-decoration: none; }
.lang a[aria-current] { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 5px; }
.login form { display: grid; gap: 20px; }
.login label small { font-weight: 400; font-size: .875rem; }
.login h2 + p { margin-top: 8px; overflow-wrap: anywhere; }
.login label { display: grid; gap: 6px; font-weight: 600; }
.login input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid #8496a3; border-radius: 4px; background: var(--white); font-weight: 400; }
.pass { position: relative; display: block; margin-top: 6px; }
.pass input { padding-right: 76px; }
.pass button { position: absolute; right: 5px; top: 5px; height: 40px; padding: 0 12px; border: 0; background: none; color: var(--indigo); font-weight: 600; }
.problem { color: var(--warn); font-weight: 600; }

/* Shell: the same parts and places as ITGATE (header, menu, tabs, page) */
.shell { min-height: 100svh; display: grid; grid-template: 64px 1fr / 232px minmax(0, 1fr); }
.head { grid-column: 1 / -1; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 0 24px; background: var(--navy); color: var(--on-navy); }
.head img { height: 38px; display: block; }
.head .push { margin-left: auto; }
.head button { background: none; color: var(--on-navy); border: 1px solid var(--navy-line); border-radius: 4px; padding: .4rem .8rem; white-space: nowrap; }
.head button:hover { border-color: var(--on-navy-2); }
.head kbd { font: inherit; color: var(--on-navy-2); margin-left: 12px; }
.head :focus-visible, .side :focus-visible, .band :focus-visible { outline-color: var(--white); }
.head .who { line-height: 1.2; text-align: right; color: inherit; text-decoration: none; }
.head .who:hover { text-decoration: underline; }
.head .who small { color: var(--on-navy-2); display: block; font-size: .875rem; }
#burger { display: none; }
.side { background: var(--navy); color: var(--on-navy); padding: 16px 12px; }
.side-in { position: sticky; top: 80px; }
#filter { width: 100%; background: var(--navy-2); border: 1px solid var(--navy-line); border-radius: 4px; padding: .5rem .7rem; color: inherit; }
#filter::placeholder { color: var(--on-navy-2); }
#menu div { margin-top: 18px; }
#menu details { margin-top: 12px; }
#menu summary { display: flex; align-items: center; justify-content: space-between; padding: .45rem 12px; color: var(--on-navy-2); cursor: pointer; list-style: none; }
#menu summary::-webkit-details-marker { display: none; }
#menu summary::after { content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; }
#menu details[open] > summary::after { transform: rotate(45deg); }
#menu summary:hover { color: var(--on-navy); }
#menu a { display: block; padding: .5rem 12px; color: var(--on-navy); text-decoration: none; border-left: 3px solid transparent; }
#menu a:hover { background: var(--navy-2); }
#menu a[aria-current] { border-color: var(--thread); font-weight: 700; background: var(--navy-2); }
#scrim { display: none; }
main { min-width: 0; }
.shell > main { display: flex; flex-direction: column; }
.made-by { color: var(--ink-2); font-size: .875rem; }
.shell .made-by { margin-top: auto; padding: 16px clamp(16px, 3vw, 40px); border-top: 1px solid var(--chalk); }
.login .made-by { margin-top: -20px; }
.login-panel > :nth-child(2) { margin-block: auto; }
#tabs { display: flex; gap: 4px; padding: 8px 24px 0; border-bottom: 1px solid var(--chalk); overflow-x: auto; min-height: 47px; }
.tab { display: flex; align-items: center; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab a { padding: .45rem .7rem; color: var(--ink-2); text-decoration: none; }
.tab.on { border-color: var(--thread); }
.tab.on a { color: var(--ink); font-weight: 700; }
.tab button { border: 0; background: none; color: var(--ink-2); padding: .3rem; min-width: 26px; line-height: 1; }
.tab .pin { margin-left: -6px; }
.tab svg { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.tab .pin[aria-pressed="true"] { color: var(--indigo); }
.tab .pin[aria-pressed="true"] svg { fill: currentColor; }
.tab button:hover { color: var(--indigo); }
.page { width: 100%; padding: 32px clamp(16px, 3vw, 40px) 64px; max-width: 1280px; }
.page > * + * { margin-top: 40px; }
.page-head p { margin-top: 6px; color: var(--ink-2); max-width: 64ch; }

#search { border: 0; border-radius: 6px; padding: 0; width: min(520px, 92vw); margin-top: 14vh; box-shadow: 0 24px 64px rgba(16, 30, 43, .4); }
#search::backdrop { background: rgba(16, 30, 43, .55); }
#search-input { width: 100%; border: 0; border-bottom: 1px solid var(--chalk); padding: 1rem 1.25rem; font-size: 1.125rem; outline-offset: -3px; }
#search-list { list-style: none; margin: 0; padding: 8px; }
#search-list a { display: block; padding: .6rem .75rem; color: var(--ink); text-decoration: none; border-radius: 4px; }
#search-list a:hover, #search-list a:focus { background: var(--cotton); }
#search-none { padding: 0 1.25rem 1.25rem; }

/* Overview: the rail */
.band { background: linear-gradient(#22384b, var(--navy)); color: var(--on-navy); border-radius: 6px; overflow: hidden; }
.band header { padding: 28px 32px 0; }
.band header p { color: var(--on-navy-2); margin-top: 6px; }
#rail { display: block; width: 100%; aspect-ratio: 4.2; }
.concepts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.concepts button { background: none; border: 0; border-top: 3px solid transparent; padding: 12px 6px 16px; font-weight: 600; line-height: 1.2; }
.concepts small { display: block; font-weight: 400; font-size: .875rem; color: var(--on-navy-2); margin-top: 2px; }
.concepts button:hover { background: var(--navy-2); }
.concepts button[aria-pressed="true"] { border-color: var(--thread); }
.concepts button:focus-visible { outline-offset: -4px; }
#concept-said { padding: 14px 32px 18px; border-top: 1px solid var(--navy-line); color: var(--on-navy-2); }

/* The four steps, joined by a basting stitch. A finished step will turn into the red thread. */
.steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps li { position: relative; padding: 28px 24px 0 0; }
.steps li::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; border-top: 2px dashed var(--basting); }
.steps li::after { content: ""; position: absolute; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--cotton); border: 2px solid var(--basting); }
.steps li:last-child::before { display: none; }
.steps b { font: 700 1.25rem/1.2 var(--display); }

.table { overflow-x: auto; background: var(--white); border: 1px solid var(--chalk); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--chalk); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
.ok { color: var(--good); font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }
section > h2 + .table { margin-top: 16px; }

/* Forms */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.narrow { max-width: 560px; }
.form { display: grid; gap: 18px; justify-items: start; }
.form > label:not(.tick), .form > fieldset, .form > .link-result { display: grid; gap: 6px; width: 100%; font-weight: 600; }
.form > fieldset.form { gap: 10px; }
.form small { font-weight: 400; font-size: .875rem; }
.form input:not([type="checkbox"]), .form select, .copy input { width: 100%; height: 46px; padding: 0 12px; border: 1px solid #8496a3; border-radius: 4px; background: var(--white); font: 400 1rem var(--text); color: var(--ink); }
.tick { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.tick input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--indigo); flex: none; }
.tick small { display: block; }
section > .form, section > form, .after { margin-top: 18px; }
.btn-quiet { background: none; border: 1px solid #8496a3; border-radius: 4px; padding: .75rem 1.1rem; font-weight: 600; color: var(--indigo); }
.btn-quiet:hover { border-color: var(--indigo); }
.btn:disabled { opacity: .6; cursor: progress; }
fieldset:disabled .btn { display: none; }
.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.one-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.copy { display: flex; gap: 8px; margin-top: 12px; }
.copy .btn { white-space: nowrap; }
.done { color: var(--good); font-weight: 600; }
.page > .done + * { margin-top: 16px; }

/* Wizard. The thread runs through the finished steps. */
.modal { border: 0; border-radius: 6px; padding: 0; width: min(600px, 94vw); max-height: 92vh; color: var(--ink); box-shadow: 0 24px 64px rgba(16, 30, 43, .4); }
.modal::backdrop { background: rgba(16, 30, 43, .55); }
.modal form { padding: 28px; display: grid; gap: 24px; }
.wiz-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wiz-steps li { border-top: 3px dashed var(--basting); padding-top: 8px; color: var(--ink-2); line-height: 1.25; }
.wiz-steps li[aria-current], .wiz-steps .past { border-top: 3px solid var(--thread); }
.wiz-steps li[aria-current] { color: var(--ink); font-weight: 700; }
.wiz-foot { display: flex; gap: 10px; }
.wiz-foot .push { margin-left: auto; }
#wiz-summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; margin: 0; }
#wiz-summary dt { color: var(--ink-2); }
#wiz-summary dd { margin: 0; overflow-wrap: anywhere; }

/* Permissions */
.matrix thead th { color: var(--ink); }
.matrix small { display: block; font-weight: 400; font-size: .875rem; color: var(--ink-2); }
.matrix tbody th { color: var(--ink); white-space: normal; min-width: 160px; }
.matrix th.group { background: var(--cotton); font: 700 1.125rem/1.2 var(--display); }
.matrix td .tick { gap: 8px; white-space: nowrap; }
.matrix td .tick + .tick { margin-top: 2px; }

/* Design guide */
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; margin: 16px 0 0; padding: 0; list-style: none; }
.palette svg { display: block; width: 100%; height: 96px; border: 1px solid var(--chalk); }
.palette b { display: block; margin-top: 8px; }
.type-show { font: 700 clamp(2.25rem, 6vw, 4rem)/1 var(--display); letter-spacing: -.015em; margin-top: 16px; }
.rules { max-width: 68ch; padding-left: 1.2rem; }
.rules li + li { margin-top: 8px; }
.plain { min-height: 100svh; display: grid; place-content: center; gap: 16px; padding: 24px; }

@media (max-width: 900px) {
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(336px, 1fr) auto; }
  .login-brand { padding-block: 16px; }
  .login-panel { border-left: 0; border-top: 4px solid var(--thread); }
  .shell { grid-template-columns: minmax(0, 1fr); }
  #burger { display: block; }
  .head { padding: 0 12px; gap: 10px; }
  .head kbd, .head .who { display: none; }
  .side { position: fixed; inset: 64px auto 0 0; width: 264px; z-index: 15; transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility .2s; }
  .side-in { position: static; }
  .menu-open .side { transform: none; visibility: visible; }
  .menu-open #scrim { display: block; position: fixed; inset: 64px 0 0; background: rgba(16, 30, 43, .5); z-index: 14; }
  #tabs { padding-inline: 12px; }
  .concepts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .band header { padding: 20px 20px 0; }
  #concept-said { padding-inline: 20px; }
  #rail { aspect-ratio: 3.4; }
  .steps { grid-template-columns: 1fr; }
  .steps li { padding: 0 0 24px 32px; }
  .steps li::before { left: 7px; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 2px dashed var(--basting); }
  h1 { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
