/* ═══════════════════════════════════════════════════════════
   Kiosk screen — used by the device page (/k/<token>) and the
   live preview in the kiosk editor. Designed on a fixed stage
   (1280×800 landscape / 800×1280 portrait) scaled to fit.
   ═══════════════════════════════════════════════════════════ */

.ks-viewport {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--ks-bg, #f7f9ff) center / cover no-repeat;
}
.ks-stage {
  --ks-accent: #00654b; --ks-accent-text: #fff; --ks-text: #141c25; --ks-bg: #f7f9ff;
  position: absolute; left: 50%; top: 50%;
  width: 1280px; height: 800px; transform-origin: center center;
  background: var(--ks-bg) center / cover no-repeat;
  color: var(--ks-text); font-family: 'Inter', system-ui, sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
  user-select: none; -webkit-user-select: none;
}
.ks-stage * { box-sizing: border-box; }
/* Tint over the background image, under the content */
.ks-stage::before { content: ''; position: absolute; inset: 0; background: var(--ks-overlay, transparent); pointer-events: none; }
.ks-top, .ks-body, .ks-help, .ks-notice { position: relative; z-index: 1; }
.ks-panel { width: 100%; display: flex; flex-direction: column; align-items: center; }
.has-panel .ks-panel { background: var(--ks-panel); border-radius: 32px; padding: 44px 56px; max-width: 1120px; width: auto; min-width: 640px; box-shadow: 0 20px 50px rgba(0,0,0,.18); }
.portrait.has-panel .ks-panel { min-width: 0; width: 100%; padding: 40px 36px; }
.text-shadow .ks-title, .text-shadow .ks-sub, .text-shadow .ks-clock, .text-shadow .ks-field label { text-shadow: 0 2px 14px rgba(0,0,0,.55), 0 1px 3px rgba(0,0,0,.4); }

.ks-top { display: flex; align-items: center; justify-content: space-between; padding: 32px 44px 0; min-height: 112px; }
.ks-logo { max-height: 80px; max-width: 320px; object-fit: contain; }
.ks-clock { font: 600 var(--ks-clock-size, 22px) 'Inter', sans-serif; color: var(--ks-clock, inherit); text-align: right; }
.ks-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 72px 48px; text-align: center; min-height: 0; }
.ks-title { font: 800 var(--ks-heading-size, 64px)/1.12 'Manrope', 'Inter', sans-serif; color: var(--ks-heading, inherit); margin: 0 0 40px; white-space: pre-line; letter-spacing: -.02em; }
.ks-title-finish { font-size: var(--ks-finish-size, 56px); margin-bottom: 0; }
.ks-sub { font-size: 30px; margin: 0 0 32px; white-space: pre-line; opacity: .85; }

.ks-btn {
  border: 0; border-radius: 999px; cursor: pointer; font: 700 var(--ks-button-size, 34px) 'Inter', sans-serif;
  padding: 30px 84px; background: var(--ks-accent); color: var(--ks-accent-text);
  box-shadow: 0 12px 30px rgba(0,0,0,.18); transition: transform .08s;
}
.ks-btn:active { transform: scale(.97); }
.ks-btn:disabled { opacity: .55; }
.ks-btn-ghost { background: var(--ks-sec-bg, #fff); color: var(--ks-sec-text, #141c25); box-shadow: 0 4px 14px rgba(0,0,0,.12); font-size: calc(var(--ks-button-size, 34px) * .76); padding: 20px 44px; }
.ks-help {
  position: absolute; right: 36px; bottom: 32px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ks-help-bg, #141c25); color: var(--ks-help-text, #fff); font: 600 var(--ks-help-size, 24px) 'Inter', sans-serif; padding: .66em 1.33em; box-shadow: 0 6px 18px rgba(0,0,0,.2);
}

.ks-reasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; width: 100%; max-width: 1080px; max-height: 500px; overflow-y: auto; padding: 14px 20px 30px; }
.portrait .ks-reasons { grid-template-columns: 1fr; max-height: 820px; }
.ks-reason {
  border: 0; border-radius: 22px; padding: 30px 24px; cursor: pointer; min-height: 120px;
  font: 700 var(--ks-reason-size, 30px) 'Inter', sans-serif; background: var(--ks-accent); color: var(--ks-accent-text);
  box-shadow: 0 8px 22px rgba(0,0,0,.14); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.ks-reason:active { transform: scale(.98); }
.ks-reason.closed { opacity: .45; cursor: not-allowed; }
.ks-reason small { font-size: 18px; font-weight: 500; opacity: .9; }

.ks-form { width: 100%; max-width: 760px; display: grid; gap: 22px; text-align: left; }
.ks-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.ks-row3 { display: grid; grid-template-columns: 2fr 1fr 1.3fr; gap: 16px; }
.ks-field label { display: block; font-size: calc(var(--ks-form-size, 30px) * .73); font-weight: 600; margin: 0 0 8px; color: var(--ks-label, inherit); }
.ks-field input, .ks-field select {
  width: 100%; font: 500 var(--ks-form-size, 30px) 'Inter', sans-serif; padding: .6em .66em; border-radius: 14px;
  border: 2px solid rgba(20,28,37,.18); background: #fff; color: #141c25;
}
.ks-field input:focus, .ks-field select:focus { outline: none; border-color: var(--ks-accent); }
.ks-error { background: #fef2f2; color: #991b1b; border-radius: 14px; padding: 14px 18px; font-size: 22px; font-weight: 600; }
.ks-actions { display: flex; justify-content: center; gap: 20px; margin-top: 12px; }

.ks-check {
  width: 140px; height: 140px; border-radius: 50%; background: var(--ks-accent); color: var(--ks-accent-text);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 36px;
}
.ks-check svg { width: 76px; height: 76px; }
.ks-overlay { position: absolute; inset: 0; background: rgba(20,28,37,.78); display: flex; align-items: center; justify-content: center; z-index: 5; }
.ks-card { background: #fff; color: #141c25; border-radius: 28px; padding: 56px 64px; max-width: 760px; text-align: center; font-size: 32px; font-weight: 600; }
.ks-card .ks-btn { margin-top: 32px; }
.ks-notice { position: absolute; left: 0; right: 0; bottom: 0; background: #141c25; color: #fff; font-size: 20px; padding: 10px; text-align: center; }

/* Language choice on the welcome screen */
.ks-langs { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 44px; max-width: 1080px; }
.ks-lang {
  border: 2px solid transparent; border-radius: 999px; padding: 12px 28px; cursor: pointer;
  font: 600 24px 'Inter', sans-serif; background: var(--ks-sec-bg, #fff); color: var(--ks-sec-text, #141c25);
  box-shadow: 0 3px 10px rgba(0,0,0,.1);
}
.ks-lang.active { border-color: var(--ks-accent); background: var(--ks-accent); color: var(--ks-accent-text); }
.ks-lang:active { transform: scale(.97); }
