/* RollAway pre-arrival questions form. Colors and type from the email template. */

:root {
  --deep: #0B3333;
  --ink: #0F1E23;
  --slate: #465764;
  --teal: #518585;
  --mint: #B9E0D8;
  --pale: #EAF4F2;
  --white: #ffffff;
  --font: Inter, 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--pale);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
input, textarea, button { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
textarea:focus { outline: none; border-bottom-color: var(--deep); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout: the phone frame fills the viewport; on wide screens it sits centered at 480px. */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: var(--pale);
}

.top { padding: calc(18px + env(safe-area-inset-top)) 20px 0 20px; display: flex; flex-direction: column; gap: 12px; }
.top-row { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.wordmark { width: 96px; height: auto; display: block; }
.counter { font-size: 13px; font-weight: 600; color: var(--slate); }
.bars { display: flex; gap: 5px; }
.bars:empty { display: none; }
.bar { flex: 1; height: 4px; border-radius: 2px; background: var(--white); transition: background-color .3s ease; }
.bar.done { background: var(--teal); }
.bar.now { background: var(--deep); }

.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 24px; overflow: hidden; }

.screen { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.screen.question { gap: 16px; padding-bottom: 40px; }
.screen.review { justify-content: flex-start; min-height: 0; padding: 18px 0 12px 0; }

.eyebrow { font-size: 13px; font-weight: 600; color: var(--teal); }
.h1 { margin: 0; font-size: 38px; line-height: 1.05; font-weight: 700; color: var(--deep); letter-spacing: -0.5px; }
.h2 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 700; color: var(--deep); letter-spacing: -0.4px; }
.review .h2 { font-size: 28px; line-height: 1.1; }
.done .h2 { font-size: 32px; line-height: 1.05; }
.lead { margin: 0; font-size: 16px; line-height: 1.6; color: var(--slate); }
.hint { margin: 0; font-size: 15px; line-height: 1.55; color: var(--slate); }
.small { margin: 0; font-size: 13px; line-height: 1.6; color: var(--slate); }

.btn-primary {
  background: var(--deep); color: var(--white); border: 0; border-radius: 8px;
  padding: 15px 26px; font-size: 16px; font-weight: 600; min-height: 50px; margin-top: 10px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
.chip {
  min-height: 46px; padding: 11px 16px; border-radius: 999px;
  border: 1px solid var(--mint); background: var(--white); color: var(--deep);
  font-size: 15px; font-weight: 500; text-align: left;
}
.chip.on { background: var(--mint); border-color: var(--teal); }

.field { padding-top: 4px; }
.field textarea {
  width: 100%; padding: 14px 16px; border: 0; border-bottom: 2px solid var(--teal); border-radius: 0;
  font-size: 18px; line-height: 1.45; color: var(--ink); background: transparent; resize: none;
}
.field textarea::placeholder { color: #9AAFAC; }

.review-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; -webkit-overflow-scrolling: touch; }
.review-item { background: var(--white); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.review-item .text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.review-item .q { font-size: 12px; font-weight: 600; color: var(--slate); }
.review-item .a { font-size: 15px; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.review-item .a.skipped { color: var(--slate); }
.review-item .edit { background: transparent; color: var(--teal); border: 0; padding: 10px 6px; font-size: 14px; font-weight: 600; min-height: 44px; }

.card { background: var(--white); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.card img { display: block; width: 100%; height: 190px; object-fit: cover; border-radius: 10px; }
.card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink); }
.card strong { color: var(--deep); }

.controls {
  padding: 12px 20px calc(22px + env(safe-area-inset-bottom)) 20px;
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid rgba(11,51,51,0.08); background: var(--pale);
}
.controls[hidden] { display: none; }
.spacer { flex: 1; }
.btn-back { background: var(--white); color: var(--deep); border: 1px solid var(--mint); border-radius: 8px; width: 48px; height: 48px; font-size: 20px; line-height: 1; }
.btn-back.dim { opacity: .35; }
.btn-skip { background: transparent; color: var(--teal); border: 0; padding: 12px; font-size: 15px; font-weight: 500; min-height: 48px; }
.btn-skip[hidden] { display: none; }
.btn-next { background: var(--deep); color: var(--white); border: 0; border-radius: 8px; padding: 0 26px; height: 48px; font-size: 16px; font-weight: 600; }
.btn-next:disabled { opacity: .6; cursor: default; }

/* Screen transitions. Two keyframe pairs so the animation restarts on every step. */
@keyframes fwdA { from { opacity: 0; transform: translateX(56px); } to { opacity: 1; transform: none; } }
@keyframes fwdB { from { opacity: 0; transform: translateX(56px); } to { opacity: 1; transform: none; } }
@keyframes backA { from { opacity: 0; transform: translateX(-56px); } to { opacity: 1; transform: none; } }
@keyframes backB { from { opacity: 0; transform: translateX(-56px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.screen { animation-duration: .32s; animation-timing-function: cubic-bezier(.2,.7,.2,1); animation-fill-mode: both; }
.screen.anim-fwdA { animation-name: fwdA; }
.screen.anim-fwdB { animation-name: fwdB; }
.screen.anim-backA { animation-name: backA; }
.screen.anim-backB { animation-name: backB; }
.screen.anim-rise { animation-name: rise; }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

/* Sending state */
.sending .btn-next { opacity: .6; }
.error { margin: 0; font-size: 14px; line-height: 1.5; color: #8A2E2E; }

@media (min-width: 481px) {
  body { background: #DDEBE8; }
  .app { min-height: 100vh; }
}
