/* Flora onboarding form. Values follow docs/design-handoff/README.md
   ("Page frame", "Components"); colours and type come from tokens.css. */

* { box-sizing: border-box; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; color-scheme: light; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Page frame */
.page { min-height: 100vh; display: flex; flex-direction: column; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(245, 242, 235, 0.93); backdrop-filter: blur(10px);
}
.site-header__inner {
  max-width: var(--page-max); margin: 0 auto; padding: 16px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
}
.wordmark { display: inline-flex; align-items: center; }
.wordmark img { display: block; height: 32px; width: auto; }
.site-header__links { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 24px; }
.site-header__help { font-size: var(--fs-caption); color: var(--text-secondary); }
.site-header__account { font-size: var(--fs-body); color: var(--text-secondary); }

.main {
  max-width: var(--page-max); width: 100%; margin: 0 auto; flex: 1 1 auto;
  padding: 40px var(--gutter) var(--section-pad);
}

.stages ol {
  list-style: none; margin: 0; padding: 0 0 16px;
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline;
  border-bottom: 1px solid var(--rule);
}
.stage {
  font-size: var(--fs-eyebrow); font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted);
}
.stage--active { color: var(--text); }

.messages { list-style: none; margin: 24px 0 0; padding: 16px 24px; border: 1px solid var(--rule-parchment); max-width: 1040px; }

/* Step head */
.step { padding-top: var(--s-56); }
.eyebrow, .group-eyebrow {
  margin: 0; font-size: var(--fs-eyebrow); font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text);
}
.group-eyebrow { color: var(--text-secondary); }
.step-title {
  font-family: var(--serif); font-weight: 400; font-size: var(--fs-section); line-height: 1.14;
  letter-spacing: -0.004em; color: var(--text); margin: 24px 0 0; max-width: 20ch;
}
.step-title--wide { max-width: 22ch; }
.step-title:focus { outline: none; }
.step-title:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.lede { font-size: var(--fs-body); line-height: 1.6; color: var(--text-secondary); margin: 24px 0 0; max-width: var(--measure); }
.lede--close { margin-top: 16px; }
.lede--16 { margin-top: 16px; }
.lede--tight { margin-top: 8px; }
.lede--wide-gap { margin-top: 32px; }
.emphasis { font-size: var(--fs-label); font-weight: 500; line-height: 1.5; color: var(--text); margin: 24px 0 0; max-width: var(--measure); }
.statement {
  font-family: var(--serif); font-weight: 400; font-size: var(--fs-section); line-height: 1.14;
  letter-spacing: -0.004em; color: var(--text); max-width: 24ch; margin: 0;
}
.subheading { font-size: var(--fs-label); font-weight: 500; line-height: 1.4; color: var(--text-secondary); margin: 0; }
.section-heading {
  font-family: var(--serif); font-weight: 400; font-size: var(--fs-section); line-height: 1.14;
  letter-spacing: -0.004em; color: var(--text); margin: 0;
}
.caption { font-size: var(--fs-caption); line-height: 1.65; color: var(--text-muted); max-width: var(--measure); margin: 0; }
.caption--8 { margin-top: 8px; }
.caption--gap { margin-top: 24px; }

/* Layout blocks */
.block { margin-top: 40px; max-width: 1040px; }
.block--24 { margin-top: 24px; }
.block--measure { max-width: 46em; }
.section { margin-top: 40px; padding-top: 40px; border-top: 1px solid var(--rule); max-width: 1040px; }
.section--measure { max-width: 46em; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 32px 40px; margin-top: 40px; max-width: 1040px;
}
.grid.section { margin-top: 40px; }
.grid--address { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.grid--gap-32 { margin-top: 32px; }
.grid--24 { margin-top: 24px; }
.grid--flush { margin-top: 0; }
.stack { display: grid; gap: 24px; margin-top: 24px; }
.followup { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule-parchment); max-width: 1040px; }

/* Fields */
.field { display: grid; gap: 8px; align-content: start; min-width: 0; }
.field--narrow { max-width: 340px; }
.field__label { font-size: var(--fs-body); color: var(--text-secondary); }
.field__helper { font-size: var(--fs-caption); line-height: 1.65; color: var(--text-muted); }
.field__error { font-size: var(--fs-caption); line-height: 1.65; font-weight: 500; color: var(--text); margin: 0; }
.field__error::before { content: "Error: "; }
.field__error--indented { margin: 8px 0 0 36px; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="password"], select, textarea {
  font-family: inherit; font-size: var(--fs-body); line-height: 1.6; color: var(--text);
  background: transparent; border: 0; border-bottom: 1px solid var(--rule-parchment); border-radius: 0;
  height: 48px; padding: 0; width: 100%; appearance: none; -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus { outline: 0; border-bottom-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }
input::placeholder { color: var(--text-muted); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-bottom-color: var(--ink); box-shadow: 0 1px 0 0 var(--ink); }

.readonly {
  height: 48px; display: flex; align-items: center; border-bottom: 1px solid var(--rule);
  font-size: var(--fs-body); color: var(--text-muted);
}
.readonly--strong { color: var(--text); }

/* Choice groups */
.choice-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.question { font-size: var(--fs-label); font-weight: 500; color: var(--text-secondary); padding: 0; }
.question__helper { font-size: var(--fs-caption); line-height: 1.65; color: var(--text-muted); margin: 8px 0 0; max-width: var(--measure); }
.choice-group > .field__error { margin-top: 8px; }

/* Native inputs kept for keyboard and assistive tech, drawn by their labels */
.choice-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }

