:root {
  --ink: #18212f;
  --muted: #5f6f7b;
  --line: #dce5e0;
  --paper: #fbfbf6;
  --soft: #eef4ef;
  --green: #285f4f;
  --green-dark: #173e35;
  --coral: #d65d45;
  --blue: #213d63;
  --white: #ffffff;
  --shadow: 0 20px 50px rgba(25, 38, 47, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.public-shell,
.admin-shell,
.legal-page {
  min-height: 100vh;
}

.hero {
  position: relative;
  display: grid;
  min-height: 84vh;
  align-items: end;
  overflow: hidden;
  color: var(--white);
  background: var(--green-dark);
}

.hero__media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 43, 38, 0.88), rgba(16, 43, 38, 0.45) 48%, rgba(16, 43, 38, 0.1)),
    url("https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?auto=format&fit=crop&w=1800&q=80");
  background-position: center;
  background-size: cover;
}

.hero__content {
  position: relative;
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 120px 0 88px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #ffb29d;
}

h1,
h2 {
  margin: 0;
  line-height: 1.02;
  letter-spacing: 0;
}

h1 {
  max-width: 900px;
  font-size: clamp(2.5rem, 7vw, 5.7rem);
}

h2 {
  font-size: clamp(1.7rem, 4vw, 3rem);
}

p {
  line-height: 1.65;
}

.hero__content p:not(.eyebrow) {
  max-width: 670px;
  margin: 22px 0 28px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.12rem;
}

.hero__cta,
.primary-button,
.secondary-button,
.share-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.hero__cta,
.primary-button {
  padding: 0 22px;
  color: var(--white);
  background: var(--coral);
}

.secondary-button,
.share-button {
  padding: 0 16px;
  color: var(--green-dark);
  background: var(--soft);
}

.content-band {
  padding: 70px 20px;
}

.content-band--muted {
  background: var(--soft);
}

.layout {
  display: grid;
  width: min(1180px, 100%);
  grid-template-columns: 0.85fr 1.15fr;
  gap: 28px;
  margin: 0 auto;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.panel--intro {
  padding: 34px;
}

.panel--intro p {
  color: var(--muted);
}

.reward {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding: 18px;
  border-left: 5px solid var(--coral);
  background: #fff5f0;
}

.reward span,
.stat-card span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
}

.reward strong {
  color: var(--blue);
  font-size: 1.7rem;
}

.reward img {
  width: min(145px, 34vw);
  height: auto;
  flex: 0 0 auto;
}

.form-card {
  padding: 30px;
}

.form-header p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--green-dark);
  font-size: 0.92rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--green) 50%),
    linear-gradient(135deg, var(--green) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 20px,
    calc(100% - 12px) 20px;
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
}

input:focus,
select:focus {
  border-color: var(--green);
  outline: 3px solid rgba(40, 95, 79, 0.16);
}

.form-divider {
  height: 1px;
  margin: 30px 0;
  background: var(--line);
}

.form-card .primary-button {
  width: 100%;
  margin-top: 26px;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.how-it-works {
  margin-top: 24px;
  padding: 22px;
  border: 1px solid #f4c7ba;
  border-radius: 8px;
  background: #fff5f0;
}

.how-it-works ol {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-it-works li {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: start;
}

.how-it-works strong {
  color: var(--coral);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.how-it-works span,
.lead-copy p {
  color: var(--muted);
  line-height: 1.55;
}

.result-shell {
  display: grid;
  width: min(980px, 100%);
  grid-template-columns: 1fr 260px;
  gap: 28px;
  margin: 0 auto;
  align-items: center;
}

.saved-shell {
  width: min(980px, 100%);
  margin: 0 auto;
}

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

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

.saved-code-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.saved-code-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 1.15rem;
}

.saved-code-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.saved-code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 18px 0;
}

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

.qr-wrap {
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.qr-wrap img {
  width: 220px;
  height: 220px;
}

.compact-form {
  width: min(780px, 100%);
  margin: 0 auto;
}

.consent {
  grid-template-columns: auto 1fr;
  margin-top: 22px;
  color: var(--ink);
  font-weight: 600;
}

.consent input {
  width: 18px;
  min-height: 18px;
  margin-top: 4px;
}

.consent span {
  color: var(--muted);
  line-height: 1.5;
}

.consent a {
  color: var(--green);
  font-weight: 800;
}

.thank-you {
  margin-top: 18px;
  padding: 16px;
  border-left: 5px solid var(--green);
  border-radius: 8px;
  color: var(--green-dark);
  background: var(--white);
  font-weight: 700;
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: calc(100vw - 40px);
  padding: 14px 16px;
  border-radius: 8px;
  color: var(--white);
  background: var(--green-dark);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -18px;
  left: var(--x);
  width: 9px;
  height: 16px;
  border-radius: 2px;
  opacity: 0.95;
  animation: confetti-fall var(--duration) ease-in var(--delay) forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(0, -20px, 0) rotate(0deg);
  }

  100% {
    transform: translate3d(calc((50vw - var(--x)) * 0.18), 110vh, 0) rotate(var(--rotate));
  }
}

.admin-shell {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0;
}

.admin-header,
.table-toolbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.admin-header h1 {
  color: var(--green-dark);
  font-size: clamp(2rem, 5vw, 4.4rem);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 34px 0;
}

.stat-card {
  display: grid;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.stat-card strong {
  color: var(--blue);
  font-size: 2.4rem;
}

.admin-table-section {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.table-toolbar {
  margin-bottom: 18px;
}

.table-toolbar h2 {
  font-size: 1.6rem;
}

.table-toolbar input {
  max-width: 390px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  margin: 0 6px 6px 0;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--green-dark);
  background: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.empty-state {
  padding: 26px 12px;
  color: var(--muted);
  text-align: center;
}

.legal-page {
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
  padding: 70px 0;
}

.legal-page h1 {
  color: var(--green-dark);
  font-size: clamp(2rem, 6vw, 4.2rem);
}

.legal-page p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.05rem;
}

@media (max-width: 900px) {
  .layout,
  .result-shell,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 78vh;
  }
}

@media (max-width: 620px) {
  .field-grid,
  .link-box {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .table-toolbar,
  .saved-header {
    align-items: stretch;
    flex-direction: column;
  }

  .saved-code-card {
    grid-template-columns: 1fr;
  }

  .saved-code-actions {
    justify-content: stretch;
  }

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

  .content-band {
    padding: 46px 16px;
  }

  .panel--intro,
  .form-card,
  .admin-table-section {
    padding: 22px;
  }
}
