/* ─────────────────────────────────────────────
   Hermes Intake Form — White-Label Design System
   Step B · Phase 0 · May 2026
───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

/* ── Tokens ── */
:root {
  --bg:            #F8F7F4;
  --surface:       #FFFFFF;
  --surface-hover: #F3F2EF;
  --border:        rgba(0,0,0,0.08);
  --border-focus:  rgba(45,212,191,0.5);
  --teal:          #2DD4BF;
  --teal-dim:      rgba(45,212,191,0.12);
  --teal-dark:     #1aab97;
  --text:          #1A1A2E;
  --text-muted:    rgba(26,26,46,0.55);
  --text-faint:    rgba(26,26,46,0.35);
  --error:         #E53E3E;
  --error-dim:     rgba(229,62,62,0.08);
  --success:       #38A169;
  --r-card:        20px;
  --r-input:       12px;
  --r-pill:        999px;
  --shadow-card:   0 2px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 8px 28px rgba(0,0,0,0.11), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-focus:  0 0 0 3px rgba(45,212,191,0.18);
  --transition:    0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header bar ── */
.form-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.form-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.form-logo span { color: var(--teal); }
.form-header-right {
  font-size: 13px;
  color: var(--text-faint);
}

/* ── Progress bar ── */
.progress-wrap {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 40px 20px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.progress-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.progress-count {
  font-size: 13px;
  color: var(--text-faint);
}
.progress-track {
  height: 4px;
  background: rgba(0,0,0,0.07);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: var(--r-pill);
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-steps {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.progress-step-dot {
  flex: 1;
  height: 3px;
  border-radius: var(--r-pill);
  background: rgba(0,0,0,0.08);
  transition: background var(--transition);
}
.progress-step-dot.done   { background: var(--teal); }
.progress-step-dot.active { background: var(--teal); opacity: 0.5; }

/* ── Main layout ── */
.form-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px 80px;
}
.form-inner {
  width: 100%;
  max-width: 720px;
}

/* ── Step container (slide transitions) ── */
.step-viewport { overflow: hidden; position: relative; }
.step {
  display: none;
  animation: none;
}
.step.active {
  display: block;
  animation: slideIn 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.step.exit-left  { animation: slideOutLeft  0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.step.enter-right{ animation: slideInRight  0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.step.exit-right { animation: slideOutRight 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.step.enter-left { animation: slideInLeft   0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

@keyframes slideIn       { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideOutLeft  { from { opacity:1; transform:translateX(0); }    to { opacity:0; transform:translateX(-40px); } }
@keyframes slideInRight  { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:translateX(0); } }
@keyframes slideOutRight { from { opacity:1; transform:translateX(0); }    to { opacity:0; transform:translateX(40px); } }
@keyframes slideInLeft   { from { opacity:0; transform:translateX(-40px); }to { opacity:1; transform:translateX(0); } }

/* ── Step header ── */
.step-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 6px;
}
.step-subheading {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ── Type selector cards (Step 1) ── */
.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.type-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-card);
  padding: 22px 20px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-card);
  -webkit-user-select: none;
  user-select: none;
}
.type-card:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.type-card.selected {
  border-color: var(--teal);
  background: var(--teal-dim);
  box-shadow: var(--shadow-focus);
}
.type-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--teal);
  transition: background var(--transition);
}
.type-card.selected .type-icon {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}
.type-card-content {}
.type-card-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.type-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Form fields ── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 8px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.field-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: -4px;
}
.field-required { color: var(--teal); margin-left: 2px; }

input[type="text"],
input[type="date"],
input[type="email"],
textarea,
select {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-input);
  padding: 12px 16px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
input[type="text"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: var(--shadow-focus);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
input[type="date"] { cursor: pointer; }

/* ── Chip multi-select ── */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  -webkit-user-select: none;
  user-select: none;
}
.chip:hover { border-color: var(--teal); color: var(--text); }
.chip.selected {
  background: var(--teal-dim);
  border-color: var(--teal);
  color: var(--teal-dark);
  font-weight: 600;
}

/* ── Tag input (Step 3 integrations) ── */
.tag-input-wrap {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-input);
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 48px;
  cursor: text;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.tag-input-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: var(--shadow-focus);
}
.tag {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--teal-dim);
  border: 1px solid rgba(45,212,191,0.25);
  border-radius: var(--r-pill);
  padding: 4px 10px 4px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--teal-dark);
}
.tag-remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 14px;
  line-height: 1;
  transition: opacity var(--transition);
  background: none;
  border: none;
  color: var(--teal-dark);
  padding: 0;
}
.tag-remove:hover { opacity: 1; }
.tag-text-input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 4px 6px !important;
  font-size: 13px;
  color: var(--text);
  min-width: 140px;
  flex: 1;
  width: auto !important;
}

