/* ==========================================================================
   IIME member pages: "the instrument panel"
   --------------------------------------------------------------------------
   IIME's own look for the affiliation pages (the other six projects each have
   a different one). The pages are built like the panel of a machine: a navy
   console with a riveted nameplate, a status lamp and selector keys; a dial
   with a needle for the membership period; an annunciator with one lamp per
   stage; a work order for the next action; forms that move along a process line.
   Colours and fonts are those of the website (iime-modern.css): navy, IIME red,
   signal blue, brass; Fraunces headings, Inter text, JetBrains Mono read-outs.
   ========================================================================== */

.af-root.afm {
  --af-surface: #ffffff;
  --af-surface-2: #f3f6fb;
  --af-line: #dfe6f0;
  --af-line-strong: #b9c6d8;
  --af-text: #0d1b2e;
  --af-muted: #66768d;
  --af-primary: #0b2a5b;
  --af-primary-ink: #ffffff;
  --af-accent: #1f63d8;
  --af-ok: #137a52;        --af-ok-bg: #e2f5ec;
  --af-warn: #9a5b00;      --af-warn-bg: #fff2d8;
  --af-bad: #c8102e;       --af-bad-bg: #fde8ec;
  --af-info: #1f63d8;      --af-info-bg: #e7f0fe;
  --af-radius: 14px;
  --af-radius-sm: 10px;
  --af-font: "Inter", "Segoe UI", system-ui, sans-serif;
  --af-display: "Fraunces", Georgia, serif;
  --af-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --af-shadow: 0 10px 30px -14px rgba(11, 42, 91, .26), 0 2px 8px rgba(11, 42, 91, .06);
  --afm-navy: #0b2a5b;
  --afm-red: #c8102e;
  --afm-blue: #2f7fff;
  --afm-brass: #b8964b;
  background: #f6f8fc;
  padding-bottom: 96px;
}

