/* AT tool chrome v1.3.1 - the shared top bar and access state cards of every
   AcademicTransfer tool, in the look of academictransfer.com: the blue bar
   with the logo on its white plate, orange main buttons, warm grey, Source
   Sans 3 and Bitter, flat 2 to 5px corners. Drop-in: every selector is under
   .atc-*, every variable is --atc-*, nothing styles body, a, h1 or :focus
   globally, so it can sit inside Tailwind preflight, MUI CssBaseline or
   Streamlit without touching the host. No @import and no @font-face: a host
   loads the two faces itself (the portal serves them at /brand/fonts.css);
   anyone without them falls back to the system stack below. Same classes and
   markup as 1.2.2. 1.3.1 is 1.3.0 with a 44 by 44 tap target on every EN/NL
   button on a phone; the switch looks the same. */

:root {
  /* brand:roles:start (scripts/brand-build.js writes this block from brand/tokens.json) */
  --atc-bar: #004b68;
  --atc-on-dark: #ffffff;
  --atc-on-dark-hover: #8ad4e4;
  --atc-on-dark-muted: #cfeef5;
  --atc-footer: #003d54;
  --atc-current: #d0cd68;
  --atc-ground: #f6f5f4;
  --atc-card: #ffffff;
  --atc-line: #d7d4d2;
  --atc-line-soft: #eeebe9;
  --atc-ink: #3b3a3a;
  --atc-heading: #003d54;
  --atc-muted: #525252;
  --atc-link: #0c6280;
  --atc-link-hover: #013f57;
  --atc-primary: #eea24c;
  --atc-primary-hover: #d59144;
  --atc-on-primary: #003348;
  --atc-dark: #003d54;
  --atc-dark-hover: #004b68;
  --atc-secondary-line: #aee2ee;
  --atc-hover-tint: #ecf9fb;
  --atc-field-line: #7f7f7f;
  --atc-field-hover: #3b3a3a;
  --atc-band: #e6f5fb;
  --atc-chip: #e6f5fb;
  --atc-chip-line: #b3e0f1;
  --atc-chip-ink: #013f57;
  --atc-tile-hover: #45b4de;
  --atc-accent: #e8e574;
  --atc-on-accent: #003348;
  --atc-ok: #124b2c;
  --atc-ok-soft: #dfe6d3;
  --atc-warn: #5d5c2e;
  --atc-warn-soft: #fafae3;
  --atc-hold: #525252;
  --atc-hold-soft: #eeebe9;
  --atc-danger: #DA002A;
  --atc-danger-dark: #C62828;
  --atc-danger-soft: #FEF3F2;
  --atc-font: "Source Sans 3","Source Sans Pro","Lucida Sans Unicode","Lucida Grande",sans-serif;
  --atc-font-display: "Bitter","Palatino Linotype","Book Antiqua","Palatino",serif;
  --atc-radius-btn: 2px;
  --atc-radius-input: 2px;
  --atc-radius-card: 4px;
  --atc-radius-tile: 5px;
  --atc-radius-pill: 25px;
  --atc-shadow: none;
  --atc-shadow-menu: 0 1px 5px rgba(0,0,0,.25);
  --atc-shadow-float: 0 2px 4px rgba(0,0,0,.08), 0 10px 40px -10px rgba(0,0,0,.25);
  --atc-shadow-plate: 0 4px 8px rgba(0,0,0,.2), 0 6px 20px rgba(0,0,0,.2);
  /* brand:roles:end */
  --atc-focus: 2px solid var(--atc-bar);            /* on light surfaces */
  --atc-focus-on-dark: 2px solid var(--atc-accent); /* on the blue bar */
  /* An access card's page: the blue band of the site's header over warm grey. */
  --atc-backdrop: linear-gradient(var(--atc-bar) 0, var(--atc-bar) 320px, var(--atc-ground) 320px);
  /* The names of 1.2.2, so a tool's own CSS that uses them follows. */
  --atc-green: var(--atc-heading);
  --atc-green-deep: var(--atc-bar);
  --atc-green-mid: var(--atc-link);
  --atc-lime: var(--atc-accent);
  --atc-lime-dark: var(--atc-current);
  --atc-blue: var(--atc-link);
  --atc-muted-strong: var(--atc-muted);
  --atc-tint: var(--atc-band);
}

