/* ==========================================================
   TRACKLY "Who are you?", parental consent and parent approval screens (class prefix cs-)
   Full green page with faint outline drawings, one white card in the middle. Colours come from css/base.css.
   Design views are chosen by the card's data-state (see js/consent-design.js while this is still a design).
   ========================================================== */

.cs-page {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 72px 20px 40px;
  background-color: var(--color-brand-dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800' preserveAspectRatio='xMidYMid slice' fill='none' stroke='white' stroke-opacity='0.22' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='45' y='70' width='330' height='210' rx='28'/%3E%3Cline x1='100' y1='135' x2='290' y2='135'/%3E%3Cline x1='100' y1='165' x2='220' y2='165'/%3E%3Crect x='100' y='208' width='46' height='46' rx='12'/%3E%3Cline x1='172' y1='232' x2='300' y2='232'/%3E%3Crect x='830' y='45' width='340' height='310' rx='28'/%3E%3Crect x='868' y='98' width='24' height='24' rx='6'/%3E%3Cpath d='M874 110l5 5 9-10'/%3E%3Cline x1='925' y1='110' x2='1125' y2='110'/%3E%3Crect x='868' y='168' width='24' height='24' rx='6'/%3E%3Cline x1='925' y1='180' x2='1115' y2='180'/%3E%3Crect x='868' y='238' width='24' height='24' rx='6'/%3E%3Cline x1='925' y1='250' x2='1120' y2='250'/%3E%3Crect x='868' y='308' width='24' height='24' rx='6'/%3E%3Cline x1='925' y1='320' x2='1070' y2='320'/%3E%3Ccircle cx='135' cy='700' r='195'/%3E%3Cpath d='M92 692l46 46 104-114'/%3E%3Ccircle cx='1010' cy='640' r='210'/%3E%3Cline x1='1010' y1='445' x2='1010' y2='470'/%3E%3Cline x1='1010' y1='810' x2='1010' y2='835'/%3E%3Cline x1='815' y1='640' x2='840' y2='640'/%3E%3Cline x1='1180' y1='640' x2='1205' y2='640'/%3E%3Cline x1='1010' y1='640' x2='1100' y2='550'/%3E%3Cline x1='1010' y1='640' x2='930' y2='700'/%3E%3Ccircle cx='1010' cy='640' r='7' fill='white' fill-opacity='0.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: cover;
  color: var(--color-heading); font-family: var(--font-main);
}

.cs-back {
  position: absolute; top: 20px; left: 20px;
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: #FFFFFF; color: var(--color-heading); text-decoration: none; cursor: pointer;
}
.cs-back:focus-visible, .cs-choice:focus-visible, .cs-btn:focus-visible, .cs-link:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 3px; }
.cs-back .icon { width: 18px; height: 18px; }

.cs-logo { display: block; width: 150px; height: auto; margin: 0 auto 22px; }

.cs-title-light { margin: 0 0 8px; font-size: 26px; line-height: 1.25; font-weight: 700; color: #FFFFFF; text-align: center; }
.cs-lead-light { margin: 0 auto 28px; max-width: 320px; font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, 0.78); text-align: center; }

/* ---------- "Who are you?" choices ---------- */
.cs-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; width: 100%; max-width: 420px; }
.cs-choice {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  flex: 1 1 180px; min-width: 170px; padding: 26px 18px 30px;
  background: #FFFFFF; border-radius: 14px; text-align: center; text-decoration: none; color: var(--color-heading);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cs-choice:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24); }
.cs-choice-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 50%; background: var(--color-tile-mint); color: var(--color-brand-dark); }
.cs-choice-icon .icon { width: 22px; height: 22px; }
.cs-choice strong { font-size: 15px; }
.cs-choice span { font-size: 11.5px; line-height: 1.45; color: var(--color-muted); }

/* ---------- the white card ---------- */
.cs-card { width: 100%; max-width: 440px; padding: 30px 28px 24px; background: #FFFFFF; border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2); }
.cs-card-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; background: var(--color-tile-mint); color: var(--color-brand-dark); }
.cs-card-icon .icon { width: 26px; height: 26px; }
.cs-card-icon.is-good { background: #D5F7EA; }
.cs-card h1 { margin: 0 0 8px; font-size: 22px; line-height: 1.25; text-align: center; color: var(--color-heading); }
.cs-card .cs-lead { margin: 0 0 18px; font-size: 13px; line-height: 1.55; text-align: center; color: var(--color-muted); }

.cs-info { display: flex; gap: 10px; margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: var(--radius); font-size: 12px; line-height: 1.55; color: var(--color-chip-text); }
.cs-info .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--color-brand-dark); }
.cs-info p { margin: 0; }

