/* =====================================================================
   Base — reset, typography, forms, buttons, utilities
   ===================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }

/* --- Headings ------------------------------------------------------ */
.display {
  font-family: var(--font-serif);
  font-size: var(--display);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  font-weight: 400;
  text-wrap: balance;
}
.display em { font-style: italic; }

h1, .h1 { font-size: var(--h1); line-height: var(--lh-heading); letter-spacing: var(--ls-h1); font-weight: 600; text-wrap: balance; }
h2, .h2 { font-size: var(--h2); line-height: var(--lh-heading); letter-spacing: var(--ls-h2); font-weight: 600; text-wrap: balance; }
h3, .h3 { font-size: var(--h3); line-height: 1.25;             letter-spacing: var(--ls-h3); font-weight: 600; }

.lede      { font-size: var(--body-lg); color: var(--text-muted); text-wrap: pretty; }
.muted     { color: var(--text-muted); }
.faint     { color: var(--text-faint); }
.small     { font-size: var(--small); }
.tiny      { font-size: var(--tiny); }

.label {
  font-size: var(--tiny);
  font-weight: 600;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

.serif { font-family: var(--font-serif); font-weight: 400; }

/* --- Links --------------------------------------------------------- */
a {
  color: var(--primary);
  text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent);
  text-underline-offset: 0.18em;
  transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--primary-hover); text-decoration-color: currentColor; }

/* --- Focus --------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* Skip link: present for keyboard users, out of the way for everyone else. */
.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 100;
  padding: var(--s-3) var(--s-5);
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--t-base) var(--ease-out);
}
.skip-link:focus { top: var(--s-4); color: var(--primary-ink); }

/* --- Layout -------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-8); }

.row { display: flex; align-items: center; gap: var(--s-3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }

.section { padding-block: clamp(3rem, 2rem + 5vw, 6rem); }

/* --- Buttons ------------------------------------------------------- */
.btn {
  --btn-bg: var(--primary);
  --btn-ink: var(--primary-ink);
  --btn-border: transparent;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--touch);
  padding: 0 var(--s-6);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 0.9375rem;      /* 15 */
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease),
              opacity var(--t-fast) var(--ease);
}
.btn:hover { --btn-bg: var(--primary-hover); color: var(--btn-ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--secondary {
  --btn-bg: var(--surface);
  --btn-ink: var(--text);
  --btn-border: var(--border-strong);
}
.btn--secondary:hover { --btn-bg: var(--surface-2); --btn-ink: var(--text); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-ink: var(--text);
  --btn-border: transparent;
}
.btn--ghost:hover { --btn-bg: rgba(23, 22, 15, 0.05); --btn-ink: var(--text); }

.btn--danger { --btn-bg: var(--danger); --btn-ink: #fff; }
.btn--danger:hover { --btn-bg: var(--danger-ink); }

.btn--lg { min-height: 56px; padding-inline: var(--s-8); font-size: var(--body); border-radius: var(--r-lg); }
.btn--sm { min-height: 36px; padding-inline: var(--s-4); font-size: var(--small); border-radius: var(--r-sm); }
.btn--block { width: 100%; }

.btn--icon { padding-inline: 0; width: var(--touch); }

/* --- Forms --------------------------------------------------------- */
.field { display: block; }
.field + .field { margin-top: var(--s-5); }

.field__label {
  display: block;
  margin-bottom: var(--s-2);
  font-size: var(--small);
  font-weight: 600;
}
.field__hint { margin-top: var(--s-2); font-size: var(--small); color: var(--text-muted); }
.field__error { margin-top: var(--s-2); font-size: var(--small); color: var(--danger-ink); font-weight: 500; }

.input,
.textarea,
.select {
  width: 100%;
  min-height: var(--touch);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--body);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.textarea { min-height: 7rem; resize: vertical; line-height: var(--lh-body); padding-block: var(--s-3); }

.input:hover, .textarea:hover, .select:hover { border-color: var(--text-faint); }

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.input[disabled], .textarea[disabled], .select[disabled] {
  background: var(--surface-3);
  color: var(--text-faint);
  cursor: not-allowed;
}

.input[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--danger);
}
.input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);
}

.select {
  appearance: none;
  padding-right: var(--s-10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236E6A61' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--s-4) center;
}

/* Checkbox and switch */
.check { display: flex; align-items: flex-start; gap: var(--s-3); cursor: pointer; }
.check input[type="checkbox"] {
  flex: none;
  width: 20px; height: 20px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}
.check__text { font-size: var(--small); }
.check__title { font-weight: 600; font-size: var(--body); display: block; }

/* --- Segmented control --------------------------------------------- */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: var(--surface-3);
  border-radius: var(--r-md);
}
.segmented__option {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: var(--r-sm);
  padding: var(--s-2) var(--s-5);
  min-height: 38px;
  font-size: var(--small);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.segmented__option[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* --- Badges -------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 5px var(--s-3);
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: var(--tiny);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge--success { background: var(--success-bg); color: var(--success-ink); }
.badge--warning { background: var(--warning-bg); color: var(--warning-ink); }
.badge--danger  { background: var(--danger-bg);  color: var(--danger-ink); }

/* --- Cards --------------------------------------------------------- */
.card {
  background: var(--surface);
  border-radius: var(--r-2xl);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  box-shadow: var(--shadow-md);
}
.card--flat { box-shadow: none; border: 1px solid var(--border); }

/* --- Notices ------------------------------------------------------- */
.notice {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: var(--small);
  line-height: 1.5;
}
.notice--success { background: var(--success-bg); color: var(--success-ink); }
.notice--warning { background: var(--warning-bg); color: var(--warning-ink); }
.notice--danger  { background: var(--danger-bg);  color: var(--danger-ink); }
.notice svg { flex: none; margin-top: 1px; }

/* --- Spinner ------------------------------------------------------- */
@keyframes tf-spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 1em; height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tf-spin 720ms linear infinite;
  vertical-align: -0.125em;
}

@keyframes tf-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rise { animation: tf-rise var(--t-slow) var(--ease-out) both; }

/* --- Toast --------------------------------------------------------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: var(--s-6);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  width: min(26rem, calc(100vw - 2rem));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-md);
  background: var(--text);
  color: var(--bg);
  font-size: var(--small);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: tf-rise var(--t-base) var(--ease-out) both;
}
.toast--danger { background: var(--danger-ink); color: #fff; }

/* --- Logo (shared by the marketing shell and the delivery page) ------ */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--logo-ink, var(--primary));
}
.logo__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex: none;
}
.logo__word {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: currentColor;
}

/* --- Third-party sign-in -------------------------------------------- */
.google-btn {
  gap: var(--s-3);
  font-weight: 600;
}
.google-btn svg { flex: none; }

.or-divider {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-block: var(--s-5);
  color: var(--text-faint);
  font-size: var(--tiny);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
}
.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --- Utilities ----------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
[hidden] { display: none !important; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
