/* studio.css — looks of the gatekeeper pages (SD.4). Values from the mockups
   (tatentreu-bot-konzept/mock/base.py BASE_CSS + LOGIN_CSS, pictures s01, s02,
   s12). Light only, like the mockups. Contrast on white (WCAG): text #111827
   17.7:1, --dim #5b6270 6.1:1, --faint #6b7280 4.8:1, button #4f46e5 with
   white 6.3:1. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/static/inter.woff2) format('woff2');
}

:root {
  --bg: #f5f6f8; --card: #ffffff; --alt: #f9fafb; --border: #e5e7eb; --border2: #d1d5db;
  --text: #111827; --dim: #5b6270; --faint: #6b7280;
  --accent: #1f4e5a; --accent-soft: #e7f0f2; --on-accent: #ffffff;
  --login: #4f46e5; --login-soft: #e0e7ff;
  --ok: #15803d; --ok-soft: #dcfce7; --danger: #b91c1c; --danger-soft: #fee2e2;
  --shadow-lg: 0 24px 64px rgba(17, 24, 39, .22), 0 4px 12px rgba(17, 24, 39, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif; font-size: 14px; line-height: 1.45; color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.ic { display: inline-block; vertical-align: middle; flex: none; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.dim { color: var(--dim); } .faint { color: var(--faint); }
.small { font-size: 12.5px; } .tiny { font-size: 11.5px; } .b { font-weight: 600; }

/* page background (s01) */
.lg {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 20% 10%, #e0e7ff 0, transparent 60%),
              radial-gradient(900px 500px at 90% 90%, #e0f2fe 0, transparent 60%), #f8fafc;
}
.lc {
  width: 400px; max-width: 100%; padding: 34px 34px 26px; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg);
}
.lc h1 { font-size: 22px; margin: 18px 0 4px; font-weight: 700; }
.sub { color: var(--dim); margin: 0 0 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.logo { width: 34px; height: 34px; display: block; flex: none; }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .field .lbl { font-size: 13px; font-weight: 500; }
.input {
  height: 40px; width: 100%; border: 1px solid var(--border2); border-radius: 9px; padding: 0 12px;
  background: #fff; color: var(--text); font: inherit; font-size: 14px;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.ro { display: flex; align-items: center; justify-content: space-between; background: var(--alt); color: var(--dim); }
.pw { position: relative; }
.pw .input { padding-right: 44px; }
.eye {
  position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.eye .off { display: none; }
.eye[aria-pressed="true"] .on { display: none; }
.eye[aria-pressed="true"] .off { display: inline-block; }
.hint { font-size: 12.5px; color: var(--dim); }
.hint.as { margin-bottom: 18px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--border2); background: var(--card); color: var(--text); font: inherit; font-weight: 500;
  white-space: nowrap; cursor: pointer; text-decoration: none;
}
.btn:focus-visible, .eye:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--login); outline-offset: 2px; }
.btn.full { width: 100%; justify-content: center; height: 42px; }
.btn.lgbtn { background: var(--login); border-color: var(--login); color: #fff; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 30px; padding: 0; justify-content: center; }
.btn[disabled] { opacity: .45; cursor: default; }
.chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11.5px;
  font-weight: 500; background: var(--alt); border: 1px solid var(--border); color: var(--dim); margin-left: 6px;
}
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12.5px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.lfoot { margin-top: 22px; text-align: center; font-size: 12px; color: var(--faint); }
.lfoot a { color: var(--faint); text-decoration: none; }
.lfoot a:hover { text-decoration: underline; }

