/* KLO Guest House — kiosk styles
   Palette taken from the building itself: limestone facade, the black entrance
   door, and the yellow door beside it. */

:root {
  --stone:       #EFEAE1;
  --stone-deep:  #DCD3C4;
  --paper:       #FBF9F5;
  --ink:         #191713;
  --ink-soft:    #6B6157;
  --yellow:      #F3C218;
  --yellow-deep: #D9A800;
  --green:       #2F6B4F;
  --alert:       #A33B2A;

  --r: 14px;
  --shadow: 0 2px 0 var(--stone-deep), 0 12px 28px rgba(25, 23, 19, .10);
  --font-display: "Bricolage Grotesque", "Public Sans", system-ui, sans-serif;
  --font-body:    "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body.kiosk {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-image: radial-gradient(circle at 20% 0%, rgba(255,255,255,.65), transparent 55%);
}

.wrap { width: min(1100px, 92vw); margin: 0 auto; }
body.kiosk > .wrap { flex: 1; display: flex; flex-direction: column; }

/* ---------- Header ---------- */
.topbar {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; padding: 26px 0 10px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700; font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -.02em; margin: 0;
}
.brand small {
  display: block; font-family: var(--font-mono); font-weight: 400;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); margin-top: 4px;
}
.clock {
  font-family: var(--font-mono); font-size: 15px; color: var(--ink-soft);
  text-align: right; white-space: nowrap;
}
.clock b { display: block; font-size: 22px; color: var(--ink); font-weight: 500; }

/* ---------- Doors (the two main kiosk actions) ---------- */
.doors {
  flex: 1;
  display: grid; grid-template-columns: repeat(2, minmax(0, 300px));
  justify-content: center; align-items: stretch;
  gap: clamp(20px, 5vw, 64px); padding: clamp(16px, 3vh, 40px) 0 30px;
}
.door {
  position: relative; display: flex; flex-direction: column;
  justify-content: flex-end; gap: 6px;
  min-height: min(60vh, 540px);
  padding: 30px 26px 34px;
  border: none; cursor: pointer; text-align: left; text-decoration: none;
  border-radius: 150px 150px 8px 8px;   /* arched top, like the entrance */
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  transition: transform .18s ease, box-shadow .18s ease;
}
.door:hover  { transform: translateY(-4px); box-shadow: 0 2px 0 var(--stone-deep), 0 20px 38px rgba(25,23,19,.16); }
.door:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--stone-deep), 0 6px 14px rgba(25,23,19,.14); }
.door:focus-visible { outline: 4px solid var(--ink); outline-offset: 4px; }

.door-in  { background: var(--yellow); color: var(--ink); }
.door-out { background: var(--ink);    color: var(--paper); }

.door .knob {
  position: absolute; right: 22px; top: 56%;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(25,23,19,.32);
}
.door-out .knob { background: rgba(243,194,24,.85); }

.door .panel {
  position: absolute; inset: 26px 22px 120px;
  border: 2px solid rgba(25,23,19,.16); border-radius: 128px 128px 5px 5px;
  pointer-events: none;
}
.door-out .panel { border-color: rgba(251,249,245,.16); }

.door h2 { font-size: clamp(28px, 3.6vw, 42px); margin: 0; letter-spacing: -.03em; line-height: 1; }
.door p  { font-family: var(--font-body); font-size: 16px; margin: 0; opacity: .78; }

/* ---------- Status strip ---------- */
.status {
  display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center;
  padding: 16px 0 28px; font-size: 15px; color: var(--ink-soft);
  border-top: 1px solid var(--stone-deep);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 8px; }
.status a { color: var(--ink-soft); }

/* ---------- Cards & forms ---------- */
.card {
  background: var(--paper); border-radius: var(--r);
  box-shadow: var(--shadow); padding: clamp(20px, 3vw, 34px); margin-bottom: 22px;
}
h1.page {
  font-family: var(--font-display); font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -.03em; margin: 22px 0 4px;
}
.lede { color: var(--ink-soft); margin: 0 0 22px; }

