/*
  Wayfinder for the account pages: restore access, magic-login, unsubscribe, and Settings. Loaded after styles.css and
  wayfinder.css. Scripts show and hide the blocks inside the cards, so the older class names stay and are restyled here.
*/

.wf-account-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 24px;
}

.wf-account-main {
  display: block;
  margin: 0;
}

body.wf-account .wf-account-card {
  display: grid;
  gap: 18px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  color: var(--ink);
}

body.wf-account .wf-account-card > div:not(.hidden) {
  display: grid;
  gap: 18px;
}

body.wf-account .wf-account-card > div.hidden {
  display: none;
}

body.wf-account h1,
body.wf-account h2 {
  margin: 0;
  max-width: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

body.wf-account h1 {
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.05;
}

body.wf-account .eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

body.wf-account .hero-text,
body.wf-account .summary-text {
  max-width: 38em;
  margin: 0;
  color: var(--body2);
  font-size: 17px;
  line-height: 1.55;
}

body.wf-account .status-message {
  margin: 0;
  color: var(--body2);
  font-size: 15px;
}

body.wf-account .status-message[data-tone="error"] {
  color: var(--warn);
}

body.wf-account .settings-form,
body.wf-account form {
  display: grid;
  gap: 16px;
}

body.wf-account label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

body.wf-account input[type="email"],
body.wf-account input[type="text"],
body.wf-account select {
  width: 100%;
  min-height: 56px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ground);
  color: var(--ink);
  font: 500 17px/1.2 var(--font-body);
}

body.wf-account input:focus-visible,
body.wf-account select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body.wf-account .settings-actions,
body.wf-account .onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

body.wf-account .settings-link-button {
  text-decoration: none;
}

body.wf-account .wf-footer {
  margin-top: 24px;
  padding: 24px 0;
}

body.wf-account .wf-footer a {
  color: var(--accent-deep);
}

@media (max-width: 640px) {
  .wf-account-shell {
    padding: 24px 16px 16px;
  }

  body.wf-account .settings-actions .primary-button,
  body.wf-account .settings-actions .secondary-button,
  body.wf-account .onboarding-actions .primary-button,
  body.wf-account .onboarding-actions .secondary-button {
    width: 100%;
  }

}

/* ---------- Settings ---------- */
.wf-settings-shell,
.wf-moveday-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 24px;
}

body.wf-settings .results {
  display: grid;
  gap: 20px;
  margin: 0;
}

body.wf-settings .panel {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}

body.wf-settings .settings-hero-panel {
  background-image: none;
}

body.wf-settings .settings-hero-panel::before,
body.wf-settings .settings-hero-panel::after,
body.wf-settings .settings-section-icon,
body.wf-settings .settings-section::before,
body.wf-settings .settings-section::after {
  display: none;
}

