:root {
  --bg: #f3f4f6;
  --card-bg: #ffffff;
  --primary: #2563eb;
  --primary-soft: rgba(37, 99, 235, 0.08);
  --primary-strong: #1d4ed8;
  --border-subtle: #e5e7eb;
  --text-main: #111827;
  --text-muted: #6b7280;
  --danger: #b91c1c;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-soft: 0 16px 40px rgba(15, 23, 42, 0.12);
  --transition-fast: 150ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top left, #e0f2fe, #f9fafb 55%);
  color: var(--text-main);
}

.shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.app-card {
  width: 100%;
  max-width: 1100px;
  background: var(--card-bg);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  padding: 24px 28px 28px;
}

/* Header */

.app-header isplay: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f172a, #1f2937);
  color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

h1 {
  margin: 0 0 4px;
  font-size: 1.4rem;
}

.subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Meta bar */

.meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.progress-wrapper {
  flex: 1;
}

.step-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-bar {
  height: 7px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #0ea5e9);
  transition: width 0.25s ease;
}

.insight-chip {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.form-column {
  border-right: none;
  padding-right: 0;
}

.preview-column {
  display: none;
  padding-left: 4px;
}

/* Form */

form {
  margin: 0;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

label {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: #374151;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 11px;
  border-radius: 9px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast), background-color var(--transition-fast);
  background-color: #f9fafb;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18);
}

textarea {
  resize: vertical;
}

/* Focus tiles */

.focus-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.tile {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  padding: 8px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: center;
  color: #374151;
  transition: background-color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast), color var(--transition-fast);
}

.tile:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.tile.selected {
  background: var(--primary);
  border-color: var(--primary-strong);
  color: #eff6ff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

/* Buttons */

.nav-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  border-radius: 999px;
  border: none;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-fast),
    transform var(--transition-fast), box-shadow var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.25);
}

.btn.primary:hover {
  background: var(--primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.35);
}

.btn.ghost {
  background: #f9fafb;
  color: #111827;
  border: 1px solid #d1d5db;
  box-shadow: none;
}

.btn.ghost:hover {
  background: #ffffff;
}

/* Steps */

.step {
  display: none;
  animation: fadeIn 200ms ease-out;
}

.step.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Consent (no checkbox now, but keep spacing helper if reused) */

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: #374151;
  margin-top: 12px;
}

.consent-label input {
  margin-top: 2px;
}

/* Messages */

.form-message {
  margin-top: 10px;
  font-size: 0.85rem;
  min-height: 18px;
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: #166534;
}

/* Preview (kept for JS, visually hidden via .preview-column) */

.preview-card {
  background: linear-gradient(135deg, #0f172a, #111827);
  color: #e5e7eb;
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
  position: relative;
  overflow: hidden;
}

.preview-card::before {
  content: "";
  position: absolute;
  inset: -60px;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.35), transparent 55%),
    radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.25), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}

.preview-card > * {
  position: relative;
}

.preview-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.preview-subtitle {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: #9ca3af;
}

.preview-section {
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 8px 10px;
  margin-bottom: 8px;
}

.preview-section h4 {
  margin: 0 0 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
}

.preview-section p {
  margin: 0 0 4px;
  font-size: 0.8rem;
}

.label {
  display: inline-block;
  min-width: 70px;
  color: #9ca3af;
}

.value-muted {
  color: #6b7280;
}

.preview-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.pill {
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(129, 140, 248, 0.6);
  color: #e5e7eb;
}

.footnote {
  font-size: 0.7rem;
  color: #9ca3af;
}

/* Responsive */

@media (max-width: 860px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-column {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px dashed var(--border-subtle);
    padding-bottom: 18px;
    margin-bottom: 14px;
  }

  .preview-column {
    padding-left: 0;
  }

  .meta-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .insight-chip {
    align-self: stretch;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 16px;
  }

  .app-card {
    padding: 18px 16px 20px;
    border-radius: 18px;
  }

  .app-header {
    flex-direction: row;
    align-items: center;
  }

  h1 {
    font-size: 1.2rem;
  }

  .layout {
    gap: 18px;
  }
}
