:root {
  --paper: #f3f0e6;
  --paper-strong: #fffdf7;
  --ink: #17332c;
  --ink-soft: #50665f;
  --pine: #164c3d;
  --pine-dark: #0d342a;
  --signal: #ef6a35;
  --signal-soft: #ffe2d4;
  --moss: #b7c8a9;
  --line: rgba(23, 51, 44, 0.18);
  --shadow: 0 26px 70px rgba(21, 52, 43, 0.14);
  --radius: 24px;
  color-scheme: light;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(22, 76, 61, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 76, 61, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 38px 38px;
  overflow-x: hidden;
}

a { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  width: 460px;
  height: 460px;
  top: -220px;
  right: -90px;
  background: radial-gradient(circle, rgba(239, 106, 53, 0.2), transparent 68%);
}

.ambient-two {
  width: 600px;
  height: 600px;
  left: -330px;
  bottom: -340px;
  background: radial-gradient(circle, rgba(93, 135, 107, 0.25), transparent 68%);
}

.site-header,
.site-footer,
.page-shell {
  width: min(1080px, calc(100% - 36px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--pine-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50% 50% 48% 52%;
  color: var(--paper-strong);
  background: var(--pine);
  font: 700 0.72rem/1 "Trebuchet MS", sans-serif;
  letter-spacing: 0.08em;
  transform: rotate(-4deg);
}

.site-nav { display: flex; gap: 22px; }
.site-nav a,
.site-footer a {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}
.site-nav a:hover,
.site-footer a:hover { color: var(--signal); }

.page-shell { padding: 54px 0 70px; }

#account-app { animation: reveal 420ms ease-out both; }

.account-status {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: max-content;
  max-width: min(480px, calc(100vw - 32px));
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--pine-dark);
  background: var(--paper-strong);
  box-shadow: 0 16px 42px rgba(13, 52, 42, 0.24);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
  animation: account-status-in 180ms ease-out both;
}

.account-status.success {
  border-color: rgba(22, 76, 61, 0.38);
  background: #dce9d8;
}

.account-status.error {
  border-color: rgba(166, 49, 35, 0.4);
  color: #79251d;
  background: #f8d9d4;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(22, 76, 61, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.92);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  min-height: 390px;
}

.hero-copy { padding: clamp(34px, 6vw, 72px); }

.hero-aside {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  padding: 38px;
  color: var(--paper-strong);
  background:
    radial-gradient(circle at 80% 12%, rgba(239, 106, 53, 0.58), transparent 31%),
    linear-gradient(155deg, var(--pine), var(--pine-dark));
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--signal);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 690px;
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 6vw, 4.55rem);
  line-height: 0.98;
}

h2 { margin-bottom: 8px; font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { margin-bottom: 8px; font-size: 1.12rem; }

.lede {
  max-width: 650px;
  margin: 0 0 30px;
  color: var(--ink-soft);
  font-size: 1.06rem;
  line-height: 1.65;
}

.hero-aside p { margin: 0; color: rgba(255, 253, 247, 0.78); line-height: 1.5; }
.aside-number { color: var(--signal-soft); font: 700 4rem/0.9 Georgia, serif; }

.stack { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.span-two { grid-column: 1 / -1; }

label,
.field-label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.field-heading {
  display: flex;
  align-items: center;
  gap: 7px;
}

.help-tip {
  position: relative;
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--pine);
  background: var(--paper-strong);
  font-size: 0.7rem;
  line-height: 1;
  cursor: help;
}

.help-tip::after {
  position: absolute;
  z-index: 20;
  width: min(280px, 76vw);
  top: calc(100% + 9px);
  right: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--paper-strong);
  background: var(--pine-dark);
  box-shadow: 0 10px 28px rgba(13, 52, 42, 0.24);
  content: attr(data-tooltip);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.help-tip:hover::after,
.help-tip:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.help-tip:focus-visible {
  outline: 3px solid rgba(239, 106, 53, 0.3);
  outline-offset: 2px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fffefa;
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea { min-height: 112px; resize: vertical; }
input:focus,
select:focus,
textarea:focus { border-color: var(--signal); box-shadow: 0 0 0 4px rgba(239, 106, 53, 0.12); }

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}

.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.check-option,
.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  letter-spacing: 0;
}
.check-option input,
.toggle-row input { width: auto; margin: 2px 0 0; accent-color: var(--signal); }
.toggle-row small { color: var(--ink-soft); font-weight: 600; line-height: 1.45; }