/* ── Add-entry list (Step 3 must-haves / nice-to-haves) ── */
.entry-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:translateY(0); } }
.entry-input { flex: 1; }
.entry-remove {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-faint);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.entry-remove:hover { border-color: var(--error); color: var(--error); background: var(--error-dim); }
.add-entry-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: var(--r-input);
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}
.add-entry-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-dim); }

/* ── Radio cards ── */
.radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.radio-card {
  flex: 1;
  min-width: 120px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}
.radio-card:hover { border-color: var(--teal); }
.radio-card.selected {
  border-color: var(--teal);
  background: var(--teal-dim);
}
.radio-card input[type="radio"] { display: none; }
.radio-card-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 3px;
}
.radio-card-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Checkbox grid ── */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.checkbox-item:hover { border-color: var(--teal); }
.checkbox-item.checked { border-color: var(--teal); background: var(--teal-dim); }
.checkbox-item input[type="checkbox"] { display: none; }
.checkbox-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.checkbox-item.checked .checkbox-box {
  background: var(--teal);
  border-color: var(--teal);
}
.checkbox-check {
  display: none;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.checkbox-item.checked .checkbox-check { display: block; }
.checkbox-item-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}
.checkbox-item-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Divider ── */
.form-divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}

/* ── Section subtitle ── */
.section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}

/* ── Conditional reveal ── */
.conditional-field {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.25s ease;
  margin-top: 0;
}
.conditional-field.visible {
  max-height: 200px;
  opacity: 1;
  margin-top: 12px;
}

/* ── Navigation buttons ── */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--r-input);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 4px 16px rgba(45,212,191,0.28);
}
.btn-primary:hover {
  background: var(--teal-dark);
  box-shadow: 0 6px 22px rgba(45,212,191,0.38);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  border-color: rgba(0,0,0,0.18);
  color: var(--text);
  background: var(--surface);
}
.btn-invisible { visibility: hidden; pointer-events: none; }

/* ── Confirmation screen ── */
.confirm-wrap {
  text-align: center;
  padding: 40px 0 20px;
}
.confirm-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--teal-dim);
  border: 2px solid rgba(45,212,191,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--teal);
}
.confirm-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 10px;
}
.confirm-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.55;
}
.confirm-summary {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-card);
  padding: 24px;
  text-align: left;
  box-shadow: var(--shadow-card);
  margin-bottom: 28px;
}
.confirm-summary-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.confirm-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.confirm-row:last-child { border-bottom: none; padding-bottom: 0; }
.confirm-row-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 140px;
  flex-shrink: 0;
}
.confirm-row-value { color: var(--text); flex: 1; }
.confirm-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.confirm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56,161,105,0.1);
  border: 1px solid rgba(56,161,105,0.25);
  color: var(--success);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

/* ── Validation error ── */
.field-error {
  font-size: 12px;
  color: var(--error);
  display: none;
  align-items: center;
  gap: 4px;
}
.field-error.visible { display: flex; }
input.invalid, textarea.invalid { border-color: var(--error) !important; box-shadow: 0 0 0 3px var(--error-dim) !important; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .form-header { padding: 0 20px; }
  .progress-wrap { padding: 14px 20px 16px; }
  .form-body { padding: 28px 16px 60px; }
  .step-heading { font-size: 22px; }
  .type-grid { grid-template-columns: 1fr; }
  .radio-group { flex-direction: column; }
  .step-nav { flex-direction: column-reverse; gap: 10px; }
  .btn { width: 100%; justify-content: center; }
  .confirm-row { flex-direction: column; gap: 4px; }
  .confirm-row-label { min-width: unset; }
  .confirm-cta { flex-direction: column; }
}
