:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --slate: #131d29;
  --slate-hover: #1d2c3e;
  --crimson: #a61c24;
  --crimson-hover: #88151c;
  --crimson-soft: #fdf2f2;
  --gold: #e59e20;
  --gold-soft: #fef7e8;
  --text: #0f172a;
  --muted: #475569;
  --border: #cbd5e1;
  --danger: #b91c1c;
  --success: #15803d;
  --radius: 18px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  touch-action: manipulation;
}

.brand-ribbon {
  height: 6px;
  width: 100%;
  background: linear-gradient(90deg, var(--crimson) 0%, var(--crimson) 62%, var(--gold) 100%);
}

.kiosk-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 20px 32px;
  min-height: calc(100vh - 6px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.kiosk-header {
  text-align: center;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(19, 29, 41, 0.06);
  margin-bottom: 12px;
}

.brand-logo {
  display: block;
  max-height: 62px;
  width: auto;
  max-width: 100%;
}

.badge-anon {
  display: inline-block;
  background: var(--gold-soft);
  color: #8a5600;
  border: 1px solid rgba(229, 158, 32, 0.35);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  margin: 0 auto 10px;
}

.kiosk-header h1 {
  margin: 0 0 6px;
  font-size: clamp(1.55rem, 3.2vw, 2.2rem);
  color: var(--slate);
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 12px 32px rgba(19, 29, 41, 0.08);
  border: 1px solid #dce3ec;
}

.hidden {
  display: none !important;
}

.question-block {
  margin-bottom: 24px;
}

.question-label {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--slate);
}

.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Step 1: Primary Branch Cards */
.branch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.branch-card-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 4px;
  padding: 16px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: #f8fafc;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.branch-card-btn .branch-icon {
  font-size: 1.7rem;
  line-height: 1;
  margin-bottom: 4px;
}

.branch-card-btn .branch-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate);
}

.branch-card-btn .branch-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.3;
}

.branch-card-btn.selected {
  border-color: var(--crimson);
  background: var(--crimson-soft);
  box-shadow: 0 0 0 3px rgba(166, 28, 36, 0.12);
  transform: translateY(-1px);
}

/* Step 2: Dynamic Branch Follow-up */
.branch-followup {
  padding: 20px;
  margin-bottom: 24px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--gold);
}

.branch-followup .question-block:last-child {
  margin-bottom: 0;
}

.subratings-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.subrating-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.subrating-title {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--slate);
}

.subrating-pills {
  display: flex;
  gap: 6px;
}

.sub-pill {
  min-width: 44px;
  height: 42px;
  padding: 0 10px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #f8fafc;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--slate);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.sub-pill.selected {
  border-color: var(--slate);
  background: var(--slate);
  color: #ffffff;
}

.subrating-scale-hint {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: -4px;
}

/* Step 3: Overall Rating Grid */
.rating-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.rating-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 86px;
  padding: 12px 6px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: #f8fafc;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}

.rating-btn .emoji {
  font-size: 2rem;
  line-height: 1;
}

.rating-btn .rating-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.rating-btn.selected {
  border-color: var(--crimson);
  background: var(--crimson-soft);
  transform: translateY(-2px);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-btn {
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: #ffffff;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.chip-btn.selected {
  border-color: var(--crimson);
  background: var(--crimson);
  color: #ffffff;
}

textarea, input[type="password"], input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--border);
  font-size: 1.02rem;
  font-family: inherit;
  color: var(--text);
  background: #ffffff;
}

textarea:focus, input:focus {
  outline: none;
  border-color: var(--crimson);
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field span {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 14px;
  background: var(--crimson);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-large {
  min-height: 62px;
  padding: 16px 24px;
}

.btn-primary:hover {
  background: var(--crimson-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-msg {
  color: var(--danger);
  font-weight: 600;
  margin: 0 0 14px;
}

.splash-card {
  text-align: center;
  padding: 48px 28px;
}

.splash-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #dcfce7;
  color: var(--success);
  font-size: 2.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-card h2 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  color: var(--slate);
}

.countdown-pill {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 20px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 1rem;
}

.kiosk-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0 6px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 6px 8px;
}

@media (max-width: 680px) {
  .branch-grid {
    grid-template-columns: 1fr;
  }
  .rating-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .card {
    padding: 20px;
  }
}
