:root {
  --bg: #f3f7f2;
  --bg-soft: #e7eee7;
  --surface: rgba(255, 255, 255, 0.97);
  --surface-solid: #ffffff;
  --surface-muted: rgba(20, 36, 28, 0.055);
  --surface-muted-strong: rgba(20, 36, 28, 0.09);
  --border: rgba(18, 34, 25, 0.13);
  --border-strong: rgba(18, 34, 25, 0.22);
  --ink: #121813;
  --muted: #56645c;
  --primary: #12221a;
  --primary-ink: #ffffff;
  --accent: #2fbd5b;
  --accent-ink: #031a0b;
  --blue: #2d6f9f;
  --gold: #b7772d;
  --graphite: #26322b;
  --success: #0c7a42;
  --warning: #956000;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --warning-soft: #fff7e6;
  --success-soft: #ebfaef;
  --radius: 8px;
  --radius-sm: 8px;
  --control-radius: 10px;
  --shadow: 0 24px 70px rgba(18, 34, 25, 0.14);
  --shadow-soft: 0 14px 34px rgba(18, 34, 25, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: "Aptos", "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  background:
    linear-gradient(140deg, rgba(47, 189, 91, 0.12), transparent 30%),
    linear-gradient(230deg, rgba(183, 119, 45, 0.10), transparent 36%),
    linear-gradient(180deg, #f8fbf7 0%, var(--bg) 46%, var(--bg-soft) 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(18, 34, 25, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 34, 25, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, transparent 0 42px, rgba(47, 189, 91, 0.045) 43px, transparent 44px);
  background-size: 42px 42px, 42px 42px, 128px 128px;
  animation: grid-drift 18s linear infinite;
}

a,
button,
input {
  font: inherit;
}

button,
input {
  letter-spacing: 0;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 32px 22px 78px;
  animation: page-rise 420ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  color: var(--ink);
  text-decoration: none;
}

.brand-wordmark {
  display: block;
  width: 174px;
  max-width: 45vw;
  height: auto;
  object-fit: contain;
}

.brand-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.stack-shell {
  display: block;
}

.surface {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.surface::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--gold));
  background-size: 220% 100%;
  animation: accent-scan 5400ms ease-in-out infinite;
}

.surface::after {
  position: absolute;
  inset: 4px 0 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.82), transparent 48%),
    repeating-linear-gradient(90deg, rgba(18, 34, 25, 0.025) 0 1px, transparent 1px 28px);
  opacity: 0.9;
}

.auth-surface {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 34px;
  align-items: start;
  padding: 32px;
}

.auth-surface > * {
  position: relative;
  z-index: 1;
}

.surface-copy {
  display: grid;
  gap: 22px;
  min-width: 0;
  padding: 4px 0 0;
}

.surface-copy > * {
  animation: content-rise 520ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.surface-copy > *:nth-child(2) {
  animation-delay: 55ms;
}

.surface-copy > *:nth-child(3) {
  animation-delay: 110ms;
}

.surface-copy > *:nth-child(4) {
  animation-delay: 165ms;
}

.surface-copy > *:nth-child(5) {
  animation-delay: 220ms;
}

.intro-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.surface-copy h1,
.surface-head h2,
.panel-head h3 {
  margin: 0;
  letter-spacing: 0;
}

.surface-copy h1 {
  max-width: 13ch;
  font-size: 2.6rem;
  line-height: 1.04;
}

.surface-copy p {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.section-kicker {
  color: var(--graphite);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(47, 189, 91, 0.32);
  border-radius: 999px;
  background: rgba(47, 189, 91, 0.09);
  color: #14552b;
  font-size: 0.83rem;
  font-weight: 760;
}

.live-badge span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(47, 189, 91, 0.12);
  animation: live-pulse 1800ms ease-in-out infinite;
}

.assurance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.assurance-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.assurance-grid strong,
.assurance-grid span {
  display: block;
}

.assurance-grid strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.assurance-grid span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.access-map {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  max-width: 560px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, #101a14, #1e2b22 58%, #283122),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 14px);
  color: #f7fff9;
  box-shadow: 0 22px 44px rgba(18, 34, 25, 0.18);
}

.access-map::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(47, 189, 91, 0.18), transparent 38%),
    repeating-linear-gradient(90deg, transparent 0 36px, rgba(255, 255, 255, 0.045) 37px 38px);
  animation: map-shift 7800ms linear infinite;
}

