/* ==========================================================================
   ING QR-Bridge – Stylesheet
   Farbwelt an ING angelehnt: Orange #FF6200, fast-schwarze Typo, viel Weiß.
   ========================================================================== */

:root {
  --orange: #ff6200;
  --orange-dark: #e05600;
  --orange-soft: #fff2e8;
  --ink: #1d1d1b;
  --ink-soft: #3b3b39;
  --muted: #6b6b68;
  --line: #e4e4e1;
  --bg: #f4f4f2;
  --card: #ffffff;
  --ok: #0f8b4c;
  --ok-soft: #e8f6ee;
  --warn: #a85400;
  --warn-soft: #fff4e0;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .05), 0 8px 24px rgba(20, 20, 20, .06);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--orange-dark); }
img { max-width: 100%; }

.hint { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- Brandbar ---------- */

.brandbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brandbar .brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--orange);
  line-height: 1;
}

.brandbar .brand-note {
  font-size: 13px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.brandbar .spacer { flex: 1; }

/* ---------- Buttons ---------- */

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s;
  white-space: nowrap;
}

.btn:hover { background: #fafafa; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.btn.primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }

.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #f2f2f0; color: var(--ink); }

.btn.danger { color: var(--danger); border-color: #f0d4d2; background: #fff6f5; }
.btn.danger:hover { background: #ffeceb; }

.btn.small { padding: 7px 12px; font-size: 13.5px; border-radius: 9px; }
.btn.wide { width: 100%; padding: 14px; font-size: 16.5px; }

/* ---------- Pills / Badges ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f0f0ee;
  color: var(--muted);
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .8;
}

.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.live { background: var(--orange-soft); color: var(--orange-dark); }

/* ---------- Landing ---------- */

.landing {
  max-width: 460px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.landing h1 { font-size: 26px; margin-bottom: 8px; }
.landing .lead { color: var(--muted); margin-bottom: 26px; }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }

.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 98, 0, .12); }

.input.code-input {
  font-size: 24px;
  letter-spacing: .22em;
  text-align: center;
  text-transform: uppercase;
  font-weight: 700;
  padding: 14px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12.5px;
  margin: 26px 0 18px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.landing .operator {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Gast-Seite ---------- */

.guest-body { background: #fff; }

.guest {
  max-width: 460px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 60px);
}

.guest h1 { font-size: 23px; margin-bottom: 6px; }

.guest .sub {
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 18px;
}

.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f0f0ee;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  font-style: normal;
  transition: background .2s, color .2s;
}

.step-dot.active { background: var(--orange); color: #fff; }
.step-dot.done { background: var(--ok-soft); color: var(--ok); }

.step-line { flex: 1; height: 2px; background: var(--line); border-radius: 2px; }

.qr-wrap { margin-top: 4px; }

.qr-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  box-shadow: var(--shadow);
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
}

.qr-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}

.qr-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.guest.zoomed { overflow: hidden; }

body.zoomed .qr-card {
  position: fixed;
  inset: 0;
  z-index: 60;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 6px;
  box-shadow: none;
  cursor: zoom-out;
}

body.zoomed .qr-card img { max-height: 100vh; height: 100%; }

.guest .hint { margin-top: 10px; text-align: center; }

.wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 46px 0;
  color: var(--muted);
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(255, 98, 0, .18);
  border-top-color: var(--orange);
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.guest .btn.wide { margin-top: 20px; }

.feedback { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.feedback summary {
  cursor: pointer;
  font-size: 13.5px;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.feedback summary::-webkit-details-marker { display: none; }
.feedback summary::before { content: "＋"; font-weight: 700; }
.feedback[open] summary::before { content: "－"; }

.feedback-row { display: flex; gap: 8px; margin-top: 12px; }
.feedback-row .input { flex: 1; }

.done { text-align: center; padding: 40px 0; }
.done .check {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.done h2 { font-size: 20px; margin-bottom: 6px; }
.done p { color: var(--muted); font-size: 14.5px; }

/* Login-Formular im Gast-Flow */

.cred-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 6px;
}

.cred-form .field { margin: 0; }
.cred-form .row { display: flex; gap: 10px; }
.cred-form .row .field { flex: 1; }

.foot {
  margin-top: auto;
  padding-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.foot .ok { color: var(--ok); font-weight: 600; }
.foot .warn { color: var(--warn); }

/* ---------- Panel (Casher) ---------- */

.panel-body { background: var(--bg); }

.panel {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 12px;
}

.session-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.label { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }

.code {
  font: 700 30px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .12em;
  color: var(--ink);
}

.link-row { display: flex; gap: 8px; margin-top: 14px; }
.link-row .input { flex: 1; font-size: 13.5px; color: var(--ink-soft); background: #fafafa; }

.session-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.session-meta .spacer { flex: 1; }

.cols {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
}

.phone {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  border-radius: 26px;
  padding: 8px;
  background: #1d1d1b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.phone-screen {
  border-radius: 19px;
  overflow: hidden;
  background: #fff;
  height: 560px;
}

.phone-screen iframe { width: 100%; height: 100%; border: 0; display: block; }

.step-tabs { display: flex; gap: 8px; margin-bottom: 14px; }

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font: 600 14px/1 inherit;
  font-family: inherit;
  color: var(--ink-soft);
  cursor: pointer;
}

.tab.active { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-dark); }
.tab .thumb-wrap { width: 24px; height: 24px; border-radius: 5px; overflow: hidden; background: #f0f0ee; flex: none; }
.tab .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }

.drop {
  border: 1.5px dashed #d5d5d1;
  border-radius: 12px;
  background: #fbfbfa;
  transition: border-color .15s, background .15s;
}

.drop.hover { border-color: var(--orange); background: var(--orange-soft); }

.drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 16px;
  text-align: center;
}

.drop-inner strong { font-size: 15px; }
.drop-inner span { font-size: 13px; color: var(--muted); }
.drop-inner .btn { margin-top: 8px; }

.shot {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  touch-action: none;
  user-select: none;
}

/* Wichtig für das Zuschneiden: das Element muss exakt so groß sein wie das
   gezeichnete Bild, sonst passen die Auswahlkoordinaten nicht. */
.shot img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 46vh;
  margin: 0 auto;
}

.shot.cropping { cursor: crosshair; }

.crop-box {
  position: absolute;
  border: 2px solid var(--orange);
  background: rgba(255, 98, 0, .14);
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35);
}

.work-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.work-actions .spacer { flex: 1; }

.flow { display: flex; gap: 10px; margin-top: 16px; }
.flow .btn.wide { flex: 1; }

.feedback-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--orange-soft);
  border: 1px solid #ffd9bf;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.feedback-box strong {
  font: 700 20px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .06em;
  color: var(--orange-dark);
  flex: 1;
}

.feedback-actions { display: flex; gap: 6px; }

#finishBtn { margin-top: 14px; }

#fatal { max-width: 520px; margin: 80px auto; padding: 0 20px; text-align: center; }
#fatal h1 { font-size: 22px; margin-bottom: 10px; }
#fatal p { color: var(--muted); margin-bottom: 20px; }

/* ---------- Toast ---------- */

#toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: #1d1d1b;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  animation: toast-in .18s ease-out;
}

.toast.ok { background: #0f8b4c; }
.toast.err { background: #b3261e; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Kleinzeug ---------- */

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.kv {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 4px 12px;
  font-size: 14px;
  margin-top: 10px;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