.chips { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin-top: 16px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  background: transparent; color: var(--text); border: 1px solid var(--rule-parchment); border-radius: var(--radius);
  min-height: 48px; padding: 12px 24px; font-size: var(--fs-body); line-height: 1.4; font-weight: 500;
  text-align: center; cursor: pointer;
}
.chip__mark { flex: 0 0 14px; width: 14px; text-align: center; opacity: 0; }
.chip__label { flex: 1 1 auto; text-align: center; }
.chip__pad { flex: 0 0 14px; }
.choice-input:checked + .chip { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.choice-input:checked + .chip .chip__mark { opacity: 1; }
.choice-input:focus-visible + .chip { outline: 2px solid var(--ink); outline-offset: 2px; }

.rows { display: grid; margin-top: 16px; }
.choice-group > .rows:first-child, legend.visually-hidden + .rows { margin-top: 0; }
.rows--grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 0 40px; }
.row-choice { position: relative; }
.row-choice__label {
  display: flex; gap: 16px; width: 100%; text-align: left; cursor: pointer;
  border-top: 1px solid var(--rule); padding: 24px 0;
}
.row-choice__label:hover { border-top-color: var(--ink); }
.row-choice__mark { flex: 0 0 18px; width: 18px; text-align: center; font-size: 18px; line-height: 1.4; color: var(--ink); opacity: 0; }
.row-choice__text { flex: 1 1 auto; min-width: 0; }
.row-choice__title { display: block; font-weight: 500; font-size: var(--fs-label); line-height: 1.4; letter-spacing: -0.005em; color: var(--text); }
.row-choice__note { display: block; font-size: var(--fs-body); line-height: 1.6; color: var(--text-secondary); margin-top: 8px; max-width: var(--measure); }
.choice-input:checked + .row-choice__label { border-top-color: var(--ink); }
.choice-input:checked + .row-choice__label .row-choice__mark { opacity: 1; }
.choice-input:focus-visible + .row-choice__label { outline: 2px solid var(--ink); outline-offset: 2px; }

.checkbox { position: relative; }
.checkbox__label { display: flex; gap: 16px; text-align: left; font-size: var(--fs-body); line-height: 1.6; color: var(--text); cursor: pointer; }
.checkbox--muted .checkbox__label { color: var(--text-secondary); }
.checkbox__box {
  flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px; border: 1px solid var(--rule-parchment);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1; color: transparent; background: transparent;
}
.choice-input:checked + .checkbox__label .checkbox__box { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.choice-input:focus-visible + .checkbox__label .checkbox__box { outline: 2px solid var(--ink); outline-offset: 2px; }
.checkbox__link { display: inline-block; margin: 8px 0 0 36px; font-size: var(--fs-caption); color: var(--text-muted); }
.checkbox__note { font-size: var(--fs-caption); line-height: 1.65; color: var(--text-muted); margin: 16px 0 0 36px; }

.declaration-list { list-style: none; display: grid; gap: 12px; margin: 16px 0 0 36px; padding: 0; }
.declaration-list li { display: flex; gap: 16px; font-size: var(--fs-body); line-height: 1.6; color: var(--text-secondary); }
.declaration-list li::before { content: "·"; color: var(--stone); }

.readonly-rows { margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--rule); max-width: 1040px; }
.readonly-row { display: flex; flex-wrap: wrap; gap: 8px 40px; align-items: baseline; padding: 24px 0; border-top: 1px solid var(--rule); }
.readonly-row:first-child { padding-top: 0; border-top: 0; }
.readonly-row dt { flex: 0 0 240px; font-size: var(--fs-caption); color: var(--text-muted); }
.readonly-row dd { flex: 1 1 auto; margin: 0; font-size: var(--fs-body); color: var(--text); }

/* Shipping preview */
.panel { margin-top: 40px; padding: 40px; background: var(--parchment); max-width: 1040px; }
.panel__eyebrow { margin: 0; font-size: var(--fs-eyebrow); font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-secondary); }
.panel__address {
  margin: 24px 0 0; font-family: var(--serif); font-weight: 400; font-size: var(--fs-section);
  line-height: 1.14; letter-spacing: -0.004em; color: var(--text);
}
.panel__delivery { margin: 16px 0 0; font-size: var(--fs-body); line-height: 1.6; color: var(--text-secondary); }