.map-top,
.map-flow,
.map-footer {
  position: relative;
  z-index: 1;
}

.map-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(247, 255, 249, 0.78);
  font-size: 0.9rem;
  font-weight: 720;
}

.star-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: #f7fff9;
  color: #12221a;
  font-weight: 850;
}

.map-flow {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) 28px minmax(74px, 1fr) 28px minmax(74px, 1fr);
  gap: 8px;
  align-items: center;
}

.map-node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(247, 255, 249, 0.84);
  font-size: 0.88rem;
  font-weight: 760;
}

.map-node.active {
  border-color: rgba(47, 189, 91, 0.58);
  background: rgba(47, 189, 91, 0.18);
  color: #ffffff;
  animation: active-node-pulse 2400ms ease-in-out infinite;
}

.map-line {
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 189, 91, 0.2), rgba(247, 255, 249, 0.72));
  background-size: 220% 100%;
  animation: route-flow 1800ms ease-in-out infinite;
}

.map-footer {
  display: inline-flex;
  width: fit-content;
  min-height: 32px;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(247, 255, 249, 0.82);
  font-size: 0.82rem;
  font-weight: 720;
}

.status-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 760;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(18, 34, 25, 0.06);
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

body.is-working #authStatus {
  border-color: rgba(47, 189, 91, 0.32);
  background: rgba(47, 189, 91, 0.10);
  color: #14552b;
}

body.is-working #authStatus::after {
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
  animation: busy-dot 820ms ease-in-out infinite;
}

.message,
.return-shell,
.entry-shell {
  grid-column: 2;
}

.message {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  line-height: 1.5;
  box-shadow: var(--shadow-soft);
  transition:
    color 220ms ease,
    background-color 280ms ease,
    border-color 280ms ease,
    box-shadow 280ms ease,
    opacity 220ms ease,
    transform 220ms ease;
}

.message[hidden] {
  display: none;
}

.message-enter {
  animation: message-fade-in 220ms ease both;
}

.message.error {
  border-color: rgba(180, 35, 24, 0.25);
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: 0 12px 28px rgba(180, 35, 24, 0.08);
}

.message.success {
  border-color: rgba(12, 122, 66, 0.2);
  background: var(--success-soft);
  color: var(--success);
  box-shadow: 0 12px 28px rgba(12, 122, 66, 0.08);
}

.message-body {
  min-width: 0;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.message-action {
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--control-radius);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 760;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.message-action:hover {
  transform: translateY(-1px);
}

.message.error .message-action.primary-action {
  border-color: rgba(180, 35, 24, 0.24);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.message.error .message-action.secondary-action {
  border-color: rgba(149, 96, 0, 0.2);
  background: rgba(255, 247, 230, 0.96);
  color: var(--warning);
}

.message.success .message-action.primary-action,
.message.success .message-action.secondary-action {
  border-color: rgba(12, 122, 66, 0.18);
  background: rgba(255, 255, 255, 0.96);
  color: var(--success);
}

.return-shell {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 20px;
  border: 1px solid rgba(47, 189, 91, 0.24);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(47, 189, 91, 0.10), rgba(45, 111, 159, 0.08)),
    rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.return-shell::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--gold));
  transform: scaleX(0);
  transform-origin: left center;
  animation: return-progress var(--return-duration, 2200ms) linear forwards;
}

.return-shell:not([hidden]) {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  animation: return-panel-in 360ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.return-orbit {
  position: relative;
  min-height: 104px;
  border: 1px solid rgba(47, 189, 91, 0.26);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.5)),
    repeating-linear-gradient(135deg, rgba(47, 189, 91, 0.10) 0 1px, transparent 1px 12px);
  overflow: hidden;
}

.return-orbit::before,
.return-orbit::after {
  position: absolute;
  content: "";
}

.return-orbit::before {
  left: 18px;
  right: 18px;
  top: 50px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 189, 91, 0.18), var(--accent), var(--blue));
  transform-origin: left center;
  animation: route-draw 640ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.return-orbit::after {
  top: 18px;
  bottom: 18px;
  width: 28px;
  border-radius: 14px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.66), transparent);
  animation: route-sheen 1250ms ease-in-out infinite;
}

