/* Chamber of Progress account dashboard.
   Visual system per bluehorizon DESIGN.md: warm-paper neutrals, Fabric Sans,
   layered shadows, Restrained color (Progress Blue accent, issue-axis dots).
   Register: product. Reduced-motion-first. */

@font-face { font-family: 'Fabric Sans'; src: url('/fonts/FabricSans-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fabric Sans'; src: url('/fonts/FabricSans-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Fabric Sans'; src: url('/fonts/FabricSans-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  /* Palette (theme.json / DESIGN.md) */
  --blue: #0665FF;
  --blue-light: #5596FF;
  --blue-text: #266AD9;
  --blue-deepest: #002F87;
  --orange: #DF621B;
  --purple: #7B72E2;
  --green: #54A862;

  /* Warm neutrals */
  --paper: hsl(20, 60%, 98%); /* site --color-bg exactly */
  --surface: #ffffff;
  --surface-quiet: #F1EEE9;
  --ink: #15171c;
  --ink-medium: #525866;
  --ink-soft: #8a93a4;
  --rule: #E3E5EA;
  --rule-bold: #D0D5DD;

  /* Elevation */
  --shadow-sm: 0 1px 1px rgba(15,23,42,.04), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 6px 18px -8px rgba(15,23,42,.14), 0 2px 4px rgba(15,23,42,.04);

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;

  /* Motion */
  --ease: cubic-bezier(0.165, 0.84, 0.44, 1);

  /* States */
  --ok: #1c7c43;
  --err: #a4262c;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  font-family: 'Fabric Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
a { color: var(--blue-text); }
a:hover { color: var(--blue); }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: 880px; margin: 0 auto; padding: 28px 20px 72px; }

/* Header + display title */
.site-head { margin-bottom: 28px; }
.site-head__logo { display: inline-block; line-height: 0; }
.site-head__logo img { width: 112px; height: auto; display: block; }

.page-title {
  font-size: clamp(2.125rem, 6vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin: 0 0 30px;
  color: var(--ink);
}

/* Account layout: left rail + content (Verge-grounded, warm-paper build) */
.account-layout { display: block; }
@media (min-width: 768px) {
  .account-layout {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }
}

.account-nav {
  display: none;
  position: sticky;
  top: 28px;
  padding-top: 6px;
}
@media (min-width: 768px) {
  .account-nav { display: flex; flex-direction: column; gap: 2px; }
}
.account-nav__item {
  display: block;
  font: 500 0.9375rem/1.3 'Fabric Sans', sans-serif;
  color: var(--ink-medium);
  text-decoration: none;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
  transition: color 140ms var(--ease), background-color 140ms var(--ease);
}
.account-nav__item:hover { color: var(--ink); background: var(--surface-quiet); }
.account-nav__logout {
  margin-top: 14px;
  font: 500 0.6875rem/1.4 'Fabric Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.account-nav__logout:hover { color: var(--err); background: none; }

/* Sections */
.account-section { padding: 0 0 34px; margin: 0 0 34px; border-bottom: 1px solid var(--rule); }
.account-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.account-section__title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink);
}

/* The DESIGN.md label idiom */
.group-label {
  font: 500 0.6875rem/1.4 'Fabric Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-medium);
  margin: 26px 0 6px;
}
.group-label:first-of-type { margin-top: 18px; }

/* Category dots (issue-axis accents; the family/Discover vocabulary) */
.cat-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: baseline;
  background: var(--blue);
}
.cat-dot--technology { background: var(--blue); }
.cat-dot--social { background: var(--purple); }
.cat-dot--civic { background: var(--green); }
.cat-dot--economic { background: var(--orange); }

/* Follow rows */
.pill-list { list-style: none; margin: 0; padding: 0; }
.pill-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.pill-list li:last-child { border-bottom: 0; }
.pill-list a { font-weight: 500; text-decoration: none; color: var(--ink); }
.pill-list a:hover { color: var(--blue-text); text-decoration: underline; }
.pill-list li > span:first-child { font-weight: 500; }

.pill__controls { display: flex; align-items: center; gap: 10px; }
/* Segmented cadence toggle: [Instant | Roundup], radios underneath */
.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface-quiet);
}
.seg input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}
.seg label {
  font: 500 0.75rem/1 'Fabric Sans', sans-serif;
  color: var(--ink-medium);
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 140ms var(--ease), background-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.seg label:hover { color: var(--ink); }
.seg input:checked + label {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.seg input:focus-visible + label {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--blue);
}
.pill__remove {
  background: none; border: 0; cursor: pointer;
  font-size: 1rem; line-height: 1;
  color: var(--ink-soft); padding: 6px;
  border-radius: var(--r-sm);
  transition: color 140ms var(--ease);
}
.pill__remove:hover { color: var(--err); }

/* ⊕ chip list (the Discover vocabulary — Verge-style text links, our clothes) */
.chip-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
@media (min-width: 640px) {
  .chip-list--columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 24px; }
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 500 0.875rem/1.4 'Fabric Sans', sans-serif;
  color: var(--blue-text);
  background: none;
  border: 0;
  padding: 5px 2px;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: color 140ms var(--ease);
}
.chip::before {
  content: '';
  width: 15px; height: 15px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M8 4.5v7M4.5 8h7' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M8 4.5v7M4.5 8h7' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.chip:hover { color: var(--blue); }

/* Cards (login + standalone pages keep the layered-paper card) */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  margin-bottom: 20px;
}
.card h2 { font-size: 1.125rem; font-weight: 700; margin: 0 0 10px; color: var(--ink); }
.login-card { max-width: 460px; }

