/* Visual refresh for the actual setup guide. Existing setup behaviour stays in setup.html. */
:root {
  --setup-ink: #443438;
  --setup-muted: #7e6e69;
  --setup-coral: #e78d7d;
  --setup-coral-soft: #fff0e8;
  --setup-sage: #87aa7e;
  --setup-sage-soft: #edf6e9;
  --setup-teal: #6aa8a2;
  --setup-teal-soft: #eaf6f4;
  --setup-lilac: #9a8bc8;
  --setup-lilac-soft: #f1edfb;
  --setup-gold: #d3aa55;
  --setup-gold-soft: #fff5de;
}

body {
  align-items: center !important;
  padding: 24px 16px 42px !important;
  background: linear-gradient(155deg, #fff0e8 0%, #f7eef7 46%, #edf7ef 100%) !important;
}

.wizard-card.card {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 620px !important;
  padding: 20px 20px 22px;
  border: 1px solid rgba(229, 215, 208, .9);
  border-radius: 30px;
  background: rgba(255, 253, 251, .94);
  box-shadow: 0 20px 55px rgba(79, 58, 61, .13);
}

.wizard-card.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--setup-coral), var(--setup-gold), var(--setup-sage), var(--setup-teal), var(--setup-lilac));
}

.wizard-steps {
  gap: 8px !important;
  justify-content: flex-start !important;
  margin: 8px 2px 22px !important;
}

.wizard-dot {
  width: 100% !important;
  height: 7px !important;
  border-radius: 99px !important;
  background: #eee4df !important;
  transform: none !important;
}