.field { margin-bottom: 20px; }
.field > label {
  display: block; font-weight: 600; font-size: 15px; margin-bottom: 7px;
  letter-spacing: .01em;
}
.field .hint { font-weight: 400; color: var(--ink-soft); }

input[type=text], input[type=tel], input[type=email], input[type=number],
input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 16px 16px; font: inherit; font-size: 18px;
  color: var(--ink); background: #fff;
  border: 2px solid var(--stone-deep); border-radius: 10px;
  appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 22px) 24px, calc(100% - 15px) 24px;
  background-size: 7px 7px, 7px 7px; background-repeat: no-repeat; padding-right: 44px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(243,194,24,.45);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Big tappable radio choices */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.choice {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  border: 2px solid var(--stone-deep); border-radius: 10px; background: #fff; cursor: pointer;
}
.choice input { accent-color: var(--ink); width: 22px; height: 22px; margin: 0; }
.choice:has(input:checked) { border-color: var(--ink); background: #FFF9E2; }
.choice:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(243,194,24,.45); }

/* Signature pad */
.sigwrap { position: relative; }
canvas.sigpad {
  width: 100%; height: 200px; background: #fff; touch-action: none;
  border: 2px dashed var(--stone-deep); border-radius: 10px; display: block;
}
.sigline {
  position: absolute; left: 26px; right: 26px; bottom: 92px;
  border-bottom: 1px solid var(--stone-deep); pointer-events: none;
}
.sigbar { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 14px; color: var(--ink-soft); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 18px 30px; min-height: 58px; font: inherit; font-weight: 600; font-size: 18px;
  border: 2px solid var(--ink); border-radius: 10px; cursor: pointer; text-decoration: none;
  background: var(--ink); color: var(--paper); transition: transform .12s ease;
}
.btn:active { transform: translateY(2px); }
.btn-yellow { background: var(--yellow); border-color: var(--yellow-deep); color: var(--ink); }
.btn-ghost  { background: transparent; color: var(--ink); }
.btn-sm     { padding: 10px 16px; min-height: 44px; font-size: 15px; }
.btn:focus-visible { outline: 4px solid var(--yellow-deep); outline-offset: 3px; }
.actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }

/* People currently inside */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.person {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  background: var(--paper); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow);
  border-left: 6px solid var(--yellow);
}
.person .who { font-weight: 600; font-size: 19px; }
.person .meta { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); margin-top: 3px; }

/* Confirmation screen */
.confirm { text-align: center; padding: 12vh 0; }
.confirm .mark {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 26px;
  background: var(--yellow); display: grid; place-items: center; font-size: 46px;
}
.confirm.out .mark { background: var(--ink); color: var(--yellow); }
.confirm h1 { font-family: var(--font-display); font-size: clamp(34px, 6vw, 60px); margin: 0 0 10px; letter-spacing: -.03em; }
.confirm p { color: var(--ink-soft); font-size: 20px; margin: 0; }
.countdown { font-family: var(--font-mono); font-size: 14px; color: var(--ink-soft); margin-top: 34px; }

/* Messages */
.msg { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 16px; }
.msg-error { background: #FBE7E3; color: var(--alert); border: 1px solid #E7BDB4; }
.msg-info  { background: #FFF6D9; color: #7A5C00; border: 1px solid #EBD79A; }

/* Admin tables */
table.log { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--paper); }
table.log th, table.log td { padding: 12px 12px; text-align: left; border-bottom: 1px solid var(--stone-deep); vertical-align: top; }
table.log th { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
table.log tr:hover td { background: #FFFCF1; }
.tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--stone-deep); color: var(--ink); white-space: nowrap; }
.tag.inside { background: var(--yellow); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--paper); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); }
.stat b { font-family: var(--font-display); font-size: 34px; display: block; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin-bottom: 0; }
.tablescroll { overflow-x: auto; border-radius: var(--r); box-shadow: var(--shadow); }

@media (max-width: 720px) {
  .doors { grid-template-columns: 1fr; }
  .door { min-height: 210px; border-radius: 120px 120px 10px 10px; }
  .door .panel { inset: 40px 20px 70px; }
  .row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .btn, .doors, .status, .filters { display: none !important; }
  body { background: #fff; }
}