.cs-points { margin: 0 0 16px; padding: 0 0 0 18px; font-size: 13px; line-height: 1.6; color: var(--color-chip-text); }
.cs-points li { margin-bottom: 2px; }

.cs-field { margin-bottom: 14px; }
.cs-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--color-heading); }
.cs-input { width: 100%; min-height: var(--control-height); padding: 0 14px; border: 1.5px solid transparent; border-radius: var(--radius); background: var(--color-chip-bg); font: 14px var(--font-main); color: var(--color-heading); box-sizing: border-box; }
.cs-input::placeholder { color: var(--color-muted); opacity: 0.8; }
.cs-input:focus { outline: none; border-color: var(--color-brand-dark); background: #FFFFFF; }
.cs-input.is-bad { border-color: #B91C1C; background: #FEF2F2; }
.cs-error { display: none; margin: 6px 0 0; font-size: 12px; color: #B91C1C; }
.cs-error.is-on { display: block; }

.cs-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; font-size: 12.5px; line-height: 1.5; color: var(--color-chip-text); cursor: pointer; }
.cs-check input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--color-brand-dark); }
.cs-check.is-bad { color: #B91C1C; }

.cs-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; border: 0; border-radius: var(--radius); background: var(--color-button); color: var(--color-button-text); font: 700 15px var(--font-main); text-decoration: none; cursor: pointer; box-sizing: border-box; }
.cs-btn:hover { background: var(--color-brand-dark); }
.cs-btn[disabled], .cs-btn.is-off { opacity: 0.5; cursor: not-allowed; background: var(--color-button); }
.cs-btn.is-ghost { background: #FFFFFF; color: var(--color-heading); border: 1.5px solid var(--color-border); font-weight: 600; margin-top: 10px; }
.cs-btn.is-ghost:hover { background: var(--color-chip-bg); }
.cs-btn.is-danger-ghost { margin-top: 10px; background: #FFFFFF; color: #B91C1C; border: 1.5px solid #FCA5A5; font-weight: 600; }
.cs-link { display: block; margin-top: 14px; text-align: center; font-size: 13px; font-weight: 600; color: var(--color-heading); text-decoration: none; }
.cs-link:hover { text-decoration: underline; }
.cs-link.is-quiet { margin-top: 8px; font-weight: 400; color: var(--color-muted); font-size: 12px; }
.cs-note { margin: 14px 0 0; font-size: 11px; line-height: 1.5; text-align: center; color: var(--color-muted); }
.cs-banner { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius); background: var(--color-badge-due-bg); color: var(--color-badge-due-text); font-size: 12.5px; line-height: 1.5; display: none; }

/* ---------- which view of the card shows (data-view), and small variations (data-state) ---------- */
.cs-view { display: none; }
.cs-card[data-view="form"] .cs-v-form,
.cs-card[data-view="sent"] .cs-v-sent,
.cs-card[data-view="loading"] .cs-v-loading,
.cs-card[data-view="ready"] .cs-v-ready,
.cs-card[data-view="approved"] .cs-v-approved,
.cs-card[data-view="declined"] .cs-v-declined,
.cs-card[data-view="expired"] .cs-v-expired { display: block; }
.cs-card[data-state="invalid"] .cs-error { display: block; }
.cs-card[data-state="invalid"] .cs-input { border-color: #B91C1C; background: #FEF2F2; }
.cs-card[data-state="invalid"] .cs-check { color: #B91C1C; }
.cs-card[data-state="error"] .cs-banner { display: block; }
.cs-card[data-state="off"] .cs-btn-main, .cs-card[data-state="sending"] .cs-btn-main, .cs-card[data-state="approving"] .cs-btn-main { opacity: 0.5; cursor: not-allowed; }
.cs-card[data-state="sending"] .cs-btn-main .cs-idle, .cs-card[data-state="approving"] .cs-btn-main .cs-idle { display: none; }
.cs-busy { display: none; }
.cs-card[data-state="sending"] .cs-busy, .cs-card[data-state="approving"] .cs-busy { display: inline; }

@media (max-width: 640px) {
  .cs-page { padding: 68px 14px 32px; background-size: auto 130%; }
  .cs-card { padding: 26px 20px 20px; }
  .cs-title-light { font-size: 24px; }
}

.cs-link-inline { color: var(--color-brand-dark); font-weight: 600; }

.cs-banner.is-on { display: block; }
.cs-link[hidden] { display: none; }