body.wf-settings h1 {
  margin: 0;
  max-width: none;
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

body.wf-settings h2 {
  margin: 0;
  max-width: none;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

body.wf-settings .eyebrow,
body.wf-settings .calendar-label {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

body.wf-settings .summary-text {
  margin: 8px 0 0;
  color: var(--body2);
  font-size: 17px;
}

body.wf-settings .settings-helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

body.wf-settings .settings-section {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 3.5vw, 32px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
}

body.wf-settings .settings-section > * {
  margin: 0;
}

/* Eyebrow above the heading in every card, whether or not the markup wraps them. */
body.wf-settings .panel-header {
  display: grid;
  justify-content: stretch;
  gap: 6px;
  padding: 0;
}

body.wf-settings .settings-header-actions,
body.wf-settings .settings-header-actions-inline {
  margin-left: auto;
}

body.wf-settings .settings-form {
  display: grid;
  gap: 16px;
}

/* Date, how you are moving and who is moving share the top row, on the same three columns as the place groups below it. */
body.wf-settings .settings-move-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 0.9fr);
  gap: 16px;
}

/* Where you are leaving on top, where you are going below it: each group is a location, the kind of place and its size across one
   row, so a place and its size stay together. */
body.wf-settings .settings-place-groups {
  display: grid;
  gap: 16px;
}

/* "Moving from" and "Moving to" head each group, so the labels under them can be short. Each group sits in its own outlined box so
   the three fields read as one unit. */
body.wf-settings .settings-place-group-title {
  grid-column: 1 / -1;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

/* The kind-of-place menu gets the widest column: its longest label is "Buying an apartment or condo". */
body.wf-settings .settings-place-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 0.9fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
}

/* The five extras sit in two even columns. The extra class beats the generic .toggle-grid rule further down, which would
   otherwise fit as many columns as the width allows. */
body.wf-settings .toggle-grid.settings-move-extras {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 640px) {
  body.wf-settings .settings-move-grid,
  body.wf-settings .settings-place-group,
  body.wf-settings .toggle-grid.settings-move-extras {
    grid-template-columns: 1fr;
  }
}

body.wf-settings label {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

body.wf-settings label:not(.toggle) {
  display: grid;
  gap: 8px;
}

body.wf-settings input[type="text"],
body.wf-settings input[type="email"],
body.wf-settings input[type="date"],
body.wf-settings input:not([type]),
body.wf-settings select {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--ground);
  color: var(--ink);
  font: 500 16px/1.2 var(--font-body);
}

body.wf-settings input:focus-visible,
body.wf-settings select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body.wf-settings .toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

body.wf-settings .toggle-grid .toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 500;
}

body.wf-settings .toggle input[type="checkbox"] {
  accent-color: var(--accent);
}

body.wf-settings .settings-notifications-form .toggle-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

body.wf-settings .toggle-grid .toggle:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--tint);
}

body.wf-settings .settings-actions,
body.wf-settings .settings-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

body.wf-settings .settings-plan-banner,
body.wf-settings .settings-no-active-move-card {
  padding: 18px 20px;
  border: 0;
  border-radius: 18px;
  background: var(--tint);
  color: var(--ink);
}

body.wf-settings .settings-detail-options,
body.wf-settings .settings-support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

body.wf-settings .settings-theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

body.wf-settings .settings-detail-button,
body.wf-settings .settings-theme-option,
body.wf-settings .settings-support-action {
  display: grid;
  gap: 4px;
  justify-content: stretch;
  justify-items: start;
  align-content: center;
  min-height: 72px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

body.wf-settings .settings-detail-button:hover,
body.wf-settings .settings-theme-option:hover,
body.wf-settings .settings-support-action:hover {
  border-color: var(--accent);
}

body.wf-settings .settings-theme-option[aria-checked="true"],
body.wf-settings .settings-detail-button[aria-pressed="true"],
body.wf-settings .settings-detail-button.is-selected,
body.wf-settings .settings-detail-button.is-current {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: var(--tint);
}

body.wf-settings .settings-detail-name {
  font-size: 17px;
  font-weight: 600;
}

body.wf-settings .settings-detail-description,
body.wf-settings .settings-detail-meta {
  color: var(--muted);
  font-size: 14px;
}

body.wf-settings .settings-danger-section {
  border-color: var(--warn);
}

body.wf-settings .settings-danger-section .eyebrow {
  color: var(--warn);
}

body.wf-settings .settings-danger-button {
  background: var(--warn);
  color: var(--surface);
}

body.wf-settings .settings-inline-saved {
  color: var(--accent-deep);
}

body.wf-settings .settings-inline-unsaved,
body.wf-settings .settings-field-error {
  color: var(--warn);
}

body.wf-settings .settings-toast {
  border-radius: 14px;
  background: var(--ink);
  color: var(--ground);
  font-family: var(--font-body);
}

body.wf-settings a.settings-restore-text-link,
body.wf-settings .settings-helper-text a {
  color: var(--accent-deep);
}

body.wf-settings .wf-footer,
body.wf-moveday .wf-footer {
  margin-top: 16px;
  padding: 24px 0;
}

body.wf-settings .wf-footer a,
body.wf-moveday .wf-footer a {
  color: var(--ink);
}

@media (max-width: 640px) {
  .wf-settings-shell,
  .wf-moveday-shell {
    padding: 24px 16px 16px;
  }
}

body.wf-settings .settings-account-primary label {
  color: var(--ink);
}

/* Contact and notifications: each group (Email, Email notifications) opens with the same small label, a hairline divides the
   two, and everything inside a group is spaced the same, so the card reads as two blocks and not one run of controls. */
body.wf-settings .settings-account-label {
  display: block;
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

body.wf-settings .settings-account-form {
  display: grid;
  gap: 12px;
}

body.wf-settings #settings-email-list {
  display: grid;
  gap: 12px;
}

body.wf-settings #settings-email-list:empty {
  display: none;
}

