/* Caso Vivo, lista de espera. Tokens de DESIGN.md e do ADR 0016. */
:root {
  --paper: #FAF6F2;
  --surface: #FFFFFF;
  --rose: #F3DEE2;
  --line: #DFD5D6;
  --ink: #29232A;
  --muted: #655B63;
  --faint: #776C73;
  --ruby: #B52D42;
  --ruby-pressed: #942238;
  --on-ruby: #FFFFFF;
  --focus: #244B70;
  --green: #24634A;
  --green-wash: #EDF5F0;
  --amber: #785113;
  --amber-wash: #FAF1DE;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --r-field: 8px;
  --r-control: 10px;
  --r-card: 16px;

  --gutter: 16px;
  --measure: 560px;

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--ruby);
  overflow-x: hidden;
}

::selection { background: var(--rose); color: var(--ink); }

img, svg { display: block; max-width: 100%; }

h1, h2, h3, p, dl, dd, ol, figure { margin: 0; }
ol { padding: 0; list-style: none; }

a { color: var(--ruby); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ruby-pressed); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  font-weight: 600;
}
.skip:focus { top: 12px; }

/* Coluna única */
.top, main, .foot {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.top { padding-top: 16px; }
.brand { display: inline-block; margin-left: -11px; border-radius: var(--r-control); }
.brand img { width: 220px; height: auto; }

/* Herói: o paciente é o elemento ousado */
.hero { padding-top: 16px; }

.portrait {
  position: relative;
  height: clamp(300px, 70vw, 420px);
  background: var(--rose);
  border-radius: var(--r-card);
  overflow: hidden;
}
.portrait picture {
  display: block;
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 94%;
  aspect-ratio: 620 / 930;
  transform: translateX(-50%);
}
.portrait img {
  width: 100%;
  height: 100%;
  max-width: none;
}

.quote { margin-top: 16px; }
.speaker {
  display: block;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--ruby);
}
.bubble {
  display: inline-block;
  max-width: 92%;
  margin-top: 8px;
  padding: 12px 16px;
  background: var(--rose);
  border-radius: var(--r-card);
  font-size: 20px;
  line-height: 28px;
  quotes: "“" "”";
  text-wrap: pretty;
  transform-origin: 0 0;
}

h1 {
  margin-top: 40px;
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.4px;
  text-wrap: balance;
}

.lede {
  margin-top: 16px;
  color: var(--muted);
  max-width: 36em;
}

.hero-actions { margin-top: 24px; }
.soon {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

/* Botões */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--r-control);
  font: 600 16px/24px var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out), color 120ms var(--ease-out);
}
.button-primary {
  border: 0;
  background: var(--ruby);
  color: var(--on-ruby);
}
.button-primary:hover, .button-primary:active { background: var(--ruby-pressed); }
.button-primary[aria-disabled="true"] { background: var(--ruby-pressed); cursor: progress; }
.button-secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}
.button-secondary:hover { border-color: var(--ruby); color: var(--ink); }
.button-secondary:active { background: var(--rose); border-color: var(--ruby); }

/* Seções */
.block { margin-top: 72px; }

h2 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.segments {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 16px;
}
.segments span { height: 3px; background: var(--ruby); }

.steps { margin-top: 8px; }
.steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 8px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.step-n {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.steps h3 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.steps p { margin-top: 4px; color: var(--muted); }

.note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.facts { margin-top: 16px; }
.facts > div {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.facts > div:last-child { border-bottom: 1px solid var(--line); }
.facts dt {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.facts dd { margin-top: 4px; color: var(--muted); }

/* Formulário */
.signup { scroll-margin-top: 16px; }
.signup:focus { outline: none; }
.section-lede { margin-top: 8px; color: var(--muted); }

.card {
  margin-top: 24px;
  padding: 24px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.field + .field { margin-top: 20px; }

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}
.optional { font-weight: 400; color: var(--muted); }

input, select {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 12px 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-field);
  font: 400 16px/24px var(--font);
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder { color: var(--faint); opacity: 1; }
input:hover, select:hover { border-color: var(--faint); }
input:focus, select:focus { border-color: var(--ruby); }
input:focus-visible, select:focus-visible { outline-offset: 2px; }

select {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%23655B63' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
select:invalid { color: var(--faint); }
select option { color: var(--ink); }

.tel { position: relative; }
.tel-prefix {
  position: absolute;
  left: 16px;
  top: 12px;
  color: var(--muted);
  pointer-events: none;
}
.tel input { padding-left: 56px; font-variant-numeric: tabular-nums; }

.field-hint, .field-error {
  margin-top: 8px;
  font-size: 14px;
  line-height: 20px;
}
.field-hint { color: var(--muted); }
.field-error { color: var(--amber); font-weight: 600; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--amber); }
.field.has-error .field-hint { display: none; }

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.status {
  margin-top: 24px;
  padding: 12px 16px;
  border-radius: var(--r-control);
  font-size: 14px;
  line-height: 20px;
}
.status.is-error { background: var(--amber-wash); color: var(--amber); font-weight: 600; }
.status.is-info { background: var(--paper); border: 1px solid var(--line); color: var(--ink); }

#submit { margin-top: 24px; }
.status:empty { display: none; }
.status:not(:empty) + #submit { margin-top: 16px; }

.privacy {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.done { padding: 8px 0; }
.done-mark {
  width: 32px;
  height: 32px;
  padding: 4px;
  color: var(--green);
  background: var(--green-wash);
  border-radius: 999px;
}
.done h3 {
  margin-top: 16px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}
.done h3:focus { outline: none; }
.done p { margin-top: 8px; color: var(--muted); }

/* Rodapé */
.foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 72px;
  padding-top: 24px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}
.foot img { flex: none; }

@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .top { padding-top: 32px; }
  .hero { padding-top: 24px; }
  .card { padding: 32px; }
  .block { margin-top: 88px; }
}

/* O único movimento: a paciente assenta e fala, uma vez */
@media (prefers-reduced-motion: no-preference) {
  .portrait { animation: frame-in 480ms var(--ease-out) both; }
  .portrait picture { animation: settle 720ms var(--ease-out) 80ms both; }
  .quote { animation: speak 520ms var(--ease-out) 460ms both; }
}

@keyframes frame-in {
  from { opacity: 0; }
}
@keyframes settle {
  from { opacity: 0; transform: translate(-50%, 18px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes speak {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
