:root {
  --navy: #102b3b;
  --navy-deep: #091e2c;
  --navy-light: #1d4052;
  --green: #43b02a;
  --green-dark: #348c20;
  --green-soft: #eef8eb;
  --gold: #f7b32b;
  --ink: #183240;
  --muted: #667984;
  --line: #dfe7e9;
  --panel: #f6f9fa;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--navy-deep) url("background.jpg") center center / cover no-repeat fixed;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* After a successful entry, swap to the finished-roof photo. */
body.entered {
  background-image: url("success-bg.jpg");
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 48px 24px;
  background:
    radial-gradient(circle at 15% 12%, rgba(67, 176, 42, 0.45), transparent 30rem),
    linear-gradient(150deg, rgba(52, 140, 32, 0.82), rgba(16, 43, 59, 0.8) 52%, rgba(9, 30, 44, 0.9));
}

.page::before,
.page::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  content: "";
}

.page::before {
  top: -20rem;
  right: -14rem;
  width: 44rem;
  height: 44rem;
}

.page::after {
  bottom: -24rem;
  left: -15rem;
  width: 50rem;
  height: 50rem;
}

.roof-lines {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image:
    linear-gradient(135deg, transparent 48%, #fff 49%, #fff 51%, transparent 52%),
    linear-gradient(45deg, transparent 48%, #fff 49%, #fff 51%, transparent 52%);
  background-position: 0 0, 48px 0;
  background-size: 96px 96px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

.giveaway-card {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.45);
}

.brand a {
  display: inline-flex;
}

.brand img {
  width: auto;
  height: 58px;
  object-fit: contain;
}

.step {
  animation: step-in 260ms ease both;
}

.step[hidden] {
  display: none;
}

/* ---- Entry: two-panel layout ---- */
#entry-step:not([hidden]) {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: stretch;
}

.hero-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 40px 42px;
  color: #fff;
  background:
    linear-gradient(155deg, rgba(52, 140, 32, 0.9), rgba(16, 43, 59, 0.9) 55%, rgba(9, 30, 44, 0.96)),
    url("background.jpg") center center / cover no-repeat;
}

.hero-panel .brand {
  margin-bottom: 26px;
}

.form-panel {
  padding: 40px 42px;
  background: var(--white);
}

.form-title {
  font-size: 22px;
  line-height: 1.2;
}

.form-sub {
  margin: 6px 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.prize-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prize-badge-icon {
  font-size: 15px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--navy);
  font-family: "Montserrat", sans-serif;
}

h1 {
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.1;
  color: #fff;
}

.highlight {
  color: #7ede56;
}

.intro {
  max-width: 460px;
  margin: 14px auto 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
}

.hero-panel .intro {
  max-width: none;
  margin: 14px 0 26px;
  color: rgba(255, 255, 255, 0.86);
  text-align: left;
}

.countdown {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0 0 24px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.countdown-label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.countdown-units {
  display: flex;
  gap: 8px;
  width: 100%;
}

.cd-unit {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 10px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
}

.cd-num {
  font-family: "Montserrat", system-ui, sans-serif;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.cd-word {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.countdown-status {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 600;
}

.countdown.ended .countdown-units {
  opacity: 0.45;
}

.countdown.ended .countdown-status {
  color: var(--muted);
}

.perks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.perks li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 600;
}

.perk-check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.giveaway-form {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.optional {
  color: var(--muted);
  font-weight: 500;
}

.field input {
  width: 100%;
  padding: 13px 15px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.field input::placeholder {
  color: #9aa9b1;
}

.field input:focus {
  outline: none;
  border-color: var(--green);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(67, 176, 42, 0.13);
}

.field input.invalid {
  border-color: #d64545;
  background: #fdf2f2;
}

.interests {
  margin: 2px 0 0;
  padding: 0;
  border: 0;
}

.interests legend {
  padding: 0;
  margin-bottom: 9px;
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.interests-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.interest {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 2px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.interest input {
  flex: none;
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.interest:hover,
.interest:focus-within {
  border-color: var(--green);
  background: var(--green-soft);
}

.interest:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
}

.interest-wide {
  grid-column: 1 / -1;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.consent input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--green);
}

.hp-field {
  position: absolute;
  left: -5000px;
  overflow: hidden;
}

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 5px;
  padding: 15px 22px;
  border: 0;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.submit-button:hover,
.submit-button:focus-visible {
  background: var(--green-dark);
  box-shadow: 0 12px 28px rgba(45, 107, 30, 0.24);
  transform: translateY(-2px);
  outline: none;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

.submit-arrow {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.form-status {
  min-height: 18px;
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.form-status.error {
  color: #d64545;
}

.form-status.success {
  color: var(--green-dark);
}

.consent strong {
  color: var(--navy);
  font-weight: 800;
}

.asterisk {
  color: var(--green-dark);
  font-weight: 800;
}

.fine-print {
  margin: 0;
  color: #93a1a8;
  font-size: 11px;
  text-align: center;
}

.privacy-note {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin: 20px 0 0;
  color: #7b8b93;
  font-size: 12px;
  text-align: center;
}

.privacy-note svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

#success-step:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 44px 40px;
  text-align: center;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 8px auto 18px;
  border-radius: 50%;
  background: var(--green-soft);
}

.success-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--green-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.success-title {
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.15;
}

.next-steps {
  width: 100%;
  max-width: 420px;
  margin: 4px auto 18px;
  padding: 0;
  list-style: none;
  text-align: left;
}

.next-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.next-steps li + li {
  border-top: 1px solid var(--line);
}

.step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.share-line {
  max-width: 420px;
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 13px 22px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-family: "Montserrat", sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-link:hover,
.primary-link:focus-visible {
  background: var(--navy-light);
  transform: translateY(-2px);
  outline: none;
}

.primary-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 15px 30px;
  border-top: 1px solid var(--line);
  color: #829199;
  background: #f8fafb;
  font-size: 11px;
  text-align: center;
}

footer a {
  color: #56707d;
  font-weight: 600;
  text-decoration: none;
}

footer a:hover {
  color: var(--green-dark);
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Narrow phones: stack the two panels (iPad and up stay two-column) */
@media (max-width: 680px) {
  #entry-step:not([hidden]) {
    grid-template-columns: 1fr;
  }

  .hero-panel .brand {
    margin-bottom: 20px;
  }

  .perks {
    flex-flow: row wrap;
    gap: 8px 20px;
    margin-top: 22px;
  }
}

@media (max-width: 560px) {
  .page {
    align-items: start;
    padding: 18px 12px;
  }

  .giveaway-card {
    border-radius: 20px;
  }

  .brand img {
    height: 52px;
  }

  .hero-panel {
    padding: 30px 24px;
  }

  .form-panel {
    padding: 28px 24px 32px;
  }

  #success-step:not([hidden]) {
    padding: 34px 24px 30px;
  }
}

@media (max-width: 430px) {
  .interests-grid {
    grid-template-columns: 1fr;
  }

  .cd-num {
    font-size: 22px;
  }

  .hero-panel .intro {
    font-size: 15px;
  }

  footer {
    flex-wrap: wrap;
    padding-inline: 18px;
  }

  footer > span:first-child {
    width: 100%;
  }

  footer > .footer-separator:first-of-type {
    display: none;
  }
}

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