.button-row { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; }
.button,
button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 20px;
  color: #fffdf7;
  background: var(--pine);
  font: 800 0.83rem/1 "Trebuchet MS", sans-serif;
  letter-spacing: 0.035em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.button:hover,
button:hover { background: var(--pine-dark); box-shadow: 0 8px 22px rgba(13, 52, 42, 0.2); transform: translateY(-1px); }
.button.signal,
button.signal { background: var(--signal); }
.button.secondary,
button.secondary { border-color: var(--line); color: var(--pine); background: transparent; }
.button.danger,
button.danger { border-color: rgba(160, 49, 35, 0.35); color: #9b3025; background: transparent; }
button:disabled { cursor: wait; opacity: 0.55; transform: none; }

.auth-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 230px)); gap: 11px; }
.auth-button { border-radius: 14px; }

.notice {
  border-left: 4px solid var(--signal);
  border-radius: 8px 14px 14px 8px;
  padding: 14px 16px;
  color: var(--ink-soft);
  background: var(--signal-soft);
  line-height: 1.5;
}
.notice.error { border-color: #a63123; color: #79251d; background: #f8d9d4; }
.notice.success { border-color: var(--pine); color: var(--pine-dark); background: #dce9d8; }

.account-layout { display: grid; gap: 20px; }
.account-head { padding: clamp(30px, 5vw, 56px); }
.account-head h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.account-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
  font-weight: 800;
}
.chip::before { width: 7px; height: 7px; border-radius: 50%; background: var(--moss); content: ""; }
.chip.active::before { background: var(--signal); }

.account-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr); gap: 20px; }
.section-card { padding: clamp(24px, 4vw, 40px); }
.section-card p { color: var(--ink-soft); line-height: 1.55; }
.sidebar { display: grid; align-content: start; gap: 20px; }
.divider { height: 1px; margin: 23px 0; background: var(--line); }
.muted { color: var(--ink-soft); font-size: 0.9rem; line-height: 1.5; }
.danger-zone { border-color: rgba(160, 49, 35, 0.23); }
.danger-zone h2 { color: #8e2c22; }

.loading-panel { min-height: 360px; padding: clamp(34px, 7vw, 76px); }
.loading-line { width: min(420px, 100%); height: 5px; margin-top: 32px; background: linear-gradient(90deg, var(--pine) 0 25%, var(--signal) 25% 45%, rgba(22, 76, 61, 0.12) 45%); animation: pulse 1.3s ease-in-out infinite; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.8rem;
}
.site-footer span:last-child { display: flex; gap: 18px; }

@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes account-status-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

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

@media (max-width: 800px) {
  .hero,
  .account-grid { grid-template-columns: 1fr; }
  .hero-aside { min-height: 220px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-two { grid-column: auto; }
}

@media (max-width: 560px) {
  .site-header,
  .site-footer,
  .page-shell { width: min(100% - 22px, 1080px); }
  .site-header { min-height: 68px; }
  .site-nav a:not(:first-child) { display: none; }
  .page-shell { padding-top: 24px; }
  .panel { border-radius: 19px; }
  .hero-copy,
  .hero-aside,
  .account-head,
  .section-card { padding: 25px 21px; }
  .auth-buttons,
  .check-grid { grid-template-columns: 1fr; }
  .button-row > *,
  .auth-buttons > * { width: 100%; }
  .site-footer { flex-direction: column; }
}
