:root {
  --bg: #f7f2ea;
  --card: #fffdf8;
  --text: #181716;
  --muted: #6f6a61;
  --line: rgba(24, 23, 22, 0.09);
  --primary: #111827;
  --accent: #8a6a3f;
  --soft: #efe5d6;
  --danger: #9f1d1d;
  --danger-bg: #fff4e5;
  --success: #2f6f4e;
  --success-bg: #e8f5ee;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.8), transparent 38rem),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* ─── shell & cards ─────────────────────────────────────────────────────── */

.app-shell {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 22px 16px 40px;
  box-sizing: border-box;
}

.card,
.brand-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(31, 25, 18, 0.08);
  padding: 20px;
  margin-bottom: 14px;
}

.brand-card {
  text-align: center;
  padding-top: 26px;
}

.brand-logo {
  width: 168px;
  max-width: 70%;
  height: auto;
  display: block;
  margin: 0 auto 14px;
}

.brand-kicker {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.brand-copy {
  margin: 10px auto 0;
  max-width: 320px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.card-heading {
  margin-bottom: 16px;
}

.card-eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.card-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  color: var(--text);
}

/* ─── stay info list ────────────────────────────────────────────────────── */

.info-list {
  display: grid;
  gap: 12px;
}

.info-row {
  padding: 14px;
  background: rgba(239, 229, 214, 0.45);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.info-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.info-row p {
  margin: 0;
  line-height: 1.6;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.secondary-button,
button.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}

.key-box {
  padding: 16px;
  border-radius: 16px;
  background: #181716;
  color: #fffdf8;
}

.key-box .info-label {
  color: rgba(255, 255, 255, 0.68);
}

.key-value {
  display: inline-block;
  margin-top: 2px;
  font-size: 22px;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.locked-box {
  padding: 14px;
  border-radius: 16px;
  background: #f1ece4;
  color: var(--muted);
  border: 1px dashed rgba(24, 23, 22, 0.18);
}

.locked-box p {
  margin: 6px 0 0;
  line-height: 1.55;
  font-size: 13px;
}

.hidden { display: none !important; }

/* ─── forms (legacy classes preserved) ──────────────────────────────────── */

.field {
  margin: 14px 0;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.input,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 13px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.textarea {
  min-height: 86px;
  resize: vertical;
}

.input:focus,
.textarea:focus {
  border-color: var(--accent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin-top: 6px;
  padding: 0 18px;
  border: none;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.18);
}

.button.secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--line);
  box-shadow: none;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.choice {
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.choice.selected {
  border-color: var(--accent);
  background: var(--soft);
}

.upload-box {
  position: relative;
  margin-top: 10px;
  padding: 22px 16px;
  border: 1.5px dashed rgba(138, 106, 63, 0.55);
  background: #fffaf2;
  border-radius: 18px;
  text-align: center;
  overflow: hidden;
}

.upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  border-radius: 16px;
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 24px;
  box-shadow: 0 8px 18px rgba(138, 106, 63, 0.18);
}

.upload-box b {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.upload-box small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.preview {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  align-items: center;
  gap: 12px;
}

.preview.active { display: flex; }

.preview img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 10px;
  background: #f2f4f7;
}

.mini-note {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(24, 23, 22, 0.05);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.error {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.error.active { display: block; }

/* ─── guest cards (legacy classes preserved) ────────────────────────────── */

.guest-card {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafaf6;
}

.guest-card.selected {
  border-color: var(--accent);
  background: var(--soft);
}

.guest-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.guest-card b {
  color: var(--text);
  font-size: 14px;
}

.status-pill {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.status-pill.done {
  color: var(--success);
  background: var(--success-bg);
}

.status-pill.pending {
  color: var(--danger);
  background: var(--danger-bg);
}

.select-guest {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

/* ─── lookup card extras ────────────────────────────────────────────────── */

.lookup-card .input {
  margin-bottom: 6px;
}

.turnstile-widget {
  margin: 12px 0;
}

.lang-row {
  margin-top: 14px;
  text-align: right;
}

.lang {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

/* ─── tablet & desktop tweaks ───────────────────────────────────────────── */

@media (min-width: 720px) {
  .app-shell {
    padding-top: 36px;
  }
  .brand-logo {
    width: 210px;
  }
}
