:root {
  --bg: #f5f1e8;
  --panel: #fffdf8;
  --ink: #181512;
  --muted: #6a6258;
  --line: #d7cfc1;
  --accent: #8a5a34;
  --accent-2: #c67a43;
  --error: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(207, 91, 45, 0.18), transparent 24rem),
    linear-gradient(180deg, #efe8d8 0%, var(--bg) 40%);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

body.home-page {
  background:
    linear-gradient(180deg, rgba(24, 21, 18, 0.08), rgba(24, 21, 18, 0.18)),
    url("/static/home-bg.png") center center / cover no-repeat fixed;
}

.home-page .eyebrow {
  color: rgba(255, 239, 218, 0.92);
  font-size: clamp(1.9rem, 3.8vw, 2.8rem);
  letter-spacing: 0.04em;
  font-weight: 800;
  text-shadow: 0 1px 10px rgba(22, 16, 12, 0.35);
}

.home-page .hero h1 {
  color: #fff2db;
  font-size: clamp(1.2rem, 2.1vw, 1.7rem);
  line-height: 1.12;
  font-weight: 600;
  text-shadow:
    0 2px 18px rgba(22, 16, 12, 0.42),
    0 1px 0 rgba(255, 242, 220, 0.1);
}

.home-page .hero-note {
  color: rgba(255, 237, 214, 0.92);
  text-shadow: 0 1px 10px rgba(22, 16, 12, 0.3);
}

.home-page .card {
  background: rgba(255, 253, 248, 0.76);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

a {
  color: inherit;
}

.shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.shell-home {
  min-height: 100vh;
}

.shell-narrow {
  width: min(980px, calc(100% - 2rem));
}

.hero {
  padding: 1rem 0 1.5rem;
}

.hero h1 {
  margin: 0.2rem 0 0.8rem;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  line-height: 1;
  max-width: 24ch;
}

.hero-home .lede {
  max-width: 50rem;
}

.hero-note {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.form-wrap {
  display: flex;
  justify-content: center;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(22rem, 0.85fr);
  gap: 1rem;
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
}

.guide-wrap {
  display: flex;
  justify-content: center;
}

.form-card {
  width: 100%;
}

.price-line {
  margin: -0.25rem 0 0;
  color: var(--accent-2);
  font-weight: 700;
}

.consent-check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.7rem;
  font-weight: 400;
}

.consent-check input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.2rem;
  padding: 0;
}

.consent-check span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.consent-check a {
  color: var(--accent);
}

.guide-card {
  width: 100%;
}

.guide-steps {
  display: grid;
  gap: 1rem;
}

.download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  background: white;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.guide-steps div {
  display: grid;
  gap: 0.35rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.guide-steps div:first-child {
  border-top: 0;
  padding-top: 0;
}

.guide-steps p {
  margin: 0;
  color: var(--muted);
}

.guide-steps a {
  width: fit-content;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.guide-steps a:hover {
  text-decoration: underline;
}

.download-button:hover {
  text-decoration: none;
  border-color: var(--accent);
  color: var(--accent);
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}

.grid-home {
  align-items: start;
}

.result-grid {
  margin-top: 1rem;
}

.card {
  background: color-mix(in srgb, var(--panel) 92%, white);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  padding: 1.2rem;
  box-shadow: 0 12px 30px rgba(24, 21, 18, 0.06);
}

.stack {
  display: grid;
  gap: 1rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.facts div {
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  display: grid;
  gap: 0.25rem;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.badge.active {
  background: #efd7bf;
  color: #734826;
}

.badge.expired {
  background: #fde2df;
  color: var(--error);
}

.badge.pending {
  background: #efe8d8;
}

.legal-card h2 {
  margin: 0;
  font-size: 1rem;
}

.legal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
}

label span,
.facts span,
.hint,
.back,
.notice,
.qr-placeholder {
  color: var(--muted);
}

input,
textarea,
button,
.button {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
  font: inherit;
}

textarea {
  resize: vertical;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
}

button,
.button {
  cursor: pointer;
  background: var(--accent);
  color: white;
  border-color: transparent;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}

.button.secondary {
  background: var(--accent-2);
}

.button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

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

.qr,
.qr-placeholder {
  width: min(100%, 320px);
  aspect-ratio: 1;
  align-self: center;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: white;
}

.qr {
  object-fit: contain;
}

.qr-placeholder {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
}

.notice {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: #fff;
}

.notice.error {
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 30%, var(--line));
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.2rem;
  margin-top: 1.25rem;
  padding-bottom: 1rem;
}

.site-footer a {
  color: var(--muted);
  font-size: 0.84rem;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 860px) {
  body.home-page {
    background-attachment: scroll;
    background-position: center top;
  }

  .home-layout,
  .form-grid,
  .grid,
  .facts {
    grid-template-columns: 1fr;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