/* messages */
.msg { border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 0 0 14px; }
.msg.error { background: var(--danger-soft); color: #7f1d1d; }
.msg.ok { background: var(--ok-soft); color: #14532d; }

/* six code boxes (s02) */
.otp { display: flex; gap: 8px; margin: 8px 0 6px; }
.otp-d {
  width: 48px; height: 56px; border: 1px solid var(--border2); border-radius: 10px; text-align: center;
  font: inherit; font-size: 24px; font-weight: 600; color: var(--text); background: #fff; padding: 0;
}
.otp-d:focus { outline: none; border-color: var(--login); box-shadow: 0 0 0 3px var(--login-soft); }
.back { display: flex; margin-top: 16px; font-size: 12.5px; }
.back a { text-decoration: none; }

/* signed-in page */
.panel { padding: 14px; border-radius: 12px; background: var(--alt); border: 1px solid var(--border); color: var(--dim); margin-bottom: 14px; }
.sec { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 14px; }
.sec .r { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.sec form { margin: 0; }

/* setup */
.steps { display: flex; align-items: center; gap: 10px; margin: -8px 0 16px; }
.steps .bar { flex: 1; height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
.steps .bar i { display: block; height: 100%; background: var(--login); }
.steps .s1of4 { width: 25%; } .steps .s2of4 { width: 50%; } .steps .s3of4 { width: 75%; } .steps .s4of4 { width: 100%; }
.steps .s1of3 { width: 33.3%; } .steps .s2of3 { width: 66.6%; } .steps .s3of3 { width: 100%; }
.opt {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border2); border-radius: 12px;
  margin-bottom: 10px; cursor: pointer;
}
.opt .grow > span { display: block; }
.opt input { accent-color: var(--login); width: 18px; height: 18px; margin: 0; }
.opt:has(input:checked) { border-color: var(--login); box-shadow: 0 0 0 3px var(--login-soft); }
.opt.off { cursor: default; background: var(--alt); }
.mailto { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); margin-bottom: 12px; font-size: 13px; }
.resend { display: flex; justify-content: center; margin-top: 10px; }
.done { color: var(--ok); margin-top: 18px; }

/* authenticator dialog (s12) */
.dlg { width: 560px; max-width: 100%; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.dlg .mh { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.dlg .mh h1 { margin: 0; font-size: 17px; font-weight: 600; flex: 1; }
.dlg .mh form { margin: 0; }
.dlg .mb { padding: 18px 20px; }
.dlg .mb .steps { margin: 0 0 14px; }
.dlg .mf { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--alt); }
.dlg .mf form { margin: 0; }
.qrrow { display: flex; gap: 20px; align-items: flex-start; }
.qrbox { padding: 8px; border: 1px solid var(--border); border-radius: 12px; flex: none; }
.qr { width: 168px; height: 168px; display: block; }
.step { display: block; margin-bottom: 6px; }
label.step { margin: 18px 0 6px; }
.key { margin-top: 10px; }
.key summary { list-style: none; width: max-content; }
.key summary::-webkit-details-marker { display: none; }
.keytext { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.keytext code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; letter-spacing: .5px; word-break: break-all; }
.input.code { width: 180px; font-size: 18px; letter-spacing: 4px; }

/* ---------------------------------------------------------------------------
   SD.5: project selection (s03), settings (s10, s11), shared bits.
   Values from mock/base.py (BASE_CSS, SET_CSS) and mock/studio.py. The
   settings use the studio accent (#1f4e5a) like the mockups; the sign-in
   cards keep the neutral indigo of s01. Contrast (white background): accent
   #1f4e5a 9.4:1, chip.ok #15803d on #dcfce7 4.6:1, accent on #e7f0f2 8.2:1.
   --------------------------------------------------------------------------- */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.js .nojs { display: none; }
.chip.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chip.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.chip .ic { margin-right: 4px; }
.avatar { display: inline-flex; border-radius: 50%; overflow: hidden; flex: none; background: var(--alt); }
.avatar img, .avatar svg, .avatar canvas { width: 100%; height: 100%; display: block; object-fit: cover; }
.avatar.s22 { width: 22px; height: 22px; } .avatar.s72 { width: 72px; height: 72px; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; gap: 6px; }
.linkbtn:focus-visible { outline: 2px solid var(--login); outline-offset: 2px; }

/* s03 */
.pick { width: 440px; max-width: 100%; display: flex; flex-direction: column; gap: 14px; }
.phead { margin-bottom: 6px; }
.phead h1 { font-size: 24px; margin: 18px 0 4px; font-weight: 700; }
.phead .sub { margin: 0; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pcard {
  display: flex; gap: 14px; align-items: center; padding: 18px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 1px 2px rgba(17, 24, 39, .06), 0 4px 16px rgba(17, 24, 39, .06); text-decoration: none; color: var(--text);
}
.pcard:hover { border-color: var(--border2); }
.pcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plogo { width: 52px; height: 52px; border-radius: 12px; flex: none; display: block; object-fit: contain; }
.plogo.tile { display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 18px; }
.pname { display: block; font-weight: 600; font-size: 16px; }
.psub { display: block; color: var(--dim); font-size: 12.5px; }
.pchips { margin-top: 8px; }
.pchips .chip { height: 26px; padding: 0 10px; font-size: 12.5px; margin: 0; }
.chev { color: var(--text); }
.pfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12.5px; color: var(--dim); }
.pfoot form { margin: 0; }
.pfoot .me { text-decoration: none; color: var(--dim); }

/* settings dialog on its own page (s10, s11) */
.setpage { width: 940px; max-width: 100%; }
.setw { min-height: 640px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; overflow: hidden; }
.snav { width: 250px; flex: none; background: var(--alt); border-right: 1px solid var(--border); padding: 16px 10px; }
.snav .h { font-weight: 600; font-size: 16px; padding: 4px 10px 14px; }
.snav .it { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 9px; color: var(--text); text-decoration: none; }
.snav .it.on { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); font-weight: 600; color: var(--accent); }
.snav .it:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sbody { flex: 1; min-width: 0; padding: 22px 28px; position: relative; }
.sbody h2 { margin: 0 0 4px; font-size: 19px; padding-right: 40px; }
.sbody > .dim { margin-bottom: 16px; }
.sbody .msg { margin: 0 0 12px; }
.xclose { position: absolute; right: 14px; top: 14px; color: var(--text); }
.sbody .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: auto; }
.drop { border: 1.5px dashed var(--border2); border-radius: 12px; padding: 16px; display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.drop form { margin: 0; }
.drop label.btn { cursor: pointer; }
.drop:has(input:focus-visible) label.btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.two { display: flex; gap: 14px; }
.inwrap { position: relative; display: flex; align-items: center; }
.inwrap .input { padding-right: 130px; }
.inwrap .chip { position: absolute; right: 8px; height: 26px; padding: 0 10px; font-size: 12.5px; margin: 0; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.pf.narrow { max-width: 420px; }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 13px; margin-top: 16px; }
.callout.pend .otp { margin: 10px 0 0; }
.pform { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.pform .otp-d { width: 40px; height: 46px; font-size: 20px; }
.pbtns { margin-top: 6px; gap: 4px; }
.pbtns form { margin: 0; }
.opts { display: flex; gap: 12px; margin: 0; flex-wrap: wrap; }
.opts .opt { flex: 1; min-width: 220px; align-items: flex-start; padding: 14px; border-color: var(--border); margin: 0; }
.opts .opt input { accent-color: var(--accent); margin-top: 1px; }
.opts .opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.opts .opt .chip { height: 20px; margin-left: 10px; }
.opts .nojs { align-self: center; }
.sbody .sec { margin: 16px 0 0; }
.sbody .sec .r { padding: 13px 16px; border-bottom: 1px solid var(--border); }
.sbody .sec .r:last-child { border-bottom: 0; }
.sbody .sec .r.tip { gap: 16px; }
.sbody .opt { cursor: pointer; }

@media (max-width: 760px) {
  .setw { flex-direction: column; min-height: 0; }
  .snav { width: auto; border-right: 0; border-bottom: 1px solid var(--border); display: flex; gap: 4px; flex-wrap: wrap; padding: 10px; }
  .snav .h { width: 100%; padding: 4px 10px 6px; }
  .sbody { padding: 18px 16px; }
  .two { flex-direction: column; gap: 0; }
  .drop { flex-wrap: wrap; }
}

@media (max-width: 520px) {
  .lc { padding: 26px 20px 20px; }
  .otp { gap: 6px; } .otp-d { width: 42px; height: 52px; }
  .qrrow { flex-direction: column; align-items: center; }
}

/* SD.9: settings inside the studio's dialog (frame, ?embed=<project>). The
   studio dialog brings the side navigation and the close button, so the
   page shows only its content on white, filling the frame. */
.center { text-align: center; }
body.lg.embed { background: #fff; display: block; min-height: 0; padding: 0; }
body.embed .setpage { width: 100%; }
body.embed .setw { min-height: 0; box-shadow: none; border-radius: 0; }
body.embed .snav, body.embed .xclose { display: none; }
body.embed .sbody { padding: 22px 28px; }

/* SD.19: legal pages (/recht/*, lib/legal.js) and the "Entwurf" tag.
   Amber pair #78350f on #fef3c7 (draft) is well above WCAG 4.5:1. */
.msg.warn { background: #fef3c7; color: #78350f; }
.draft {
  display: inline-block; padding: 0 6px; margin-left: 2px; border-radius: 6px; font-size: 11px; font-weight: 600;
  line-height: 17px; background: #fef3c7; color: #78350f; vertical-align: baseline;
}
.legal {
  width: 780px; max-width: 100%; padding: 30px 38px 24px; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg);
}
.legal > .row { margin-bottom: 18px; }
.legal > .row a { text-decoration: none; }
.legal > .row a:hover { text-decoration: underline; }
.legaltext { color: var(--text); font-size: 14px; line-height: 1.6; }
.legaltext h1 { font-size: 22px; line-height: 1.3; margin: 6px 0 12px; }
.legaltext h2 { font-size: 17px; margin: 24px 0 8px; }
.legaltext h3 { font-size: 15px; margin: 18px 0 6px; }
.legaltext p, .legaltext ul, .legaltext ol { margin: 0 0 10px; }
.legaltext ul, .legaltext ol { padding-left: 22px; }
.legaltext li { margin: 3px 0; }
.legaltext blockquote { margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid #d97706; background: #fffbeb; border-radius: 0 8px 8px 0; color: #78350f; }
.legaltext blockquote p { margin: 0; }
.legaltext code { font-size: 12.5px; background: var(--alt); border: 1px solid var(--border); border-radius: 5px; padding: 0 4px; }
.legaltext hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }
.legal .lfoot a[aria-current] { color: var(--text); font-weight: 600; }
@media (max-width: 600px) { .legal { padding: 22px 18px 18px; border-radius: 14px; } }