/* Review */
.review { margin-top: 40px; max-width: 1040px; }
.review-row { display: flex; flex-wrap: wrap; gap: 16px 40px; padding: 24px 0; border-top: 1px solid var(--rule); }
.review-row__label { flex: 0 0 240px; margin: 0; font-size: var(--fs-caption); font-weight: 400; line-height: 1.65; color: var(--text-muted); }
.review-row__value { flex: 1 1 400px; min-width: 0; display: grid; font-size: var(--fs-body); line-height: 1.6; color: var(--text); }
.review-row__edit { flex: 0 0 auto; font-size: var(--fs-caption); color: var(--text-muted); }

/* Done */
.done-title {
  font-family: var(--serif); font-weight: 400; font-size: var(--fs-display); line-height: 1.08;
  letter-spacing: -0.008em; color: var(--text); margin: 24px 0 0; max-width: 18ch;
}
.done-title:focus { outline: none; }
.done-lede { font-size: var(--fs-lede); font-weight: 300; line-height: 1.4; color: var(--text-secondary); margin: 24px 0 0; max-width: var(--measure); }
.done-lede--gap { margin-top: 40px; }
.progress { list-style: none; margin: 40px 0 0; padding: 0; max-width: 1040px; }
.progress__row { display: flex; gap: 16px; padding: 24px 0; border-top: 1px solid var(--rule); }
.progress__number { flex: 0 0 40px; font-size: var(--fs-caption); color: var(--text-muted); }
.progress__label { flex: 1 1 auto; min-width: 0; font-size: var(--fs-body); line-height: 1.6; color: var(--text-muted); }
.progress__row--complete .progress__label { color: var(--text); }
.progress__state { flex: 0 0 auto; font-size: var(--fs-caption); color: var(--text-muted); }

/* Errors */
.error-summary { margin-top: 40px; padding: 24px; border: 2px solid var(--ink); max-width: 1040px; }
.error-summary:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.error-summary__title { margin: 0; font-size: var(--fs-label); font-weight: 500; }
.error-summary ul { margin: 12px 0 0; padding-left: 20px; }
.error-summary a { text-decoration: underline; }

/* Nav and buttons */
.nav {
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center;
  margin-top: var(--s-56); padding-top: 24px; border-top: 1px solid var(--rule);
}
.nav__right { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.hint { margin: 0; font-size: var(--fs-caption); color: var(--text-muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 32px;
  border-radius: var(--radius); font-family: inherit; font-size: var(--fs-body); font-weight: 500; cursor: pointer;
}
.btn--primary { background: var(--ink); color: var(--cream); border: 1px solid var(--ink); }
.btn--primary:hover { color: var(--cream); }
.btn--secondary { background: transparent; color: var(--text); border: 1px solid var(--rule-parchment); }
.btn--secondary:hover { border-color: var(--ink); color: var(--text); }
.btn--placeholder { visibility: hidden; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); }
.site-footer__inner { max-width: var(--page-max); margin: 0 auto; padding: var(--footer-pad) var(--gutter) 40px; }
.site-footer__top { display: flex; flex-wrap: wrap; gap: 24px 40px; justify-content: space-between; align-items: baseline; }
.site-footer__wordmark { display: block; height: 28px; width: auto; }
.site-footer__operator { font-size: var(--fs-caption); color: var(--text-secondary); max-width: 24em; line-height: 1.65; margin: 16px 0 0; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 16px 32px; font-size: var(--fs-caption); }
.site-footer__links a { color: var(--text-secondary); }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; gap: 16px 40px; justify-content: space-between;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: var(--fs-caption); color: var(--text-muted);
}
.site-footer__bottom p { margin: 0; max-width: 46em; line-height: 1.6; }

/* Session timeout warning (WCAG 2.2.1) */
.timeout-warning {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between;
  padding: 24px var(--gutter); background: var(--ink); color: var(--on-ink);
}
.timeout-warning p { margin: 0; max-width: 46em; }
.timeout-warning .btn--primary { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.timeout-warning :focus-visible { outline-color: var(--on-ink); }

/* Account pages (sign up, sign in, MFA, passkeys) rendered by allauth.
   They place their content directly in <main>; the steps use section.step. */
.main > form, .main > h1, .main > p { max-width: 46em; }
.main h1:not(.step-title):not(.done-title) {
  font-family: var(--serif); font-weight: 400; font-size: var(--fs-section); line-height: 1.14; margin: 56px 0 0;
}
.main form button[type="submit"], .main form button:not([type]) {
  height: 48px; padding: 0 32px; border-radius: var(--radius); font-family: inherit; font-size: var(--fs-body);
  font-weight: 500; cursor: pointer; background: var(--ink); color: var(--cream); border: 1px solid var(--ink); margin-top: 24px;
}

/* Document upload (templates/intake/partials/upload.html) */
.upload { margin-top: 24px; max-width: 46em; }
.upload__current { margin: 0; font-size: var(--fs-body); color: var(--text); }