body.wf-settings .settings-account-primary {
  display: grid;
  gap: 12px;
}

body.wf-settings .settings-notifications-header-row {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

body.wf-settings .settings-notifications-header-row {
  margin-bottom: 0;
}

body.wf-settings .settings-notifications-header-row .calendar-label {
  margin-bottom: 0;
}

body.wf-settings .settings-notifications-form {
  margin-top: 0;
}

body.wf-settings .settings-detail-description,
body.wf-settings .settings-detail-meta {
  opacity: 1;
}

body.wf-settings .settings-account-form,
body.wf-settings .settings-inline-helper {
  max-width: none;
}

body.wf-settings .settings-communication-header-top,
body.wf-settings .settings-billing-header-top {
  display: grid;
  gap: 4px;
  justify-content: stretch;
}

/* A card whose heading has a Save button: the button sits on the heading's row, to its right, so there is no empty row under the
   heading. On a narrow screen it drops below the heading and takes the full width. */
body.wf-settings .settings-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
}

@media (max-width: 640px) {
  body.wf-settings .settings-card-header {
    display: grid;
    gap: 12px;
    justify-content: stretch;
  }

  body.wf-settings .settings-card-header > .settings-header-actions {
    justify-content: flex-start;
  }
}

/* ---------- Move Day: cards, timeline and buttons use the tokens ---------- */
body.wf-moveday.move-day-page {
  background: var(--ground);
}

body.wf-moveday .wf-moveday-shell .primary-button {
  background: var(--accent);
  box-shadow: none;
  color: var(--accent-ink);
}

body.wf-moveday .wf-moveday-shell .primary-button:hover {
  background: var(--accent-deep);
  color: var(--accent-ink);
}

body.wf-moveday .panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}

body.wf-moveday h1,
body.wf-moveday h2 {
  max-width: none;
  color: var(--ink);
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

body.wf-moveday h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.02;
}

body.wf-moveday .move-day-primary-card h2 {
  font-size: 30px;
}

body.wf-moveday .summary-text,
body.wf-moveday .move-day-phase-summary,
body.wf-moveday .move-day-inline-note {
  color: var(--body2);
}

body.wf-moveday .calendar-label,
body.wf-moveday .move-day-card-day,
body.wf-moveday .move-day-card-time,
body.wf-moveday .move-day-progress-label,
body.wf-moveday .move-day-progress-stage {
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
}

body.wf-moveday .move-day-progress-shell,
body.wf-moveday #move-day-route,
body.wf-moveday .move-day-control-panel,
body.wf-moveday .move-day-notes-details,
body.wf-moveday .move-day-adjust-inline-prominent,
body.wf-moveday .move-day-start-time-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
  color: var(--ink);
}

body.wf-moveday .move-day-progress-bar {
  border: 0;
  background: var(--track);
}

body.wf-moveday .move-day-progress-bar span {
  background: var(--accent);
}

body.wf-moveday .move-day-phase-body,
body.wf-moveday .move-day-secondary-muted,
body.wf-moveday .move-day-done-muted .move-day-phase-body,
body.wf-moveday .timeline-card--completed .move-day-phase-body {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
  color: var(--ink);
}