.afm h2, .afm h3 { font-weight: 600; }
.afm .af-eyebrow, .afm .af-kv dt, .afm .af-table th, .afm .af-fee__label { font-family: var(--af-mono); font-size: 11px; letter-spacing: .14em; font-weight: 500; }
.afm .af-card, .afm .af-step { border-top: 3px solid var(--afm-navy); }
.afm .af-card__title { font-size: 22px; }
.afm .af-pill { font-family: var(--af-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; border-radius: 4px; padding: 4px 10px; }
.afm .af-step__no { color: var(--afm-red); }

/* buttons: push buttons */
.afm .af-btn { border-radius: 8px; font-weight: 600; font-size: 14.5px; letter-spacing: .01em; transition: transform .15s, box-shadow .15s, background .2s, border-color .2s; }
.afm .af-btn--primary { background: var(--afm-red); box-shadow: 0 3px 0 #8f0b21, 0 10px 20px -12px rgba(200, 16, 46, .8); }
.afm .af-btn--primary:hover { filter: none; background: #b30e29; }
.afm .af-btn--primary:active { transform: translateY(3px); box-shadow: 0 0 0 #8f0b21; }
.afm .af-btn--ghost { background: #fff; border-color: var(--af-line-strong); box-shadow: 0 2px 0 var(--af-line-strong); }
.afm .af-btn--ghost:hover { border-color: var(--afm-navy); color: var(--afm-navy) !important; }
.afm .af-btn--ghost:active { transform: translateY(2px); box-shadow: none; }
.afm .af-btn--link { box-shadow: none; }

/* inputs */
.afm .af-label { font-size: 13.5px; font-weight: 600; }
.afm .af-input { border-radius: 8px; border-color: var(--af-line-strong); background: #fbfcfe; }
.afm .af-input:focus { border-color: var(--afm-blue); background: #fff; box-shadow: 0 0 0 3px rgba(47, 127, 255, .2); }
.afm .af-tile__body { border-radius: 10px; }
.afm .af-tile input:checked + .af-tile__body { border-color: var(--afm-navy); background: #eef3fa; box-shadow: inset 0 -3px 0 var(--afm-red); }
.afm .af-tile input:checked + .af-tile__body i { color: var(--afm-red); }
.afm .af-choice input, .afm .af-check input { accent-color: var(--afm-navy); }
.afm .af-upload__drop:hover, .afm .af-upload.has-files .af-upload__drop { border-color: var(--afm-blue); color: var(--af-accent); }
.afm .af-fee__amount, .afm .af-pay__amount { font-family: var(--af-mono); font-weight: 500; letter-spacing: -.02em; }

/* ---------- console ---------- */
.afm-console { background: linear-gradient(180deg, #0b2a5b 0%, #0d346b 100%); color: #fff; position: relative; overflow: hidden; }
.afm-console::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.4px); background-size: 14px 14px; -webkit-mask-image: linear-gradient(90deg, transparent 35%, #000); mask-image: linear-gradient(90deg, transparent 35%, #000); pointer-events: none; }
.afm-console__in { position: relative; }
.afm-console__top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center; padding: 30px 0 24px; }
.afm-console__crumb { font-family: var(--af-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: #9db4d8; }
.afm-console__crumb a { color: #fff; }
.afm-console h1 { color: #fff; font-family: var(--af-display); font-size: 36px; font-weight: 600; margin: 6px 0 4px; line-height: 1.1; }
.af-root.af-root .afm-console p { color: #c9d6ec; margin: 0; max-width: 620px; }
.afm-console__state { display: grid; gap: 10px; justify-items: end; }
.afm-console__state form { margin: 0; }

/* the nameplate: brass, engraved, four rivets */
.afm-plate { position: relative; display: grid; gap: 1px; min-width: 210px; padding: 14px 22px; border-radius: 6px; background: linear-gradient(135deg, #d9c48b 0%, #b8964b 45%, #e6d6a6 70%, #a98538 100%); color: #2c2206; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -1px 0 rgba(0, 0, 0, .25), 0 8px 20px -10px rgba(0, 0, 0, .7); }
.afm-plate > i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff5d0, #7a5f22 70%); box-shadow: 0 1px 1px rgba(0, 0, 0, .4); }
.afm-plate > i:nth-of-type(1) { top: 6px; left: 6px; }
.afm-plate > i:nth-of-type(2) { top: 6px; right: 6px; }
.afm-plate > i:nth-of-type(3) { bottom: 6px; left: 6px; }
.afm-plate > i:nth-of-type(4) { bottom: 6px; right: 6px; }
.afm-plate span { font-family: var(--af-mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; opacity: .8; }
.afm-plate strong { font-family: var(--af-display); font-size: 18px; font-weight: 600; line-height: 1.2; text-shadow: 0 1px 0 rgba(255, 255, 255, .45); overflow-wrap: anywhere; }
.afm-plate em { font-style: normal; font-family: var(--af-mono); font-size: 12px; }
.afm-plate--wide { min-width: 0; }

.afm-lamp { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px; border-radius: 999px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .16); font-family: var(--af-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; }
.afm-lamp i { width: 14px; height: 14px; border-radius: 50%; background: #5d6f8c; box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .4); }
.afm-lamp--run i { background: radial-gradient(circle at 35% 30%, #c9ffe4, #1fc27b 60%); box-shadow: 0 0 12px 2px rgba(31, 194, 123, .7); }
.afm-lamp--warn i { background: radial-gradient(circle at 35% 30%, #fff3c9, #f2a516 60%); box-shadow: 0 0 12px 2px rgba(242, 165, 22, .7); animation: afm-blink 1.6s steps(2, jump-none) infinite; }
.afm-lamp--stop i { background: radial-gradient(circle at 35% 30%, #ffd0d6, #e11d3f 60%); box-shadow: 0 0 12px 2px rgba(225, 29, 63, .75); }
@keyframes afm-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .afm-lamp--warn i, .afm-tile.is-current::before { animation: none !important; } }
.afm-out { border: 0; background: none; color: #9db4d8; font: 600 13px var(--af-font); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; padding: 2px 0; }
.afm-out:hover { color: #fff; }

.afm-selector { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 0; }
.afm-selector::-webkit-scrollbar { display: none; }
.afm-key { display: inline-flex; align-items: center; gap: 9px; padding: 12px 18px 13px; border-radius: 10px 10px 0 0; background: rgba(255, 255, 255, .07); color: #c9d6ec !important; font-weight: 600; font-size: 14.5px; white-space: nowrap; text-decoration: none !important; border: 1px solid rgba(255, 255, 255, .1); border-bottom: 0; }
.afm-key:hover { background: rgba(255, 255, 255, .14); color: #fff !important; }
.afm-key__led { width: 8px; height: 8px; border-radius: 50%; background: #4a6189; }
.afm-key.is-active { background: #f6f8fc; color: var(--af-text) !important; border-color: #f6f8fc; }
.afm-key.is-active .afm-key__led { background: var(--afm-red); box-shadow: 0 0 8px rgba(200, 16, 46, .8); }
.afm-key__flag { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--afm-red); color: #fff; font: 600 11px var(--af-mono); display: inline-grid; place-items: center; }

.afm-page { padding-top: 30px; }

/* ---------- panels ---------- */
.afm-panel { position: relative; background: #fff; border: 1px solid var(--af-line); border-radius: 14px; box-shadow: var(--af-shadow); padding: 22px 24px 24px; min-width: 0; }
.afm-panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--af-line); font-family: var(--af-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--af-muted); }
.afm-panel__head b { font-weight: 500; color: var(--af-text); letter-spacing: .06em; text-align: end; }
.afm-panel__head i { color: var(--afm-navy); font-size: 15px; }

.afm-cluster { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; align-items: stretch; }
.afm-cluster__side { display: grid; gap: 20px; grid-template-rows: auto 1fr; min-width: 0; }

/* the dial */
.afm-dial { display: flex; flex-direction: column; }
.afm-dial__face { padding: 4px 10px 0; }
.afm-dial__face svg { display: block; width: 100%; height: auto; overflow: visible; }
.afm-dial__track { fill: none; stroke: #e6ecf5; stroke-width: 18; }
.afm-dial__band { fill: none; stroke-width: 18; }
.afm-dial__band--ok { stroke: #1f8f63; opacity: .9; }
.afm-dial__band--low { stroke: var(--afm-red); }
.afm-dial__tick { stroke: #7f8fa8; stroke-width: 1.2; }
.afm-dial__tick.is-major { stroke: var(--af-text); stroke-width: 2; }
.afm-dial__mark { font: 500 9px var(--af-mono); fill: #66768d; }
.afm-dial__needle { fill: var(--af-text); }
.afm-dial__hub { fill: var(--afm-navy); }
.afm-dial__pin { fill: var(--afm-brass); }
.afm-dial--none .afm-dial__band, .afm-dial--none .afm-dial__tick { opacity: .35; }
.afm-dial__read { text-align: center; margin: 6px 0 14px; }
.afm-dial__read strong { display: inline-block; font: 500 44px/1 var(--af-mono); letter-spacing: -.03em; color: var(--af-text); padding: 8px 18px; border-radius: 8px; background: #eef3fa; box-shadow: inset 0 2px 5px rgba(11, 42, 91, .14); }
.afm-dial--expired .afm-dial__read strong { color: var(--afm-red); background: #fde8ec; }
.afm-dial__read span { display: block; margin-top: 8px; font: 500 11.5px var(--af-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--af-muted); }
.af-root .afm-dial__dates { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--af-line); border-radius: 8px; margin: 0 0 18px; }
.afm-dial__dates > div { padding: 9px 14px; }
.afm-dial__dates > div + div { border-inline-start: 1px solid var(--af-line); }
.afm-dial__dates dt { font: 500 10.5px var(--af-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--af-muted); margin: 0; }
.afm-dial__dates dd { margin: 2px 0 0; font-weight: 600; color: var(--af-text); }
.afm-dial__actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }

/* annunciator */
.af-root .afm-annun__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.afm-tile { position: relative; display: grid; align-content: start; gap: 2px; padding: 34px 14px 14px; border-radius: 8px; background: #eef1f6; border: 1px solid #d6dde8; color: #7c8aa0; min-width: 0; }
.afm-tile::before { content: ""; position: absolute; top: 12px; inset-inline-start: 14px; width: 12px; height: 12px; border-radius: 50%; background: #b7c1d0; box-shadow: inset 0 -2px 2px rgba(0, 0, 0, .2); }
.afm-tile__no { position: absolute; top: 10px; inset-inline-end: 12px; font: 500 11px var(--af-mono); letter-spacing: .08em; opacity: .7; }
.afm-tile strong { font-size: 15px; font-weight: 700; line-height: 1.25; }
.afm-tile em { font-style: normal; font-size: 12.5px; line-height: 1.35; }
.afm-tile.is-done { background: #e2f5ec; border-color: #a9dcc3; color: #0f5e40; }
.afm-tile.is-done::before { background: radial-gradient(circle at 35% 30%, #c9ffe4, #1fc27b 60%); box-shadow: 0 0 8px 1px rgba(31, 194, 123, .7); }
.afm-tile.is-current { background: #fff2d8; border-color: #f0cf8c; color: #7a4700; }
.afm-tile.is-current::before { background: radial-gradient(circle at 35% 30%, #fff3c9, #f2a516 60%); box-shadow: 0 0 8px 1px rgba(242, 165, 22, .8); animation: afm-blink 1.6s steps(2, jump-none) infinite; }
.afm-tile.is-problem { background: #fde8ec; border-color: #f2b3be; color: #8f0b21; }
.afm-tile.is-problem::before { background: radial-gradient(circle at 35% 30%, #ffd0d6, #e11d3f 60%); box-shadow: 0 0 8px 1px rgba(225, 29, 63, .75); }

/* work order */
.afm-order { display: grid; grid-template-columns: 92px minmax(0, 1fr); background: #fff; border: 1px solid var(--af-line); border-radius: 14px; box-shadow: var(--af-shadow); overflow: hidden; min-width: 0; }
.afm-order__stub { display: grid; align-content: center; justify-items: center; gap: 4px; padding: 16px 8px; background: var(--afm-navy); color: #fff; border-inline-end: 2px dashed rgba(255, 255, 255, .45); text-align: center; }
.afm-order--warn .afm-order__stub { background: #a86400; }
.afm-order--bad .afm-order__stub { background: var(--afm-red); }
.afm-order--ok .afm-order__stub { background: #137a52; }
.afm-order__stub span { font: 500 9.5px var(--af-mono); letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.afm-order__stub b { font: 500 30px/1 var(--af-mono); }
.afm-order__body { padding: 20px 24px 22px; min-width: 0; }
.afm-order__body h2 { font-size: 23px; margin-bottom: 6px; }
.af-root.af-root .afm-order__body p { color: #33435a; margin-bottom: 14px; }

/* read-outs */
.afm-reads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.afm-read { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.afm-read .afm-panel__head { width: 100%; margin-bottom: 8px; }
.afm-read h3 { font-size: 20px; }
.afm-read > .af-btn { margin-top: auto; }
.af-root.af-root .afm-small { font-size: 14px; color: var(--af-muted); margin: 0 0 6px; }
.af-root.af-root .afm-small--bad { color: var(--af-bad); }
.afm-counter { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 8px 10px; width: 100%; margin-bottom: 6px; }
.afm-counter b { font: 500 22px/1 var(--af-mono); padding: 7px 9px; border-radius: 6px; background: #0d1b2e; color: #7fe3b0; letter-spacing: .06em; }
.afm-counter span { font: 500 10.5px var(--af-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--af-muted); }
.af-root .afm-lines { display: grid; width: 100%; margin: 4px 0 12px; }
.afm-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--af-line); font-size: 14px; }
.afm-lines li:first-child { border-top: 0; }
.afm-lines a { font-weight: 600; color: var(--af-text); }
.afm-lines span { font-family: var(--af-mono); font-size: 13px; }
.afm-lines__state { grid-column: 1 / -1; font-style: normal; font: 500 10.5px var(--af-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--af-muted); }
.afm-lines__state--ok { color: var(--af-ok); }
.afm-lines__state--warn { color: var(--af-warn); }
.afm-lines__state--bad { color: var(--af-bad); }
.afm-lines__state--info { color: var(--af-info); }
.afm-lines--plain li { display: block; color: #33435a; overflow-wrap: anywhere; }

/* ---------- forms: stages on a process line ---------- */
.afm .af-shell { grid-template-columns: minmax(0, 1fr); gap: 22px; }
.afm .af-shell__nav { position: static; }
.afm-line, .afm .af-shell__nav { background: #fff; border: 1px solid var(--af-line); border-radius: 14px; padding: 20px 22px 16px; box-shadow: var(--af-shadow); }
.af-root.afm .af-steps { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; counter-reset: none; }
.af-root.afm .af-steps::-webkit-scrollbar { display: none; }
.afm .af-steps__item { position: relative; flex: 1 0 96px; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 0 6px; border-radius: 0; }
.afm .af-steps__item::before { content: ""; position: absolute; top: 15px; inset-inline: 0; height: 6px; background: #dfe6f0; border-block: 1px solid #c3cede; }
.afm .af-steps__item:first-child::before { inset-inline-start: 50%; }
.afm .af-steps__item:last-child::before { inset-inline-end: 50%; }
.afm .af-steps__item.is-done::before { background: var(--afm-blue); border-color: #1f63d8; }
.afm .af-steps__no { position: relative; z-index: 1; width: 36px; height: 36px; border: 2px solid #b9c6d8; background: #fff; font-size: 12.5px; font-weight: 500; color: var(--af-muted); box-shadow: 0 0 0 4px #fff; }
.afm .af-steps__label { font-size: 13.5px; font-weight: 600; color: var(--af-muted); }
.afm .af-steps__hint { display: none !important; }
.afm .af-steps__item.is-active .af-steps__no { background: var(--afm-red); border-color: var(--afm-red); color: #fff; }
.afm .af-steps__item.is-active .af-steps__label { color: var(--af-text); }
.afm .af-steps__item.is-done .af-steps__no { background: var(--afm-navy); border-color: var(--afm-navy); color: #fff; }
.afm .af-steps__item.is-done .af-steps__label { color: var(--af-text); }
.afm .af-shell__nav .af-progress { height: 3px; margin: 16px 0 0; }
.afm .af-progress::before { background: var(--afm-red); }

/* ---------- registration ---------- */
.afm-join__grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; }
.afm-check { position: sticky; top: 108px; display: grid; gap: 14px; padding: 20px; border-radius: 14px; background: var(--afm-navy); color: #fff; box-shadow: var(--af-shadow); }
.af-root .afm-check__list { display: grid; gap: 10px; font-size: 14px; color: #dbe5f5; }
.afm-check__list li { position: relative; padding-inline-start: 26px; }
.afm-check__list li::before { content: ""; position: absolute; inset-inline-start: 0; top: 3px; width: 15px; height: 15px; border-radius: 3px; border: 1.5px solid #8fa8d0; }
.afm-check .af-btn--ghost { justify-content: center; box-shadow: none; border-color: transparent; }
.af-root.af-root .afm-check__note { font-size: 13px; color: #b9c9e4; margin: 0; }
.afm-check__login { color: #fff !important; font-weight: 600; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .afm-cluster { grid-template-columns: minmax(0, 1fr); }
  .afm-join__grid { grid-template-columns: minmax(0, 1fr); }
  .afm-check { position: static; order: -1; }
}
@media (max-width: 991px) {
  .afm-console__top { grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 22px 0 18px; }
  .afm-console__top .afm-plate { display: none; }
  .afm-console h1 { font-size: 28px; }
  .afm-reads { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .afm-console__top { grid-template-columns: minmax(0, 1fr); }
  .afm-console__state { justify-items: start; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .af-root .afm-annun__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .afm-order { grid-template-columns: 64px minmax(0, 1fr); }
  .afm-order__stub b { font-size: 22px; }
  .afm-order__body { padding: 16px 16px 18px; }
  .afm-panel { padding: 18px 16px 20px; }
  .afm-dial__read strong { font-size: 36px; }
  .afm .af-steps__item { flex-basis: 78px; }
  .afm .af-steps__label { font-size: 12px; }
}
