/*
  Вебворонка Moppy — moppyapp.com/start.

  Кольори й шрифти — з `design_handoff_moppy_v1/tokens/tokens.json`,
  літералами, як у `web/auth/auth.css`: сторінка живе поза збіркою Flutter.
  Червоного для помилок немає — є бурштиновий Heads-up зі словами; одна
  коралова дія на екран, решта контурні.
*/

@font-face { font-family: 'Lora'; src: url('fonts/Lora-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('fonts/Nunito-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('fonts/Nunito-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --background: #FFF5F7;
  --surface: #FFFFFF;
  --text-primary: #2C252A;
  --text-secondary: #6E6068;
  --text-link: #C8243F;
  --coral: #FF4D6A;
  --coral-ink: #C8243F;
  --coral-tint: #FFE1E7;
  --headsup-bg: #FDEBC8;
  --headsup-ink: #8A5A0F;
  --border: #EFD5DC;
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--background); color: var(--text-primary); }
body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.top { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.back {
  border: 0; background: none; font: inherit; color: var(--text-secondary);
  font-size: 24px; width: 40px; height: 40px; border-radius: 20px; cursor: pointer;
}
.back:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--coral-ink); outline-offset: 2px; }
.bar { flex: 1; height: 8px; background: var(--coral-tint); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--coral); border-radius: 4px; transition: width .25s ease; }

h1 { font-family: 'Lora', Georgia, serif; font-weight: 700; font-size: 28px; line-height: 1.2; margin: 24px 0 8px; }
h2 { font-family: 'Lora', Georgia, serif; font-weight: 700; font-size: 21px; margin: 20px 0 8px; }
.sub { color: var(--text-secondary); margin: 0 0 16px; }
.statement {
  font-family: 'Lora', Georgia, serif; font-size: 22px; line-height: 1.3;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px; margin: 8px 0 16px;
}

.options { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  font: inherit; font-weight: 700; color: var(--text-primary);
  background: var(--surface); border: 2px solid var(--border); border-radius: 16px;
  padding: 14px 16px; min-height: 56px; cursor: pointer;
}
.option[aria-pressed="true"], .option[aria-checked="true"] { border-color: var(--coral); background: var(--coral-tint); }
.option .emoji { font-size: 22px; width: 28px; text-align: center; }
.option .tick { margin-left: auto; color: var(--coral-ink); }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale .option { flex-direction: column; justify-content: center; padding: 10px 4px; font-size: 13px; text-align: center; min-height: 72px; }
.scale .option b { font-size: 20px; }

input[type=text], input[type=email], input[type=password], input[inputmode=numeric] {
  width: 100%; font: inherit; font-size: 18px; padding: 14px 16px; border-radius: 14px;
  border: 2px solid var(--border); background: var(--surface); color: var(--text-primary);
}
label { display: block; font-weight: 700; margin: 12px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip {
  font: inherit; font-size: 15px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-primary); border-radius: 18px; padding: 8px 14px; cursor: pointer;
}

.spacer { flex: 1; min-height: 16px; }
.primary {
  display: block; width: 100%; border: 0; border-radius: 28px; min-height: 56px;
  background: var(--coral); color: #FFFFFF; font: inherit; font-size: 19px; font-weight: 700;
  cursor: pointer; text-align: center; text-decoration: none; line-height: 56px; padding: 0 16px;
}
.primary:disabled { opacity: .45; cursor: default; }
/* Довгий екран (готовий план) не ховає кнопку під згин: людина з реклами
   не гортає, щоб знайти, куди далі. */
button.primary { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 0 0 12px var(--background); }
.secondary {
  display: block; width: 100%; border: 2px solid var(--coral-ink); border-radius: 28px; min-height: 52px;
  background: transparent; color: var(--coral-ink); font: inherit; font-weight: 700; cursor: pointer;
  text-align: center; text-decoration: none; line-height: 48px; margin-top: 10px;
}
.text-button { border: 0; background: none; color: var(--text-link); font: inherit; font-weight: 700; cursor: pointer; padding: 8px 0; }

.mascot { display: block; width: 180px; height: 180px; margin: 8px auto 0; object-fit: contain; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px 18px; margin: 12px 0; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.steps li:last-child { border-bottom: 0; }
.steps .min { color: var(--text-secondary); white-space: nowrap; }
.headsup { background: var(--headsup-bg); color: var(--headsup-ink); border-radius: 14px; padding: 12px 14px; margin: 12px 0; font-weight: 700; }
.small { font-size: 14px; color: var(--text-secondary); }
.center { text-align: center; }

.plan-card { position: relative; }
.plan-card .price { font-size: 20px; font-weight: 700; }
.plan-card .day { color: var(--text-secondary); font-size: 14px; font-weight: 400; }
.plan-card .tag { position: absolute; top: -10px; right: 16px; background: var(--coral-ink); color: #FFFFFF; font-size: 12px; border-radius: 10px; padding: 2px 10px; }

.progress-ring { height: 10px; background: var(--coral-tint); border-radius: 5px; overflow: hidden; margin: 24px 0 8px; }
.progress-ring > span { display: block; height: 100%; background: var(--coral); transition: width .2s linear; }
.stages { list-style: none; padding: 0; color: var(--text-secondary); }
.stages li.done { color: var(--text-primary); font-weight: 700; }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(44, 37, 42, .4); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { background: var(--surface); width: 100%; max-width: 480px; border-radius: 24px 24px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
.code-input { letter-spacing: 12px; text-align: center; font-size: 26px; }
.stores { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
