/* Survey TOM — design tokens & base */
:root {
  --primary: oklch(0.52 0.18 265);
  --primary-600: oklch(0.46 0.19 265);
  --primary-50: oklch(0.97 0.02 265);
  --primary-100: oklch(0.93 0.04 265);
  --accent: oklch(0.78 0.16 75);
  --accent-soft: oklch(0.94 0.06 75);
  --success: oklch(0.68 0.15 155);
  --success-soft: oklch(0.95 0.05 155);
  --danger: oklch(0.62 0.20 25);
  --danger-soft: oklch(0.95 0.05 25);

  --bg: oklch(0.985 0.003 265);
  --bg-2: oklch(0.97 0.005 265);
  --surface: #ffffff;
  --ink: oklch(0.22 0.02 265);
  --ink-2: oklch(0.40 0.02 265);
  --ink-3: oklch(0.58 0.015 265);
  --ink-4: oklch(0.72 0.012 265);
  --line: oklch(0.92 0.006 265);
  --line-2: oklch(0.88 0.008 265);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(20, 22, 40, 0.04), 0 1px 1px rgba(20,22,40,0.03);
  --shadow-md: 0 4px 16px -6px rgba(20, 22, 40, 0.10), 0 1px 2px rgba(20,22,40,0.04);
  --shadow-lg: 0 18px 40px -18px rgba(20, 22, 40, 0.18), 0 2px 6px rgba(20,22,40,0.05);
  --shadow-pop: 0 30px 60px -28px rgba(40, 46, 120, 0.32);

  --font-ui: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Back-compat aliases — some components added during the brand swap still
     reference these tokens. Keep them mapped to the original palette so the
     visual matches the pre-Rinta Survey TOM design. */
  --primary-light: oklch(0.78 0.16 75);
  --primary-tint:  oklch(0.94 0.06 75);
  --accent-blue:   oklch(0.55 0.16 230);
  --dark:          oklch(0.22 0.02 265);
  --muted:         oklch(0.58 0.015 265);
  --white:         #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
}

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

/* utility primitives */
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.tnum { font-variant-numeric: tabular-nums; }
.shimmer {
  background: linear-gradient(110deg, oklch(0.96 0.01 265) 8%, oklch(0.99 0.005 265) 18%, oklch(0.96 0.01 265) 33%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position-x: -200%; } }

.fade-in { animation: fadeIn 0.32s ease-out both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.slide-up { animation: slideUp 0.4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* placeholder image */
.ph-img {
  background-image: repeating-linear-gradient(135deg, oklch(0.93 0.01 265) 0 8px, oklch(0.96 0.005 265) 8px 16px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* form controls */
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(0.52 0.18 265 / 0.15);
}
.input::placeholder { color: var(--ink-4); }
.label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.005em;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  transition: transform 80ms, background 120ms, border-color 120ms, box-shadow 120ms;
  white-space: nowrap;
}
.btn:active { transform: translateY(0.5px); }
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 0 oklch(0.42 0.19 265 / 0.6) inset, 0 1px 2px rgba(40,46,120,.18);
}
.btn-primary:hover { background: var(--primary-600); }
.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line-2);
}
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }
.btn-soft {
  background: var(--primary-50);
  color: var(--primary);
  border-color: oklch(0.88 0.06 265);
}
.btn-soft:hover { background: var(--primary-100); }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--bg-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.badge-primary { background: var(--primary-50); color: var(--primary); border-color: oklch(0.88 0.06 265); }
.badge-accent { background: var(--accent-soft); color: oklch(0.45 0.12 75); border-color: oklch(0.86 0.08 75); }
.badge-success { background: var(--success-soft); color: oklch(0.42 0.12 155); border-color: oklch(0.84 0.08 155); }

/* cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* phone frame — fixed 390×780 in design canvas, full-screen on real mobile via .phone-host. */
.phone {
  width: 390px;
  height: 780px;
  background: #0c0e1a;
  border-radius: 44px;
  padding: 12px;
  box-shadow: var(--shadow-pop), 0 0 0 1.5px oklch(0.30 0.02 265);
  position: relative;
}
.phone-screen {
  width: 100%; height: 100%;
  background: var(--bg);
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.phone-screen > .phone-status-fake { flex-shrink: 0; }
.phone-screen > .fade-in { flex: 1; min-height: 0; }
.phone-notch {
  position: absolute;
  top: 18px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 28px;
  background: #000;
  border-radius: 14px;
  z-index: 50;
}

/* Responder route — full-bleed on real phones, centered preview on desktop. */
.phone-host {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg-2);
}
@media (max-width: 480px) {
  .phone-host { padding: 0; min-height: 100dvh; }
  .phone-host .phone {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
  .phone-host .phone-screen { border-radius: 0; }
  .phone-host .phone-notch { display: none; }
  .phone-host .phone-status-fake { display: none !important; }
}

/* desktop frame */
.desktop {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.desktop-bar {
  height: 36px;
  background: oklch(0.96 0.006 265);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
  padding: 0 14px;
  gap: 8px;
}
.desktop-dots { display: flex; gap: 6px; }
.desktop-dot { width: 10px; height: 10px; border-radius: 50%; background: oklch(0.85 0.02 265); }
.desktop-dot:nth-child(1) { background: oklch(0.78 0.13 25); }
.desktop-dot:nth-child(2) { background: oklch(0.85 0.13 80); }
.desktop-dot:nth-child(3) { background: oklch(0.80 0.13 145); }
.desktop-url {
  flex: 1; text-align: center;
  font-size: 12px; color: var(--ink-3);
  font-family: var(--font-mono);
}

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
  margin-bottom: -1px;
  background: none; border-left: none; border-right: none; border-top: none;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab:hover:not(.active) { color: var(--ink-2); }

/* progress */
.progress { height: 6px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); transition: width 320ms ease; }

/* scrollbars (subtle) */
.scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll::-webkit-scrollbar-thumb { background: oklch(0.86 0.01 265); border-radius: 8px; }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* tooltip-ish */
.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 5px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-3);
}