.wizard-dot.done { background: #a9c49f !important; }
.wizard-dot.active { background: linear-gradient(90deg, #e9927f, #d8b35f) !important; }

.wizard-step.active {
  animation: setupFade .18s ease-out;
}

@keyframes setupFade {
  from { opacity: .55; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.wizard-step > h1,
.wizard-step .brand-title {
  color: var(--setup-ink);
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(1.55rem, 5vw, 2rem) !important;
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 7px !important;
}

.wizard-step-sub {
  max-width: 540px;
  margin-bottom: 20px !important;
  color: var(--setup-muted) !important;
  font-size: .88rem !important;
  line-height: 1.5;
}

.wizard-step[data-step="account"]::before,
.wizard-step[data-step="family"]::before,
.wizard-step[data-step="capacity"]::before,
.wizard-step[data-step="tour"]::before,
.wizard-step[data-step="notifications"]::before,
.wizard-step[data-step="done"]::before {
  display: inline-flex;
  margin-bottom: 9px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--setup-coral-soft);
  color: #aa675d;
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.wizard-step[data-step="account"]::before { content: "Start here"; }
.wizard-step[data-step="family"]::before { content: "Household"; background: var(--setup-lilac-soft); color: #7365a6; }
.wizard-step[data-step="capacity"]::before { content: "Realistic capacity"; background: var(--setup-sage-soft); color: #607d59; }
.wizard-step[data-step="tour"]::before { content: "Quick tour"; background: var(--setup-gold-soft); color: #947428; }
.wizard-step[data-step="notifications"]::before { content: "Stay connected"; background: var(--setup-teal-soft); color: #4c807a; }
.wizard-step[data-step="done"]::before { content: "Ready"; background: var(--setup-sage-soft); color: #607d59; }

.wizard-card input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.wizard-card select,
.wizard-card textarea {
  min-height: 46px;
  border: 1px solid #e5d9d2;
  border-radius: 13px;
  background: rgba(255,255,255,.92);
  box-shadow: inset 0 1px 2px rgba(82, 61, 60, .025);
}

.wizard-card input:focus,
.wizard-card select:focus,
.wizard-card textarea:focus {
  outline: 2px solid rgba(106, 168, 162, .22);
  border-color: var(--setup-teal);
}

/* input[type=color] is excluded above (forcing the wizard's usual field
   height/radius onto it squashes the browser's native colour-well - see
   the mobile override further down); give it its own border so it
   doesn't sit as a bare, edgeless swatch inside an otherwise fully
   designed card. */
.wizard-card input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 3px;
  border: 1px solid #e5d9d2;
  border-radius: 10px;
  background: rgba(255,255,255,.92);
}

/* The outer box above is styled, but the button part of a file input
   renders with OS chrome regardless - the one clearly "raw" control left
   in the wizard. ::file-selector-button is the standard pseudo for it
   (Chrome 89+, Firefox 82+, Safari 15.4+) and only re-skins the button;
   the input's own file-picking behaviour is untouched. */
.wizard-card input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: var(--setup-teal-soft);
  color: #3d6d67;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
}

.wizard-card input[type="file"]::file-selector-button:hover {
  background: var(--setup-teal);
  color: #fff;
}

.wizard-card .add-form {
  gap: 12px;
}

.setup-hint {
  margin-top: 5px !important;
  color: var(--setup-muted) !important;
  line-height: 1.4;
}

.wizard-card hr {
  margin: 5px 0 2px !important;
  border-top-color: #eee3dc !important;
}

.wizard-card .btn,
.wizard-card .btn-primary,
.wizard-card .btn-secondary {
  min-height: 43px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
}

.wizard-card .btn-primary {
  border-color: #df8273;
  background: linear-gradient(135deg, #e98c7b, #df9b72);
  color: #fff;
  box-shadow: 0 7px 17px rgba(197, 106, 91, .16);
}

.wizard-nav {
  margin-top: 22px !important;
  padding-top: 14px;
  border-top: 1px solid #eee4df;
}

#wizard-family-list {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

#wizard-family-list .family-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(90deg, #f3f0fb, #fffdfb);
}

#wizard-family-list .family-member-row:nth-child(3n + 2) { background: linear-gradient(90deg, #edf7f3, #fffdfb); }
#wizard-family-list .family-member-row:nth-child(3n + 3) { background: linear-gradient(90deg, #fff3e8, #fffdfb); }

#wizard-family-form {
  padding: 13px;
  border: 1px solid #e6dcd6;
  border-radius: 17px;
  background: #faf7f4;
}

.tour-list {
  gap: 8px !important;
}

.tour-item {
  position: relative;
  gap: 11px !important;
  align-items: center !important;
  padding: 11px 12px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: linear-gradient(90deg, #f5f1fb, #fffdfb) !important;
}
.tour-item:nth-child(2) { background: linear-gradient(90deg, #fff1e8, #fffdfb) !important; }
.tour-item:nth-child(3) { background: linear-gradient(90deg, #fff6df, #fffdfb) !important; }
.tour-item:nth-child(4) { background: linear-gradient(90deg, #edf7f3, #fffdfb) !important; }
.tour-item:nth-child(5) { background: linear-gradient(90deg, #eef6eb, #fffdfb) !important; }

.tour-item-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 12px;
  background: rgba(255,255,255,.8);
  /* These were emoji and are line icons now - nothing else in the app
     uses emoji, and five of them in a column was the loudest thing on
     the screen. An SVG takes its colour from here rather than a font
     size. */
  color: var(--setup-ink);
}

.tour-item-title {
  color: var(--setup-ink);
  font-size: .9rem !important;
  font-weight: 800 !important;
}

.tour-item-desc {
  color: var(--setup-muted) !important;
  font-size: .78rem !important;
  line-height: 1.4;
}

.finish-check {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 4px auto 14px !important;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff0e8, #eef7ed);
  color: var(--setup-ink);
}

@media (max-width: 520px) {
  body { align-items: flex-start !important; padding: 14px 10px 28px !important; }
  .wizard-card.card { padding: 17px 14px 19px; border-radius: 24px; }
  .wizard-card .btn-row { gap: 9px !important; }
  #wizard-family-form { align-items: stretch !important; }
  #wizard-family-form > * { flex: 1 1 100% !important; width: 100%; }
  /* The color swatch isn't a text field - stretching it to the full
     card width (like every other control in this form) drags the
     browser's native colour-well control into a squashed, oversized
     oval instead of the small square swatch it's meant to be. */
  #wizard-family-form > input[type="color"] {
    flex: 0 0 auto !important;
    width: 56px !important;
    height: 42px;
    padding: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wizard-step.active { animation: none; }
}

/* The way back to sign-in from step 1. Sits under the account form, at
   the weight of a hint rather than an action - creating the household is
   what this page is for, and this is only here so someone who already
   has one is not stranded. Later steps never show it: the wizard
   displays one section at a time and this lives inside step 1. */
.signin-prompt {
  margin: 14px 0 0 !important;
  padding-top: 13px;
  border-top: 1px solid #eee3dc;
  text-align: center;
  font-size: 0.88rem;
  color: var(--setup-muted) !important;
}

.signin-prompt a {
  color: var(--setup-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.signin-prompt a:focus-visible {
  outline: 2px solid var(--setup-teal);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Shown when the email already owns a household (see setupAuth). A
   panel rather than a red status line: this is a fork with two valid
   answers, not a mistake to correct, and the wording should not read as
   though the person has done something wrong. */
.existing-account-notice {
  margin-top: 14px;
  padding: 15px 16px;
  border: 1px solid var(--setup-teal);
  border-radius: 14px;
  background: var(--setup-teal-soft);
}

.existing-account-lead {
  margin: 0 !important;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--setup-ink) !important;
}

.existing-account-sub {
  margin: 5px 0 0 !important;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--setup-muted) !important;
}

.existing-account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
}

/* The <a> has to be given back what the .btn rules assume of a button. */
.existing-account-actions .btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.existing-account-secondary {
  border: none;
  background: none;
  padding: 6px 2px;
  font: inherit;
  font-size: 0.86rem;
  color: var(--setup-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.existing-account-secondary:hover {
  color: var(--setup-ink);
}

.existing-account-actions a:focus-visible,
.existing-account-secondary:focus-visible {
  outline: 2px solid var(--setup-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Focused programmatically when it appears, so it must not look clicked. */
.existing-account-notice:focus {
  outline: none;
}

.existing-account-notice:focus-visible {
  outline: 2px solid var(--setup-ink);
  outline-offset: 3px;
}

/* Sits inline with the other roster fields, so it needs to look like a
   control rather than a stray line of text. */
.wizard-supervised {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 4px;
  font-size: 0.86rem;
  color: var(--setup-muted);
  white-space: nowrap;
  cursor: pointer;
}

/* Step 2's household-type picker. Cards rather than a <select> because
   each option needs a line of explanation to be answerable at a glance,
   and because a five-item dropdown hides four of the answers. */
.household-type-grid {
  display: grid;
  gap: 9px;
  margin-top: 4px;
}

.household-type {
  display: block;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid #eee3dc;
  border-radius: 14px;
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.household-type:hover {
  border-color: var(--setup-teal);
}

.household-type.selected {
  border-color: var(--setup-teal);
  background: var(--setup-teal-soft);
  box-shadow: inset 0 0 0 1px var(--setup-teal);
}

.household-type-title {
  display: block;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--setup-ink);
}

.household-type-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--setup-muted);
}

.household-type:focus-visible {
  outline: 2px solid var(--setup-ink);
  outline-offset: 2px;
}
