/* Good & Proper Tea -- new account form
   Brand: GT Eesti Text (Grilli Type), confirmed cleared for web use.
   Palette per GP24 Brand Guide -- tea-category + neutral colours, as
   already applied elsewhere in this project. Accent colour RESOLVED
   16 Sept 2026: Black tea coral (--tea-black, #F07D69), matching the
   primary CTA colour on the "Tasting room stock" tool Josh pointed to
   as the reference look-and-feel for this rebuild (tab-style step
   header with a coloured underline, white card panel, dashed "add
   another" buttons -- see .step-header/.step-tab/.card and the
   link-button rules below). Still worth a final sanity-check against
   the full brand guide before this goes live -- resolved from a
   working reference, not from the guide document itself. */

@font-face {
  font-family: "GT Eesti Text";
  src: url("/static/fonts/GTEestiTextBold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "GT Eesti Text";
  src: url("/static/fonts/GTEestiTextMedium.otf") format("opentype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "GT Eesti Text";
  src: url("/static/fonts/GTEestiTextLight.otf") format("opentype");
  font-weight: 300;
  font-display: swap;
}

:root {
  /* Tea categories */
  --tea-black: #F07D69;
  --tea-herbal: #A7C8BC;
  --tea-oolong: #F0BB5E;
  --tea-green: #B6C087;
  --tea-white: #CAC6C6;
  /* Neutrals */
  --ink: #000000;
  --warm-grey: #7D7873;
  --base: #F4ECE6;

  --accent: var(--tea-black);
  --error: #B23B2E;
  --success: #2E6B3E;
  --max-width: 640px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--base);
  color: var(--ink);
  font-family: "GT Eesti Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 300;
  letter-spacing: 0.1px;
  line-height: 1.5;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 20px 96px;
}

/* Logo added 22 Sept 2026, per Emilie's brand/copy feedback (21 Sept) --
   Good & Proper wasn't mentioned anywhere on the form. Wordmark, black on
   transparent, sat at the top of the page above the heading. */
.brand-logo {
  display: block;
  height: 32px;
  width: auto;
  margin-bottom: 24px;
}

header.brand {
  margin-bottom: 40px;
}

header.brand .wordmark {
  font-family: "GT Eesti Text", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 22px;
  margin: 0 0 8px;
}

header.brand .strapline {
  font-family: "GT Eesti Text", sans-serif;
  font-weight: 500;
  letter-spacing: 0.6px;
  font-size: 14px;
  color: var(--warm-grey);
  margin: 0;
}

h1 {
  font-family: "GT Eesti Text", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 26px;
  margin: 0 0 12px;
}

h1 + p.intro {
  color: var(--warm-grey);
  margin: 0 0 40px;
  font-size: 15px;
}

section.form-section {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

section.form-section:last-of-type {
  border-bottom: none;
}

section.form-section h2 {
  font-family: "GT Eesti Text", sans-serif;
  font-weight: 500;
  letter-spacing: 0.6px;
  font-size: 15px;
  text-transform: uppercase;
  color: var(--warm-grey);
  margin: 0 0 24px;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 6px;
}

.hint {
  font-size: 12px;
  color: var(--warm-grey);
  margin-top: 4px;
}

/* Same styling as a .field label, for a line that introduces a group of
   inputs rather than one named control (e.g. the Stay in touch email
   repeater) -- added 22 Sept 2026 so those sections read consistently
   with the labelled fields above them rather than as small grey text. */
.field-label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  margin: 0 0 6px;
}

.field .optional-tag {
  font-weight: 300;
  color: var(--warm-grey);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 300;
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--ink);
}

input:invalid.touched, .field.has-error input, .field.has-error select {
  border-color: var(--error);
}

.field-error {
  display: none;
  color: var(--error);
  font-size: 12px;
  margin-top: 4px;
}