.return-orbit span {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(47, 189, 91, 0.22);
  animation: checkpoint-pop 420ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.return-orbit span:nth-child(1) {
  left: 18px;
  top: 44px;
}

.return-orbit span:nth-child(2) {
  left: calc(50% - 7px);
  top: 44px;
  animation-delay: 100ms;
}

.return-orbit span:nth-child(3) {
  right: 18px;
  top: 44px;
  background: var(--blue);
  animation-delay: 200ms;
}

.return-copy h2 {
  margin: 0;
  font-size: 1.85rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.return-copy p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.return-shell:not([hidden]) .return-copy > * {
  animation: content-rise 420ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.return-shell:not([hidden]) .return-copy > *:nth-child(2) {
  animation-delay: 70ms;
}

.return-shell:not([hidden]) .return-copy > *:nth-child(3) {
  animation-delay: 120ms;
}

.return-shell:not([hidden]) .return-copy > *:nth-child(4) {
  animation-delay: 170ms;
}

.return-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 16px;
  padding: 0 15px;
  border-radius: var(--control-radius);
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 760;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(18, 34, 25, 0.14);
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

body.return-active .surface-copy,
body.return-active .message {
  animation: fade-soft 220ms ease both;
}

.entry-shell {
  align-self: start;
  min-width: 0;
  padding: 2px 0 0;
  animation: panel-rise 420ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.mode-switch,
.account-switch {
  display: grid;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(18, 34, 25, 0.08);
  border-radius: var(--control-radius);
  background: rgba(18, 34, 25, 0.06);
}

.mode-switch {
  position: relative;
  isolation: isolate;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-switch::before {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  z-index: 0;
  width: calc((100% - 20px) / 2);
  border-radius: var(--control-radius);
  background: var(--surface-solid);
  box-shadow: 0 9px 22px rgba(18, 34, 25, 0.09);
  content: "";
  transform: translateX(0);
  transition: transform 260ms cubic-bezier(0.19, 1, 0.22, 1);
}

.mode-switch[data-active="signup"]::before {
  transform: translateX(calc(100% + 8px));
}

.account-switch {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: 1;
}

.tab,
.account-tab,
button {
  min-height: 46px;
  border: 0;
  border-radius: var(--control-radius);
  cursor: pointer;
}

.tab,
.account-tab {
  position: relative;
  z-index: 1;
  background: transparent;
  color: #42534a;
  font-weight: 760;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.tab.active,
.account-tab.active {
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: 0 9px 22px rgba(18, 34, 25, 0.09);
}

.mode-switch .tab.active {
  background: transparent;
  box-shadow: none;
}

.auth-view,
.account-panel {
  display: none;
}

.auth-view.active,
.account-panel.active {
  display: block;
  animation: view-in 300ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.auth-view {
  margin-top: 20px;
}

.auth-view.active .stack > *,
.auth-view.active .text-row,
.auth-view.active .divider,
.auth-view.active .google-slot {
  animation: item-rise 360ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.auth-view.active .stack > *:nth-child(1) {
  animation-delay: 30ms;
}

.auth-view.active .stack > *:nth-child(2) {
  animation-delay: 70ms;
}

.auth-view.active .stack > *:nth-child(3) {
  animation-delay: 110ms;
}

.auth-view.active .stack > *:nth-child(4) {
  animation-delay: 150ms;
}

.auth-view.active .stack > *:nth-child(5) {
  animation-delay: 190ms;
}

.auth-view.active .text-row,
.auth-view.active .divider,
.auth-view.active .google-slot {
  animation-delay: 210ms;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: #34423a;
  font-size: 0.92rem;
  font-weight: 760;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border-radius: var(--control-radius);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

input:disabled,
button:disabled {
  cursor: progress;
  opacity: 0.72;
}

input:hover {
  border-color: rgba(18, 34, 25, 0.3);
  background: #ffffff;
}

input:focus {
  outline: 3px solid rgba(47, 189, 91, 0.18);
  outline-offset: 1px;
  border-color: rgba(47, 189, 91, 0.62);
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(47, 189, 91, 0.12);
}

.password-input {
  position: relative;
}

.password-input input {
  padding-right: 82px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 760;
  transform: translateY(-50%);
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.password-toggle:hover {
  transform: translateY(calc(-50% - 1px));
}

.password-toggle:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(47, 189, 91, 0.22);
  outline-offset: 2px;
}

button {
  padding: 0 16px;
  font-weight: 760;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

button:hover,
.return-link:hover {
  transform: translateY(-1px);
}

.primary {
  position: relative;
  overflow: hidden;
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 14px 28px rgba(18, 34, 25, 0.14);
}

.primary::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent 0 24%, rgba(255, 255, 255, 0.28) 42%, transparent 60% 100%);
  opacity: 0;
  transform: translateX(-110%);
  pointer-events: none;
}

.primary:hover {
  background: #0c1812;
}

.stack.is-submitting {
  cursor: progress;
}

.stack.is-submitting .primary::after {
  opacity: 1;
  animation: button-scan 940ms ease-in-out infinite;
}

.secondary,
.ghost {
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
}

.secondary:hover,
.ghost:hover {
  border-color: rgba(18, 34, 25, 0.32);
  background: #ffffff;
}

.wide-action {
  width: 100%;
}

.code-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.stack[hidden],
.inline-form[hidden],
.code-form[hidden] {
  display: none;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--control-radius);
  font-weight: 760;
  text-decoration: none;
}

.field-help,
.identity-empty,
.collection-empty {
  color: var(--muted);
  line-height: 1.55;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.google-slot {
  min-height: 46px;
}

.social-provider-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.social-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-align: left;
}

.social-button span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 720;
}

.social-button.disabled {
  cursor: not-allowed;
  background: rgba(20, 36, 28, 0.045);
  color: rgba(18, 24, 19, 0.62);
}

.text-row {
  margin-top: 10px;
}

.text-link {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: #2d6f9f;
  font-weight: 720;
}

.text-link:hover {
  color: var(--ink);
  transform: none;
}

.entry-shell[hidden],
.account-shell[hidden] {
  display: none;
}

.account-shell {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.account-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.identity-card {
  display: grid;
  gap: 14px;
  padding: 8px 0 4px;
}

.identity-card-copy {
  display: grid;
  gap: 14px;
}

.credential-card {
  display: grid;
  gap: 14px;
  margin: 12px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.credential-card[hidden] {
  display: none;
}

.credential-card h3,
.credential-card p {
  margin: 0;
}

.credential-card h3 {
  font-size: 1rem;
}

.credential-card p {
  color: var(--muted);
  line-height: 1.5;
}

.magic-qr-result {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.magic-qr-result[hidden] {
  display: none;
}

.magic-qr-image {
  width: 168px;
  height: 168px;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #ffffff;
}

.magic-qr-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.magic-qr-copy strong,
.magic-qr-copy span,
.magic-qr-copy a {
  min-width: 0;
}

.magic-qr-copy span {
  color: var(--muted);
  line-height: 1.5;
}

.magic-qr-copy a {
  color: #2d6f9f;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.summary-list {
  display: grid;
  gap: 12px;
}

.summary-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.summary-row span {
  color: var(--muted);
}

.summary-row strong {
  text-align: right;
  font-weight: 680;
}

.summary-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.action-row,
.collection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.action-row {
  margin-top: 10px;
}

.inline-status {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.inline-status[hidden] {
  display: none;
}

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

.inline-status.error {
  color: var(--danger);
}

.inline-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.inline-form[hidden] {
  display: none;
}

.inline-form:not([hidden]) {
  animation: item-rise 260ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.compact label {
  min-width: 0;
}

.compact button {
  align-self: stretch;
}

.collection {
  display: grid;
  gap: 12px;
}

.collection-item {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
  animation: item-rise 300ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.collection-item header {
  margin-bottom: 10px;
}

.collection-item h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.collection-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.key-note-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.key-note-form input,
.key-note-form button {
  min-height: 44px;
}

.key-note-form button {
  white-space: nowrap;
}

.secret-reveal {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(12, 122, 66, 0.18);
  background: var(--success-soft);
  color: var(--success);
  animation: message-fade-in 240ms ease both;
}

.secret-reveal[hidden] {
  display: none;
}

.mono {
  font-family: "IBM Plex Mono", "SFMono-Regular", "Consolas", monospace;
  word-break: break-all;
}

@keyframes message-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: saturate(0.82);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: saturate(1);
  }
}

@keyframes page-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes return-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes route-draw {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes route-sheen {
  from {
    left: -36px;
  }

  to {
    left: calc(100% + 36px);
  }
}

@keyframes checkpoint-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.72);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-soft {
  to {
    opacity: 0.38;
  }
}

@keyframes grid-drift {
  from {
    background-position: 0 0, 0 0, 0 0;
  }

  to {
    background-position: 42px 42px, -42px 42px, 128px 128px;
  }
}

@keyframes accent-scan {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes content-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes item-rise {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes live-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 5px rgba(47, 189, 91, 0.12);
  }

  50% {
    box-shadow: 0 0 0 9px rgba(47, 189, 91, 0);
  }
}

@keyframes map-shift {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 96px 0, 72px 0;
  }
}

@keyframes active-node-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(47, 189, 91, 0);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(47, 189, 91, 0.12);
  }
}

@keyframes route-flow {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes busy-dot {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.72);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes button-scan {
  from {
    transform: translateX(-110%);
  }

  to {
    transform: translateX(110%);
  }
}

@keyframes return-progress {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@media (max-width: 900px) {
  .auth-surface {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .message,
  .return-shell,
  .entry-shell,
  .account-shell {
    grid-column: 1;
  }

  .surface-copy h1 {
    max-width: 16ch;
    font-size: 2.25rem;
  }

  .access-map {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 18px 14px 56px;
  }

  .page-header {
    align-items: center;
  }

  .brand-wordmark {
    width: 144px;
  }

  .auth-surface {
    padding: 22px;
  }

  .surface-copy {
    gap: 18px;
  }

  .surface-copy h1 {
    font-size: 2rem;
  }

  .surface-copy p {
    font-size: 0.98rem;
  }

  .assurance-grid,
  .access-map {
    display: none;
  }

  .map-flow,
  .account-switch,
  .compact {
    grid-template-columns: 1fr;
  }

  .map-line {
    width: 2px;
    height: 18px;
    justify-self: center;
    background: linear-gradient(180deg, rgba(47, 189, 91, 0.2), rgba(247, 255, 249, 0.72));
  }

  .account-toolbar,
  .panel-head,
  .collection-item header,
  .magic-qr-result,
  .summary-row {
    flex-direction: column;
  }

  .key-note-form {
    grid-template-columns: 1fr;
  }

  .magic-qr-result {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .ghost {
    align-self: flex-start;
  }

  .return-shell:not([hidden]) {
    grid-template-columns: 1fr;
  }

  .return-orbit {
    min-height: 82px;
  }

  .return-orbit::before {
    top: 37px;
  }

  .return-orbit span {
    top: 31px;
  }

  .return-copy h2 {
    font-size: 1.55rem;
  }

  .summary-row strong {
    text-align: left;
  }
}

@media (max-width: 420px) {
  .auth-surface {
    padding: 18px;
  }

  .surface-copy h1 {
    font-size: 1.78rem;
  }

  .mode-switch {
    grid-template-columns: 1fr;
  }

  .mode-switch::before {
    right: 6px;
    bottom: auto;
    width: auto;
    height: calc((100% - 20px) / 2);
  }

  .mode-switch[data-active="signup"]::before {
    transform: translateY(calc(100% + 8px));
  }

  .password-input input {
    padding-right: 74px;
  }

  .password-toggle {
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

/* ── White-glove demo claim popup ─────────────────────────────────────── */
.demo-claim-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 20, 15, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: demo-claim-fade 0.18s ease-out;
}
.demo-claim-overlay[hidden] {
  display: none;
}
.demo-claim-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--surface-solid, #ffffff);
  border: 1px solid var(--border, rgba(18, 34, 25, 0.13));
  border-radius: calc(var(--radius, 8px) + 6px);
  box-shadow: var(--shadow, 0 24px 70px rgba(18, 34, 25, 0.18));
  padding: 30px 28px 26px;
  animation: demo-claim-rise 0.2s ease-out;
}
.demo-claim-card h2 {
  margin: 4px 0 8px;
  font-size: 22px;
  color: var(--ink, #121813);
}
.demo-claim-copy {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted, #56645c);
}
.demo-claim-copy strong {
  color: var(--ink, #121813);
  font-weight: 600;
}
.demo-claim-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: var(--surface-muted, rgba(20, 36, 28, 0.055));
  color: var(--muted, #56645c);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.demo-claim-close:hover {
  background: var(--surface-muted-strong, rgba(20, 36, 28, 0.09));
  color: var(--ink, #121813);
}
.demo-claim-message {
  margin-top: 14px;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.modal-actions > button {
  flex: 1 1 180px;
}
@keyframes demo-claim-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes demo-claim-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
