/* Atode onboarding prototype
   Values come from Figma "Onboarding and first worry" (node 41:1311). */

:root {
  --ink: #1f1f1f;
  --ink-heading: #292929;
  --ink-muted: #4d4d4d;
  --line: #6b6b6b;
  --line-strong: #3d3d3d;
  --line-soft: #c4c4c4;
  --action-bg: #e7e7e7;
  --action-line: #707070;
  --selected-bg: #e4e4e4;
  --ticket-bg: #f4f4f4;
  --page-bg: #f0f0f0;
  --white: #ffffff;
  --gutter: 24px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, p, ol, fieldset, legend { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
h1:focus { outline: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Frame */

.phone {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
}

@media (min-width: 480px) {
  body { background: var(--page-bg); padding: 24px 0; }
  .phone {
    width: 390px;
    min-height: 844px;
    margin: 0 auto;
    border: 1px solid #d0d0d0;
  }
}

.screen {
  display: flex;
  flex-direction: column;
  min-height: inherit;
  padding-bottom: env(safe-area-inset-bottom);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  padding: calc(8px + env(safe-area-inset-top)) var(--gutter) 6px;
}
.app-header.has-help { min-height: 60px; padding-bottom: 16px; }
.logo { display: block; }

.header-spacer { height: 32px; flex-shrink: 0; }

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 var(--gutter) 24px;
}

.form-fill { flex: 1; display: flex; flex-direction: column; gap: 20px; }

.push {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.push.center { align-items: center; }

/* Type */

h1 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-heading);
}
.h1-lg { font-size: 28px; color: var(--ink); }

.title-group { display: flex; flex-direction: column; gap: 8px; width: 100%; }

.step-label {
  font-size: 14px;
  line-height: 22px;
  letter-spacing: 0.2px;
  color: var(--ink-heading);
}

.hint { font-size: 16px; line-height: 1.5; color: var(--ink-muted); }

.intro { max-width: 308px; font-size: 17px; line-height: 1.5; color: var(--ink); }
.intro p + p { margin-top: 25.5px; }
.intro-small { font-size: 15px; }

.link {
  font-size: 16px;
  line-height: 1.45;
  color: #0a0a0a;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.footnote { font-size: 15px; line-height: 1.5; color: var(--ink-muted); text-align: center; }

.error {
  font-size: 16px;
  font-weight: 600;
  color: #b00020;
  border-left: 4px solid #b00020;
  padding-left: 10px;
}

/* Buttons */

.action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  background: var(--action-bg);
  border: 1.5px solid var(--action-line);
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: 0.2px;
  color: var(--ink-heading);
  text-decoration: none;
  cursor: pointer;
}
.action:active { background: #d9d9d9; }

.back {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  align-self: flex-start;
  min-height: 24px;
  padding: 0;
  background: none;
  border: 0;
  font-size: 15px;
  line-height: 22px;
  letter-spacing: 0.2px;
  color: var(--ink-heading);
  cursor: pointer;
}

.help-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 176px;
  min-height: 36px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

/* 1. Welcome */

.emergency {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background: var(--action-bg);
  border: 1px solid var(--action-line);
}
.emergency-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}
.emergency .link { color: #000; }

/* 2. How it works */

.steps { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}
.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 2px solid var(--line-strong);
  border-radius: 18px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}
.step-title { font-size: 17px; font-weight: 600; line-height: 1.5; }
.step-text { margin-top: 4px; font-size: 16px; line-height: 1.5; color: var(--ink-muted); }

/* 3. Collection time: radio cards and switch */

.fieldset { display: flex; flex-direction: column; gap: 20px; }
.fieldset > legend { margin-bottom: 20px; }
.fieldset > legend + * { margin-top: 0; }

.options { display: flex; flex-direction: column; gap: 12px; }

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.5;
  cursor: pointer;
}
.option input {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
}
.option input:checked { border: 0; background: var(--ink); }
.option input:focus-visible { outline: none; }
.option:has(input:checked) {
  background: var(--selected-bg);
  border: 2px solid var(--ink);
  padding: 17px 15px;
  font-weight: 600;
}
.option:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }

.other-time { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.other-time input {
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-size: 16px;
}

.reminder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.reminder-label { display: block; font-size: 16px; line-height: 1.5; cursor: pointer; }
.reminder-note { margin-top: 2px; font-size: 15px; line-height: 1.5; color: var(--ink-muted); }

.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 32px;
  margin: 0;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  cursor: pointer;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--line);
}
.switch:checked { background: var(--ink); border-color: var(--ink); }
.switch:checked::after { left: 22px; background: var(--white); }
@media (prefers-reduced-motion: no-preference) {
  .switch::after { transition: left 0.15s ease; }
}

/* 4. Add first worry: topic tiles and words */

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 65px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
}
.tile-wide { grid-column: 1 / -1; }
.tile input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.tile:has(input:checked) {
  background: var(--selected-bg);
  border: 2px solid var(--ink);
  padding: 11px 7px;
  font-weight: 600;
}
.tile:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }

#worry .fieldset { gap: 20px; }

.words { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.words label { font-size: 16px; line-height: 1.3; }
.words textarea {
  width: 100%;
  min-height: 77px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-size: 16px;
  line-height: 1.3;
  resize: vertical;
}
.words textarea::placeholder { color: var(--line); opacity: 1; }

.skip { align-self: center; font-size: 15px; color: #000; }

/* 5. Ticket */

.ticket {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: var(--ticket-bg);
  border: 2px dashed var(--line);
  border-radius: 12px;
}
.ticket-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.ticket-no { font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.ticket-when { font-size: 28px; font-weight: 600; line-height: 1.2; }
.ticket-note { font-size: 16px; line-height: 1.5; color: var(--ink-muted); }
.ticket-actions { display: flex; justify-content: space-between; padding-top: 8px; }
.link-plain {
  padding: 0;
  background: none;
  border: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.refocus-title { font-size: 20px; font-weight: 600; line-height: 1.3; margin-bottom: 20px; }

/* 6. Help */

.contact { display: flex; flex-direction: column; gap: 6px; }
.contact-label { font-size: 15px; font-weight: 600; line-height: 1.5; }
.contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.3;
  text-align: center;
  color: var(--ink);
  text-decoration: none;
}
.contact-primary { background: var(--selected-bg); border-color: var(--line-strong); font-weight: 600; }

.noscript { padding: 24px; }

/* Add a worry: dashboard and entry type */

.lead { font-size: 16px; line-height: 1.45; color: var(--ink-heading); }
.lead p + p { margin-top: 23px; }

.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--action-line);
  border-radius: 4px;
}
.panel-tall { min-height: 240px; padding-top: 32px; }

.schedule { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.schedule-label { font-size: 16px; font-weight: 400; line-height: normal; color: var(--ink-heading); }
.panel-label { align-self: stretch; }
.schedule-time {
  font-size: 26px;
  font-weight: 600;
  line-height: normal;
  color: var(--ink-heading);
  font-variant-numeric: tabular-nums;
}
.schedule-status { font-size: 15px; line-height: 1.45; color: #555555; }

/* Figma has 12px here; raised to 14px for the minimum text size. */
.early-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  font-size: 14px;
  line-height: 22px;
  letter-spacing: 0.2px;
  color: var(--ink-heading);
}
.early-link span { text-decoration: underline; text-underline-offset: 2px; }
