/* Kundenportal (W3-3): static pages for companies, participants and guest instructors. Phone first (UI contract: < 768 Handy),
   token names of lgv.css (radius from there; colours and light/dark set here, D-115), no shell of the administration. */
/* D-115 whitelabel: the portal's own tokens on its container – accent colour of the tenant (--lgv-portal-accent, inline from the layout) and
   light/dark from the setting (data-look light|dark|auto, auto = prefers-color-scheme). Rendered by the server, so the look does not depend on
   <html data-theme> of lgv-theme.js (lost on Blazor's enhanced navigation) nor on the staff's choice on the same device. Values as lgv.css. */
.lgv-portal {
  --lgv-portal-accent: #0f6cbd;
  --lgv-bg: #f5f6f8; --lgv-surface: #ffffff; --lgv-surface-2: #f0f2f5; --lgv-line: #e3e6eb; --lgv-line-2: #d3d8df;
  --lgv-text: #1b1f24; --lgv-muted: #5c6570; --lgv-faint: #8a929c;
  --lgv-accent: var(--lgv-portal-accent);
  --lgv-accent-weak: color-mix(in srgb, var(--lgv-portal-accent) 12%, #ffffff);
  --lgv-accent-ink: color-mix(in srgb, var(--lgv-portal-accent) 80%, #000000);
  --lgv-ok: #107c41; --lgv-ok-weak: #e3f3ea; --lgv-warn: #b86e00; --lgv-warn-weak: #fdf1dc; --lgv-bad: #c4314b; --lgv-bad-weak: #fbe7ea;
  --lgv-on-strong: #ffffff;
  --lgv-shadow: 0 1px 2px rgba(16,24,40,.06), 0 2px 8px rgba(16,24,40,.06);
  color-scheme: light;
  min-height: 100vh; background: var(--lgv-bg); color: var(--lgv-text);
}
.lgv-portal[data-look="dark"] {
  --lgv-bg: #14171b; --lgv-surface: #1c2026; --lgv-surface-2: #232830; --lgv-line: #2c323b; --lgv-line-2: #39404a;
  --lgv-text: #e8ebef; --lgv-muted: #a3acb7; --lgv-faint: #7b8490;
  --lgv-accent: color-mix(in srgb, var(--lgv-portal-accent) 65%, #ffffff);
  --lgv-accent-weak: color-mix(in srgb, var(--lgv-portal-accent) 25%, #14171b);
  --lgv-accent-ink: color-mix(in srgb, var(--lgv-portal-accent) 40%, #ffffff);
  --lgv-ok: #4cc38a; --lgv-ok-weak: #16302a; --lgv-warn: #f0a940; --lgv-warn-weak: #3a2c14; --lgv-bad: #f2768c; --lgv-bad-weak: #3a1d24;
  --lgv-on-strong: #14171b;
  --lgv-shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  .lgv-portal[data-look="auto"] {
    --lgv-bg: #14171b; --lgv-surface: #1c2026; --lgv-surface-2: #232830; --lgv-line: #2c323b; --lgv-line-2: #39404a;
    --lgv-text: #e8ebef; --lgv-muted: #a3acb7; --lgv-faint: #7b8490;
    --lgv-accent: color-mix(in srgb, var(--lgv-portal-accent) 65%, #ffffff);
    --lgv-accent-weak: color-mix(in srgb, var(--lgv-portal-accent) 25%, #14171b);
    --lgv-accent-ink: color-mix(in srgb, var(--lgv-portal-accent) 40%, #ffffff);
    --lgv-ok: #4cc38a; --lgv-ok-weak: #16302a; --lgv-warn: #f0a940; --lgv-warn-weak: #3a2c14; --lgv-bad: #f2768c; --lgv-bad-weak: #3a1d24;
    --lgv-on-strong: #14171b;
    --lgv-shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
.lgv-portal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px; background: var(--lgv-surface);
  border-bottom: 1px solid var(--lgv-line); position: sticky; top: 0; z-index: 2; }
.lgv-portal-brand { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; }
.lgv-portal-logo { display: block; max-height: 40px; max-width: 160px; width: auto; height: auto; object-fit: contain; }
.lgv-portal-mark { width: 32px; height: 32px; flex: none; border-radius: var(--lgv-radius); display: grid; place-items: center; background: var(--lgv-accent);
  color: var(--lgv-on-strong); font-weight: 700; font-size: 16px; }
.lgv-portal-name { display: grid; min-width: 0; line-height: 1.2; }
.lgv-portal-name strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lgv-portal-name small { font-size: 12px; color: var(--lgv-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* right end of the head: who is signed in, "Abmelden" – and the place of a later switch "für mich / für Betrieb X" (first child) */
.lgv-portal-head-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lgv-portal-head .lgv-portal-who { text-align: right; font-size: 13px; color: var(--lgv-muted); line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.lgv-portal-head form { margin: 0; }
.lgv-portal-banner { height: 160px; background-color: var(--lgv-surface-2); background-size: cover; background-position: center; }
.lgv-portal-nav { display: flex; gap: 4px; overflow-x: auto; padding: 6px 12px; background: var(--lgv-surface); border-bottom: 1px solid var(--lgv-line);
  scrollbar-width: none; }
.lgv-portal-nav a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; text-decoration: none;
  color: var(--lgv-text); font-size: 14px; min-height: 44px; }
.lgv-portal-nav a.active, .lgv-portal-nav a[aria-current="page"] { background: var(--lgv-accent-weak); color: var(--lgv-accent-ink); font-weight: 600; }
.lgv-portal-main { max-width: 860px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; overflow-wrap: break-word; }
/* long course titles and names wrap in short lines on phones (German compounds are hyphenated, <html lang="de">) */
.lgv-portal-main h1 { margin: 0; font-size: 22px; line-height: 1.25; hyphens: auto; }
.lgv-portal-main h1:focus { outline: none; }
.lgv-portal-main h2 { margin: 0 0 8px; font-size: 16px; }
.lgv-portal-lead { margin: 0; color: var(--lgv-muted); }
.lgv-portal-tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.lgv-portal-tile { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--lgv-line); border-radius: var(--lgv-radius); background: var(--lgv-surface);
  text-decoration: none; color: inherit; min-height: 88px; }
.lgv-portal-tile strong { font-size: 24px; }
.lgv-portal-tile:hover { border-color: var(--lgv-accent); }
.lgv-portal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lgv-portal-item { padding: 12px 14px; border: 1px solid var(--lgv-line); border-radius: var(--lgv-radius); background: var(--lgv-surface); display: grid; gap: 4px; }
.lgv-portal-item header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.lgv-portal-item .lgv-portal-meta { color: var(--lgv-muted); font-size: 13px; }
.lgv-portal-item a.lgv-portal-go { justify-self: start; }
/* links standing alone (name of a card, "‹ Mitarbeiter", "Kurs anfragen" after a line) are touch targets of 44 px */
.lgv-portal-item header > a, .lgv-portal-main > p > a:only-child { display: inline-flex; align-items: center; min-height: 44px; }
.lgv-portal-sessions { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--lgv-muted); }
.lgv-portal-form { display: grid; gap: 10px; }
.lgv-portal-form label, .lgv-portal-form legend { font-weight: 600; font-size: 14px; }
.lgv-portal-form fieldset { border: 1px solid var(--lgv-line); border-radius: var(--lgv-radius); padding: 10px 12px; margin: 0; display: grid; gap: 6px; }
/* fields: 16 px (iOS Safari zooms into smaller fields on focus), 44 px high (touch); input:not([type]) = text fields without a type attribute */
.lgv-portal-form input:not([type]), .lgv-portal-form input[type="text"], .lgv-portal-form input[type="email"], .lgv-portal-form input[type="date"],
.lgv-portal-form input[type="tel"], .lgv-portal-form input[type="search"], .lgv-portal-form select, .lgv-portal-form textarea, .lgv-portal-form input[type="file"] {
  font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid var(--lgv-line-2); border-radius: var(--lgv-radius); background: var(--lgv-surface);
  color: inherit; width: 100%; box-sizing: border-box; min-height: 44px; }
.lgv-portal-form .lgv-portal-check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; min-height: 44px; box-sizing: border-box; padding: 10px 0; }
.lgv-portal-form .lgv-portal-check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.lgv-portal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lgv-portal-btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px;
  border-radius: var(--lgv-radius); border: 1px solid var(--lgv-line-2); background: var(--lgv-surface); color: var(--lgv-text); cursor: pointer;
  text-decoration: none; }
.lgv-portal-btn.is-primary { background: var(--lgv-accent); border-color: var(--lgv-accent); color: var(--lgv-on-strong); font-weight: 600; }
.lgv-portal-btn.is-danger { color: var(--lgv-bad); border-color: var(--lgv-bad); }
.lgv-portal-btn.is-small { min-height: 34px; padding: 4px 10px; font-size: 13px; }
/* phone first: the small buttons (Abmelden, Umbuchen, Termin anfragen …) and unfolding lines are touch targets of 44 px on phones, tablets and
   every touch screen; only a desktop with a mouse keeps them compact */
.lgv-portal summary { cursor: pointer; }
@media (max-width: 1023.98px), (pointer: coarse) {
  .lgv-portal-btn.is-small { min-height: 44px; padding: 6px 12px; font-size: 14px; }
  .lgv-portal summary { padding-block: 12px; }
}
.lgv-portal-hint { padding: 10px 12px; border-radius: var(--lgv-radius); background: var(--lgv-accent-weak); margin: 0; }
.lgv-portal-hint.is-bad { background: var(--lgv-bad-weak); }
.lgv-portal-hint.is-ok { background: var(--lgv-ok-weak, var(--lgv-accent-weak)); }
.lgv-portal-hint.is-warn { background: var(--lgv-warn-weak, var(--lgv-accent-weak)); }
.lgv-portal-hints { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.lgv-portal-hints .is-warning { color: var(--lgv-warn-ink, var(--lgv-text)); }
.lgv-portal-hints .is-blocking { color: var(--lgv-bad); }
.lgv-portal-secret { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; padding: 8px; background: var(--lgv-bg);
  border-radius: var(--lgv-radius); }
/* W3-3b: consent text (paragraphs as written), attendance of a guest instructor (participants × sessions, scrolls sideways on phones) */
.lgv-portal-text { white-space: pre-line; margin: 0; padding: 12px 14px; border: 1px solid var(--lgv-line); border-radius: var(--lgv-radius);
  background: var(--lgv-surface); font-size: 14px; line-height: 1.5; }
.lgv-portal-scroll { overflow-x: auto; }
.lgv-portal-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.lgv-portal-table th, .lgv-portal-table td { padding: 6px 8px; border-bottom: 1px solid var(--lgv-line); text-align: left; vertical-align: middle; }
.lgv-portal-table th { font-weight: 600; color: var(--lgv-muted); }
/* the names stay in view while the sessions scroll sideways (own background: the cells slide below them) */
.lgv-portal-table tbody th { position: sticky; left: 0; z-index: 1; background: var(--lgv-bg); min-width: 7.5rem; max-width: 11rem; overflow-wrap: anywhere; }
.lgv-portal-table thead th { min-width: 8rem; }
.lgv-portal-table select, .lgv-portal-table input { font: inherit; font-size: 16px; min-height: 44px; padding: 4px 6px; border: 1px solid var(--lgv-line-2);
  border-radius: var(--lgv-radius); background: var(--lgv-surface); color: inherit; }
.lgv-portal-table input[type="number"] { width: 72px; }
.lgv-portal-days { display: flex; flex-wrap: wrap; gap: 6px; }
.lgv-portal-days a { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; padding: 6px 14px; border: 1px solid var(--lgv-line-2); border-radius: 999px; text-decoration: none; color: inherit; font-size: 13px; }
.lgv-portal-days a[aria-current="date"] { background: var(--lgv-accent-weak); border-color: var(--lgv-accent); font-weight: 600; }
.lgv-portal-foot { max-width: 860px; margin: 0 auto; padding: 16px; color: var(--lgv-muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.lgv-portal-foot a { color: var(--lgv-muted); }
/* D-115: live preview on Einstellungen › Kundenportal (the staff app): the same markup, framed, not full height */
.lgv-portal.is-preview { min-height: 0; border: 1px solid var(--lgv-line); border-radius: var(--lgv-radius); overflow: hidden; }
.lgv-portal.is-preview .lgv-portal-head { position: static; }
.lgv-portal.is-preview .lgv-portal-main { padding: 16px; }
/* phone (< 768): the head in two lines – brand, who and "Abmelden" first, the switch "für mich / für Betrieb" below across the width (its
   select would push the head beyond the screen); the containers of lgv-portal-head-end take part in the head's own wrapping */
@media (max-width: 767.98px) {
  .lgv-portal-head-end { display: contents; }
  .lgv-portal-head .lgv-portal-who { order: 1; margin-left: auto; }
  .lgv-portal-head-end > form:last-child { order: 2; }
  .lgv-portal-head .lgv-portal-acting { order: 3; flex: 1 1 100%; min-width: 0; }
  /* with the switch the head has three lines: it scrolls away with the page instead of covering a quarter of a small phone */
  .lgv-portal-head:has(.lgv-portal-acting) { position: static; }
}
/* phones across (little height): the head scrolls away with the page instead of covering a third of it */
@media (max-height: 500px) {
  .lgv-portal-head { position: static; }
}
@media (min-width: 768px) {
  /* centred by auto margins, not justify-content: when the menu is wider than the screen (tablets), centring would push Start and Kurse
     out on the left where no scrolling reaches them; auto margins drop to 0 then */
  .lgv-portal-nav > :first-child { margin-left: auto; }
  .lgv-portal-nav > :last-child { margin-right: auto; }
  .lgv-portal-main { padding: 24px; }
  .lgv-portal-banner { height: 220px; }
}