.field.has-error .field-error {
  display: block;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checkbox-row input[type="checkbox"],
.checkbox-row input[type="radio"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.checkbox-row label {
  font-size: 14px;
  font-weight: 300;
}

.address-block {
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.5);
}

/* Waste-streams checkbox group (added 22 Sept 2026) -- a plain fieldset,
   not boxed like .address-block, so it reads as one field among others
   rather than a sub-form. legend styled to match .field label. */
fieldset.field {
  border: none;
  padding: 0;
  margin: 0 0 20px;
  min-width: 0;
}

fieldset.field legend {
  display: block;
  width: 100%;
  padding: 0;
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.1px;
  margin-bottom: 6px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* The free-text "Other" field sitting under a checkbox group needs a bit
   of air, otherwise it crowds the last tick box (added 23 Sept 2026). Its
   label is set to the same weight as the tick-box labels rather than the
   heavier .field label weight, so it reads as the last item in the list
   rather than as a new question. */
.checkbox-group + .field {
  margin-top: 16px;
}

.checkbox-group + .field label {
  font-weight: 300;
}

.address-block .address-block-title {
  font-weight: 500;
  font-size: 13px;
  color: var(--warm-grey);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.repeater-list { margin-bottom: 12px; }

button.link-button {
  background: none;
  border: none;
  color: var(--ink);
  text-decoration: underline;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

/* "Remove" actions -- coral, matching the Tasting room stock reference
   (16 Sept 2026). Distinct from --error (validation red), which stays
   reserved for actual field errors. */
button.link-button.remove {
  color: var(--tea-black);
  font-size: 12px;
}

/* "+ Add another..." actions -- dashed-border pill, matching the
   Tasting room stock reference (16 Sept 2026). Deliberately excludes
   .remove so that button keeps its plain text-link look. */
button.link-button:not(.remove):not(.skip) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--accent);
  border: 1px dashed var(--accent);
  border-radius: 20px;
  padding: 8px 16px;
}

button.link-button:not(.remove):hover {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
}

.gc-panel {
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.5);
}

.gc-panel .hint {
  margin: 0 0 12px;
}

button.secondary {
  display: block;
  width: 100%;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-family: "GT Eesti Text", sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 14px;
  cursor: pointer;
}

button.secondary:disabled {
  border-color: var(--warm-grey);
  color: var(--warm-grey);
  cursor: not-allowed;
}

.gc-status {
  margin: 12px 0 0;
  font-size: 13px;
}

.gc-status.success { color: var(--success); }
.gc-status.error { color: var(--error); }

button.primary {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: var(--ink);
  border: none;
  border-radius: 4px;
  font-family: "GT Eesti Text", sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 15px;
  cursor: pointer;
  margin-top: 8px;
}

button.primary:disabled {
  background: var(--warm-grey);
  color: #fff;
  cursor: not-allowed;
}

.submit-status {
  margin-top: 16px;
  font-size: 14px;
  display: none;
}

.submit-status.visible { display: block; }
.submit-status.success { color: var(--success); }
.submit-status.error { color: var(--error); }

/* Loading spinner (16 Sept 2026) -- shown while /create-account is still
   working. That call does several sequential live Unleashed writes and
   can take up to a minute or so if sandbox is slow, so static "Creating
   your account..." text alone looked indistinguishable from the page
   being stuck. */
.submit-status.loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.submit-status.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 2px solid rgba(0,0,0,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Multi-step wizard: step header + white card container ---------------
   Added 16 Sept 2026, alongside the page-split/no-going-back change (see
   form.js): once page 1 succeeds in creating the real Unleashed account,
   there's no supported way back to edit it here, so the step tabs are
   plain divs, not buttons or links -- deliberately not clickable, not a
   navigation control. Look and feel (tab underline colour, white card on
   the cream page background) follows the "Tasting room stock" tool Josh
   flagged as the reference (16 Sept 2026). */

.step-header {
  display: flex;
  gap: 32px;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  margin-bottom: 32px;
}

.step-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  color: var(--warm-grey);
}

.step-tab .step-tab-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
}

.step-tab .step-tab-label {
  font-family: "GT Eesti Text", sans-serif;
  font-weight: 500;
  letter-spacing: 0.4px;
  font-size: 13px;
  text-transform: uppercase;
}

.step-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.step-tab.done {
  color: var(--ink);
}

.step-tab.done .step-tab-number {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

[hidden] { display: none !important; }

/* Page 3 "No thanks" (24 Sept 2026): plain underlined text, centred
   under Send, so it reads as a way out rather than another action. */
button.link-button.skip {
  display: block;
  margin: 16px auto 0;
  color: var(--ink);
}