/* Forms */
.field { display: block; margin-bottom: 14px; max-width: 460px; }
.field span {
  display: block;
  font: 500 0.6875rem/1.4 'Fabric Sans', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-medium);
  margin-bottom: 6px;
}
.field input[type='email'], .field select {
  width: 100%;
  padding: 10px 12px;
  font: 400 0.9375rem/1.4 'Fabric Sans', sans-serif;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color 140ms var(--ease);
}
.field input[type='email']:hover, .field select:hover { border-color: var(--rule-bold); }
.field input[type='email']:focus-visible, .field select:focus-visible { outline-offset: 0; }

.picker-grid { display: grid; gap: 6px; }
@media (min-width: 640px) { .picker-grid { grid-template-columns: 1fr 1fr; gap: 16px; } }

/* Buttons — mirrors the theme's _buttons.scss (gloss, hover-lighter, press) */
.btn {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
  font: 500 1rem/1.2 'Fabric Sans', sans-serif;
  padding: 9px 18px;
  border-radius: 0.375em;
  border: 0;
  background: var(--surface-quiet);
  color: var(--ink);
  cursor: pointer;
  transition: 0.2s;
}
.btn:hover { background: var(--rule); }
.btn:active { transform: translateY(2px); }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px rgba(21, 23, 28, 0.15);
}
.btn--primary {
  background: var(--blue);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15),
              0 1px 3px rgba(0,47,135,.25),
              0 2px 6px rgba(0,47,135,.1),
              0 6px 10px -2px rgba(0,47,135,.25);
}
.btn--primary:hover {
  background: var(--blue-light);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15),
              0 1px 2px rgba(0,47,135,.25),
              0 1px 4px rgba(0,47,135,.1),
              0 3px 6px -2px rgba(0,47,135,.25);
}
.btn--primary:focus-visible {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15),
              0 1px 2px rgba(0,47,135,.25),
              0 0 0 2px var(--paper), 0 0 0 4px var(--blue);
}
.btn--danger { color: var(--err); }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; }

/* Status + text utilities */
.status { font-size: 0.875rem; margin: 10px 0 0; min-height: 1.3em; }
.status--ok { color: var(--ok); }
.status--err { color: var(--err); }
.muted { color: var(--ink-medium); }
.small { font-size: 0.875rem; }
.quiet-link { margin-top: 18px; }
.quiet-link a { color: var(--ink-soft); }
.quiet-link a:hover { color: var(--err); }

.hidden { display: none !important; }

/* Skeleton loading (static: reduced-motion-first, no shimmer) */
.skeleton {
  background: var(--surface-quiet);
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}
.skeleton--label { width: 120px; height: 12px; margin-top: 8px; }
.skeleton--row { height: 40px; }
.skeleton--short { width: 60%; }

/* Standalone pages (welcome / unsubscribe) share the shell without the rail */
.wrap > .card { max-width: 560px; }