body.wf-moveday .move-day-primary-card,
body.wf-moveday .move-day-phase-body-current,
body.wf-moveday .timeline-card--active .move-day-phase-body {
  border: 2px solid var(--accent);
  background: var(--surface);
  box-shadow: none;
}

body.wf-moveday .move-day-now-banner {
  border: 0;
  background: var(--tint);
}

body.wf-moveday .move-day-now-copy strong,
body.wf-moveday .move-day-reopen-button {
  color: var(--accent-deep);
}

body.wf-moveday .move-day-watch-card {
  border: 1px solid var(--warn);
  background: var(--surface);
}

body.wf-moveday .move-day-flow::before,
body.wf-moveday .move-day-phase-stem {
  background: var(--line);
}

body.wf-moveday .move-day-phase-marker {
  border: 2px solid var(--ring);
  background: var(--surface);
  box-shadow: none;
}

body.wf-moveday .timeline-card--active .move-day-phase-marker,
body.wf-moveday .move-day-phase-marker-current {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--tint);
}

body.wf-moveday .timeline-card--completed .move-day-phase-marker,
body.wf-moveday .move-day-phase-marker-done {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: none;
}

body.wf-moveday .move-day-phase-marker-later {
  background: var(--surface);
  box-shadow: none;
}

body.wf-moveday .move-day-timing-row {
  border-bottom: 1px solid var(--line);
}

body.wf-moveday .move-day-timing-row:hover {
  background: var(--tint);
}

body.wf-moveday .move-day-phase-summary,
body.wf-moveday .move-day-primary-card .move-day-phase-summary {
  color: var(--body2);
}

body.wf-moveday .timeline-card {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.wf-moveday .move-day-flow h2,
body.wf-moveday .move-day-flow h3,
body.wf-moveday .move-day-flow summary,
body.wf-moveday .move-day-flow strong,
body.wf-moveday .move-day-secondary-muted h2,
body.wf-moveday .move-day-done-muted h2 {
  color: var(--ink);
}

body.wf-moveday .move-day-meta-row > *,
body.wf-moveday .move-day-timing-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--body2);
}

body.wf-moveday .move-day-flow .move-day-notes-details,
body.wf-moveday .move-day-flow .move-day-notes-details summary {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

body.wf-moveday #move-day-context,
body.wf-moveday #move-day-arrival-chip,
body.wf-moveday .move-day-meta-row .calendar-label {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--body2);
}

body.wf-moveday .move-day-card-topline h2,
body.wf-moveday .move-day-card-topline-copy h2 {
  color: var(--ink);
}

body.wf-moveday .wf-moveday-shell .move-day-flow h2,
body.wf-moveday .wf-moveday-shell .move-day-card-topline h2 {
  color: var(--ink);
  opacity: 1;
}

body.wf-moveday .wf-moveday-shell .move-day-meta-row > * {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--body2);
  opacity: 1;
}

body.wf-moveday #move-day-arrival-estimate,
body.wf-moveday .move-day-arrival-estimate,
body.wf-moveday .move-day-meta-row #move-day-arrival {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--body2);
  opacity: 1;
}

body.wf-moveday #move-day-method {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--body2);
  opacity: 1;
}

/* Dark theme: text inside the plan-detail choices and the Move Day cards kept an older dark colour. */
body.wf-settings .wf-settings-shell .settings-detail-button .settings-detail-description,
body.wf-settings .wf-settings-shell .settings-detail-button .settings-detail-meta {
  color: var(--muted);
}

body.wf-moveday .wf-moveday-shell .move-day-card-time,
body.wf-moveday .wf-moveday-shell .move-day-flow p {
  color: var(--muted);
}

/* Calendar card: the intro, the calendar buttons and the privacy line are spaced evenly, so the line under the buttons does not
   sit against them. */
body.wf-settings #settings-calendar {
  display: grid;
  gap: 16px;
}