/* ---- top bar: the site's header ------------------------------------------ */
.atc-bar {
  box-sizing: border-box; display: flex; align-items: center; justify-content: space-between;
  gap: 10px 24px; flex-wrap: wrap; min-height: 70px; padding: 8px 32px; margin: 0;
  background: var(--atc-bar); color: var(--atc-on-dark); border: 0;
  font-family: var(--atc-font); font-size: 17px; line-height: 1.3;
}
.atc-bar *, .atc-state *, .atc-inline * { box-sizing: border-box; }
.atc-brand { display: flex; align-items: center; gap: 16px; min-width: 0; text-decoration: none; color: inherit; }
/* The logo on its white plate, as the site shows it. The plate is drawn
   here, so the same picture works on any host. */
.atc-logo { display: block; height: 54px; width: auto; flex: none; padding: 6px 8px; background: #fff;
  border-radius: 3px; box-shadow: var(--atc-shadow-plate); }
.atc-tool { font-family: var(--atc-font-display); font-size: 20px; font-weight: 700; color: var(--atc-on-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atc-right { display: flex; align-items: center; gap: 8px 22px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.atc-who { color: var(--atc-on-dark-muted); font-size: 15px; max-width: 36ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atc-who .atc-org::before { content: " \00B7  "; }
.atc-link, .atc-bar button.atc-link {
  color: var(--atc-on-dark); font: inherit; font-weight: 400; text-decoration: none; white-space: nowrap;
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 3px 0 2px; margin: 0; cursor: pointer;
  transition: color .3s;
}
.atc-link:hover, .atc-bar button.atc-link:hover { color: var(--atc-on-dark-hover); }
.atc-link[aria-current="page"] { font-weight: 700; border-bottom-color: var(--atc-current); }
/* EN NL: a round toggle, the active language a white pill. */
.atc-lang { display: inline-flex; border: 1px solid rgba(255,255,255,.55); border-radius: var(--atc-radius-pill); padding: 2px; gap: 2px; }
.atc-lang button, .atc-lang a { display: inline-flex; align-items: center; text-decoration: none; font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .03em; line-height: 1;
  border: 0; border-radius: var(--atc-radius-pill); padding: 6px 11px; min-height: 28px; background: none; color: var(--atc-on-dark); cursor: pointer; }
.atc-lang button:hover, .atc-lang a:hover { color: var(--atc-on-dark-hover); }
.atc-lang [aria-pressed="true"], .atc-lang [aria-current="true"] { background: var(--atc-card); color: var(--atc-bar); }
.atc-lang [aria-pressed="true"]:hover, .atc-lang [aria-current="true"]:hover { color: var(--atc-bar); }

/* tabs under the bar (dashboard, admin): the site's folder tabs on a band */
.atc-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.atc-tabs a { padding: 11px 18px 12px; color: var(--atc-heading); text-decoration: none; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; border-top-width: 3px; border-bottom: 0; border-radius: var(--atc-radius-card) var(--atc-radius-card) 0 0; }
.atc-tabs a:hover { color: var(--atc-link); }
.atc-tabs a[aria-current="page"] { background: var(--atc-card); border-color: var(--atc-chip-line); border-top-color: var(--atc-bar); font-weight: 700; }
.atc-count { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 5px; border-radius: var(--atc-radius-pill);
  background: var(--atc-primary); color: var(--atc-on-primary); font-size: 13px; font-weight: 700; line-height: 1.4; text-align: center; }

/* ---- buttons (bar, states, and any host that wants them) ------------------
   The site's anatomy: 700 18px, 2px corners, a chevron before the label. */
.atc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px;
  padding: 10px 20px; border: 0; border-radius: var(--atc-radius-btn);
  font-family: var(--atc-font); font-size: 18px; font-weight: 700; line-height: 1.25; text-decoration: none; cursor: pointer;
  background: var(--atc-primary); color: var(--atc-on-primary); transition: background-color .3s, color .3s; }
.atc-btn::before { content: ""; flex: none; width: 8px; height: 13px; background-color: currentColor; opacity: .8;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 13'%3E%3Cpath d='M1.521 12.861l6.064-6.073L1.521.724 0 2.235l4.553 4.553L0 11.35z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 13'%3E%3Cpath d='M1.521 12.861l6.064-6.073L1.521.724 0 2.235l4.553 4.553L0 11.35z'/%3E%3C/svg%3E") no-repeat center / contain; }
.atc-btn:hover { background: var(--atc-primary-hover); }
.atc-btn--secondary { background: var(--atc-card); color: var(--atc-link); box-shadow: inset 0 0 0 1px var(--atc-secondary-line); }
.atc-btn--secondary:hover { background: var(--atc-hover-tint); }
.atc-btn--dark { background: var(--atc-dark); color: var(--atc-on-dark); }
.atc-btn--dark:hover { background: var(--atc-dark-hover); }
.atc-btn--danger { background: var(--atc-danger); color: #fff; }
.atc-btn--danger:hover { background: var(--atc-danger-dark); }
.atc-btn[disabled], .atc-btn[aria-disabled="true"] { opacity: .6; cursor: default; }
.atc-btn--block { display: flex; width: 100%; }

/* ---- fields (any host that wants them) ------------------------------------ */
.atc-input { display: block; width: 100%; box-sizing: border-box; margin: 0; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--atc-field-line); border-radius: var(--atc-radius-input); background: var(--atc-card); color: var(--atc-ink);
  font-family: var(--atc-font); font-size: 18px; line-height: 1.4; }
.atc-input:hover { border-color: var(--atc-field-hover); }
.atc-input:focus-visible { outline: var(--atc-focus); outline-offset: 0; border-color: var(--atc-bar); }
.atc-input[aria-invalid="true"] { border-color: var(--atc-danger); }

/* ---- focus: blue on light, yellow on the bar ------------------------------ */
.atc-state :focus-visible, .atc-inline :focus-visible {
  outline: var(--atc-focus); outline-offset: 2px; border-radius: 2px;
}
.atc-bar :focus-visible { outline: var(--atc-focus-on-dark); outline-offset: 2px; border-radius: 2px; }
.atc-btn:focus-visible { border-radius: var(--atc-radius-btn); }

/* ---- access state cards: the portal's sign-in card ------------------------ */
.atc-state { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow-y: auto; background: var(--atc-backdrop); font-family: var(--atc-font); color: var(--atc-ink); }
.atc-state[hidden] { display: none; }
.atc-state--page { position: static; min-height: 100vh; box-sizing: border-box; } /* server-rendered page, not an overlay; its padding inside the 100vh */
.atc-card { position: relative; width: 100%; max-width: 460px; margin: auto; padding: 36px 32px 32px; text-align: center;
  background: var(--atc-card); border: 1px solid var(--atc-line); border-radius: var(--atc-radius-card); box-shadow: var(--atc-shadow-float); }
.atc-card .atc-card-logo { display: block; height: 72px; width: auto; margin: 4px auto 18px; }
.atc-card h1, .atc-card .atc-title { font-family: var(--atc-font-display); line-height: 1.3; padding: 0; font-size: 24px; font-weight: 700; color: var(--atc-heading); margin: 0 0 10px; }
.atc-card p { font-size: 17px; line-height: 1.55; color: var(--atc-ink); margin: 0 0 20px; }
.atc-card p a { color: var(--atc-link); font-weight: 600; text-underline-offset: 2px; }
.atc-card p a:hover { color: var(--atc-link-hover); }
.atc-card .atc-actions { display: flex; flex-direction: column; gap: 12px; margin: 0 0 4px; }
.atc-card .atc-help { font-size: 15px; color: var(--atc-muted); margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--atc-line-soft); }
.atc-card .atc-help .atc-link { color: var(--atc-link); font-weight: 600; border-bottom: 0; padding: 0; }
.atc-card .atc-help .atc-link:hover { color: var(--atc-link-hover); }
.atc-card .atc-lang { position: absolute; top: 14px; right: 14px; border-color: var(--atc-line); }
.atc-card .atc-lang button, .atc-card .atc-lang a { color: var(--atc-heading); font-size: 13px; padding: 5px 9px; min-height: 26px; }
.atc-card .atc-lang button:hover, .atc-card .atc-lang a:hover { color: var(--atc-link); }
.atc-card .atc-lang [aria-pressed="true"], .atc-card .atc-lang [aria-current="true"] { background: var(--atc-bar); color: var(--atc-on-dark); }
.atc-spinner { width: 28px; height: 28px; margin: 4px auto 14px; border-radius: 50%;
  border: 3px solid var(--atc-band); border-top-color: var(--atc-bar); animation: atc-spin .9s linear infinite; }
@keyframes atc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .atc-spinner { animation: none; border-top-color: var(--atc-link); } }

/* ---- inline variant: identity block inside a host panel (e-learning admin) - */
.atc-inline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 10px 14px;
  background: var(--atc-ground); border: 1px solid var(--atc-line); border-radius: var(--atc-radius-card);
  font-family: var(--atc-font); font-size: 15px; color: var(--atc-ink); }

/* ---- footer: the site's navy band ----------------------------------------
   "© AcademicTransfer · contact@academictransfer.nl" */
.atc-footer { display: block; margin: 0; padding: 26px 16px;
  font-family: var(--atc-font); font-size: 15px; line-height: 1.5; color: var(--atc-on-dark); text-align: center;
  background: var(--atc-footer); }
.atc-footer a { color: inherit; text-underline-offset: 2px; }
.atc-footer a:hover { color: var(--atc-on-dark-hover); }
.atc-footer :focus-visible { outline: var(--atc-focus-on-dark); outline-offset: 2px; border-radius: 2px; }

/* ---- a link that opens a tool in a new tab --------------------------------
   <a target="_blank" rel="noopener">Name<span class="atc-ext" aria-hidden="true">↗</span>
   <span class="atc-sr">opens in a new tab</span></a>. The arrow is seen, the
   words are heard. */
.atc-ext { display: inline-block; margin-left: .3em; font-size: .85em; font-weight: 400; line-height: 1; opacity: .7; }
.atc-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---- Windows high contrast: shadows are dropped, so draw real lines -------- */
@media (forced-colors: active) {
  .atc-btn--secondary { border: 1px solid ButtonText; }
  .atc-btn::before { background-color: ButtonText; }
  .atc-logo { border: 1px solid CanvasText; }
  .atc-tabs a[aria-current="page"] { border-color: Highlight; }
}

/* ---- phone ---------------------------------------------------------------- */
@media (max-width: 640px) {
  .atc-bar { padding: 8px 16px; min-height: 60px; font-size: 16px; }
  .atc-logo { height: 44px; padding: 5px 6px; }
  .atc-brand { gap: 12px; }
  /* A long name wraps under itself instead of being cut off. */
  .atc-tool { font-size: 17px; white-space: normal; line-height: 1.2; }
  /* Two rows under the brand: who is signed in beside EN NL, then My tools,
     Switch account and Sign out together (the ::after is the line break). */
  .atc-right { width: 100%; justify-content: flex-start; gap: 0 18px; }
  .atc-right::after { content: ""; order: 2; flex-basis: 100%; height: 0; }
  .atc-right > * { order: 3; }
  .atc-right > .atc-who, .atc-right > .atc-lang { order: 1; }
  .atc-who { flex: 1 1 0; min-width: 0; max-width: none; font-size: 14px; }
  /* My tools, Switch account and Sign out stay a thumb's width tall. */
  .atc-right .atc-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0; }
  .atc-lang button, .atc-lang a { min-height: 32px; padding: 6px 11px; }
  /* EN NL: each button is a tap target of 44 by 44, an invisible ::after, so
     the switch looks as it does. The two grow outward from the 2px between
     them and meet there without overlapping. In the bar a target ends at the
     switch's lower edge and reaches up into the gap under the brand, never
     down into My tools, Switch account or Sign out on the row below. */
  .atc-lang button, .atc-lang a { position: relative; }
  .atc-lang button::after, .atc-lang a::after { content: ""; position: absolute; bottom: -3px; width: 44px; height: 44px; }
  .atc-lang > :first-child::after { right: -1px; }
  .atc-lang > :last-child::after { left: -1px; }
  /* On a card there is room below the switch: the target is centred on it. */
  .atc-card .atc-lang button::after, .atc-card .atc-lang a::after { bottom: auto; top: 50%; margin-top: -22px; }
  .atc-card { padding: 28px 20px 24px; }
  .atc-btn { font-size: 17px; }
  /* the logo starts below the card's EN NL switch in the corner */
  .atc-card .atc-card-logo { margin-top: 40px; }
}
