/* ============================================================
   Bulmers "It's Our Time" — Competition Entry Module
   Palette + creative sampled from campaign key visuals.
   ============================================================ */

/*
  FONT NOTE:
    Resolve Sans Extrabold Narrow → big condensed headlines (licensed)
    New Atten ExtraBold (800)     → sub-heads, labels, buttons (trial — replace with licensed .woff2 when supplied)
    New Atten Medium (500)        → body, inputs (trial — replace with licensed .woff2 when supplied)
*/
@font-face {
  font-family: 'Resolve Sans';
  src: url('/assets/fonts/resolve-sans-extrabold-narrow.otf') format('opentype');
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'New Atten';
  src: url('/assets/fonts/new-atten-extrabold.otf') format('opentype');
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'New Atten';
  src: url('/assets/fonts/new-atten-medium.otf') format('opentype');
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ── Page-load intro animations (headline/form slide-up-fade, bg reveal) ── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bgReveal {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .page::before,
  .campaign-text,
  .page-left .card { animation: none !important; }
}

/* ── Brand tokens (from campaign creative) ──────────────────── */
:root {
  --green:      #005936;  /* campaign deep forest green */
  --green-dk:   #00442A;
  --green-lt:   #0B6B43;
  /* Brand gold gradient (client guidelines): Pantone 10126 C base,
     CMYK shadow 27,51,100,8 and highlight 0,13,50,0 */
  --gold:       #C6A352;  /* Pantone 10126 C */
  --gold-lt:    #FFDE80;  /* highlight */
  --gold-dk:    #AB7300;  /* shadow */
  --red:        #E4002B;
  --cream:      #F7F2E8;
  --paper:      #FFFFFF;
  --ink:        #1E1B16;
  --ink-soft:   #5E5A50;
  --line:       #E6DECF;
  --field-bg:   #F6F2E9;

  --font-display: 'Resolve Sans', 'Arial Narrow', Arial, sans-serif;
  --font-head:    'New Atten', Arial, sans-serif;
  --font-body:    'New Atten', Arial, sans-serif;

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 9px;
  --shadow: 0 14px 40px rgba(0, 30, 18, 0.28);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  position: relative;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  background: var(--green);
  background-image:
    radial-gradient(120% 70% at 50% 0%, var(--green-lt) 0%, var(--green) 55%, var(--green-dk) 100%);
  line-height: 1.5;
  padding: 16px;
  overflow-x: hidden;
}

/* Condensation texture on the surround OUTSIDE the module frame.
   The opaque module sits on top, so this reads only in the green area
   around the form. */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url('/assets/condensation-web.jpg') repeat;
  background-size: 440px auto;
  mix-blend-mode: soft-light;
  opacity: 0.6;
  pointer-events: none;
}

/* ── Module shell ───────────────────────────────────────────── */
.module {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: var(--green);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Subtle condensation texture — soft atmospheric layer over the green,
   behind all content. Only reads through the green areas (intro, footer,
   edges); the opaque KV header and white form card sit on top. */
.module::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url('/assets/condensation-web.jpg') center / cover no-repeat;
  mix-blend-mode: soft-light;
  opacity: 0.26;
  pointer-events: none;
}

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

/* ══════════════════════════════════════════════════════════════
   HEADER — campaign key visual
   ══════════════════════════════════════════════════════════════ */
.header {
  position: relative;
  background: var(--green);
}

.header__kv {
  display: block;
  width: 100%;
  height: 480px;
  object-fit: cover;
  object-position: center top;
  /* Dissolve the image into the green background for a soft transition
     (no hard edge between the hero and the form section). */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
}

/* ══════════════════════════════════════════════════════════════
   INTRO — logo + campaign headline on green
   ══════════════════════════════════════════════════════════════ */
.intro {
  text-align: center;
  padding: 22px 24px 22px;
  color: var(--paper);
}

/* Bulmers logo sits directly on the dark green (no white chip) */
.intro__logo {
  display: block;
  width: 132px;
  height: auto;
  margin: 0 auto 16px;
}

.intro__eyebrow {
  font-family: var(--font-head); /* New Atten — Resolve trial lacks a clean apostrophe */
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.86rem;
  color: var(--gold-lt);
  margin-bottom: 8px;
}

.intro__headline {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 2.5rem;
  line-height: 0.94;
  letter-spacing: 0.5px;
}

.intro__headline em {
  font-style: normal;
  color: var(--gold);
}

.intro__sub {
  margin-top: 12px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.86);
}

/* ══════════════════════════════════════════════════════════════
   FORM CARD
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--paper);
  margin: 0 14px;
  border-radius: var(--r-lg);
  padding: 22px 20px 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

/* ── Step indicator ─────────────────────────────────────────── */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.steps__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.steps__dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: var(--cream);
  border: 2px solid var(--line);
  transition: all 0.25s ease;
}

.steps__label {
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  transition: color 0.25s ease;
}

.steps__line {
  flex: 1;
  max-width: 46px;
  height: 2px;
  background: var(--line);
  margin: 0 6px 20px;
  transition: background 0.3s ease;
}

.steps__item--active .steps__dot {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(0,89,54,0.14);
}
.steps__item--active .steps__label { color: var(--green); }

.steps__item--complete .steps__dot {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--green-dk);
}
.steps__item--complete .steps__label { color: var(--gold-dk); }

.steps__line--complete { background: var(--gold); }

/* ── Step panels ────────────────────────────────────────────── */
.form-step[hidden] { display: none; }

.card__title {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 1.5rem;
  line-height: 1.02;
  color: var(--green);
  margin-bottom: 4px;
}

.card__lede {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

/* ── Field grid (single column on mobile, two on desktop) ───── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 20px;
}
.form-field-full { grid-column: 1 / -1; }

/* ── Fields ─────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink);
  margin-bottom: 7px;
}

.req { color: var(--red); }

.input {
  display: block;
  width: 100%;
  padding: 13px 14px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--field-bg);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.input::placeholder { color: #A9A294; }

.input:focus {
  outline: none;
  background: #fff;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,75,0.25);
}

.input.is-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(228,0,43,0.14);
}

.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 15px; top: 50%;
  width: 10px; height: 10px;
  transform: translateY(-60%) rotate(45deg);
  border-right: 2.5px solid var(--green);
  border-bottom: 2.5px solid var(--green);
  pointer-events: none;
}
.input--select { padding-right: 38px; cursor: pointer; }

.input--digits {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 12px;
  text-align: center;
  max-width: 170px;
  padding-left: 24px;
}

.field__hint {
  display: block;
  font-size: 0.74rem;
  color: var(--ink-soft);
  margin-top: 6px;
}

.err {
  display: none;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--red);
  margin-top: 6px;
}
.err.is-visible { display: block; }

/* ── Age note ───────────────────────────────────────────────── */
.age-note {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.age-note__badge {
  flex-shrink: 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.78rem;
  color: #fff;
  background: var(--red);
  border-radius: 6px;
  padding: 3px 7px;
}

/* ── Custom checkboxes ──────────────────────────────────────── */
.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  margin-bottom: 12px;
}

.check input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.check__box {
  flex-shrink: 0;
  width: 22px; height: 22px;
  margin-top: 1px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--field-bg);
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.check__box::after {
  content: "";
  position: absolute;
  left: 7px; top: 3px;
  width: 6px; height: 11px;
  border-right: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

.check input:checked + .check__box {
  background: var(--green);
  border-color: var(--green);
}
.check input:checked + .check__box::after { transform: rotate(45deg) scale(1); }

.check input:focus-visible + .check__box {
  box-shadow: 0 0 0 3px rgba(201,162,75,0.35);
}

.check__text {
  font-size: 0.83rem;
  color: var(--ink);
  line-height: 1.45;
}
.check__text a { color: var(--green); font-weight: 800; text-decoration: underline; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.18s, background 0.18s;
}

.btn__arrow { display: inline-block; }

.btn--primary {
  width: 100%;
  padding: 15px 20px;
  font-size: 1.12rem;
  color: var(--green-dk);
  background: linear-gradient(180deg, var(--gold-lt) 0%, var(--gold) 55%, var(--gold-dk) 100%);
  box-shadow: 0 6px 16px rgba(169,132,47,0.4);
}
.btn--primary:hover  { box-shadow: 0 8px 22px rgba(169,132,47,0.5); }
.btn--primary:active { transform: translateY(1px); }
.btn--primary:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }

.btn--ghost {
  flex-shrink: 0;
  padding: 15px 18px;
  font-size: 0.95rem;
  color: var(--green);
  background: transparent;
  border: 2px solid var(--line);
}
.btn--ghost:hover  { border-color: var(--green); }
.btn--ghost:active { transform: translateY(1px); }

.btn-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 4px;
}
.btn-row .btn--primary { flex: 1; width: auto; }

.steps + form .form-step > .btn--primary { margin-top: 4px; }

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 15px; height: 15px;
  border: 2.5px solid rgba(0,68,42,0.3);
  border-top-color: var(--green-dk);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 7px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════
   THANK YOU
   ══════════════════════════════════════════════════════════════ */
.thankyou {
  text-align: center;
  padding: 40px 28px 44px;
  color: var(--ink);
}
.thankyou[hidden] { display: none; }

.thankyou__icon {
  width: 66px; height: 66px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-lt), var(--gold));
  color: var(--green-dk);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}
.thankyou__icon svg { width: 30px; height: 30px; }

.thankyou__title {
  font-family: var(--font-head); /* contains an apostrophe — use New Atten */
  font-weight: 800;
  text-transform: uppercase;
  font-size: 2.2rem;
  letter-spacing: 1px;
  color: var(--green);
  margin-bottom: 10px;
}

.thankyou__body {
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 320px;
  margin: 0 auto 16px;
}

.thankyou__ref {
  font-size: 0.78rem;
  letter-spacing: 0.4px;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.thankyou__ref strong { color: var(--gold-dk); letter-spacing: 1px; }

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */
.foot {
  padding: 16px 22px 22px;
  text-align: center;
}
/* Wm Magner heritage sign-off — horizontal signature, kept subtle */
.foot__signature {
  display: block;
  width: 168px;
  height: auto;
  margin: 2px auto 16px;
  opacity: 0.9;
}
.foot__legal {
  font-size: 0.68rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.55);
}
.foot__legal a { color: rgba(255,255,255,0.8); }
.foot__da {
  margin-top: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold-lt);
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  body { padding: 8px; }
  .intro__headline { font-size: 2.1rem; }
  .card { margin: 0 8px; padding: 20px 16px 22px; }
  .steps__label { font-size: 0.6rem; }
  .steps__line { max-width: 30px; }
  .foot__signature { width: 140px; }
  .intro__logo { width: 112px; }
}

/* Tablet / desktop: a touch more generous, stays compact + centered */
@media (min-width: 600px) {
  body { padding: 28px; }
  .module { max-width: 460px; }
  .header__kv { height: 520px; }
  .intro__headline { font-size: 2.7rem; }
}

/* Desktop: wider module + two-column field grid */
@media (min-width: 768px) {
  .module { max-width: 700px; }
  .card { margin: 0 20px; padding: 28px 28px 30px; }
  .header__kv { height: 580px; }
  .intro__headline { font-size: 3rem; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .input--digits { max-width: none; }
  .foot__signature { width: 196px; }
  .intro__logo { width: 148px; }
}

/* Tesco full-width page styles are scoped inside iframe/tesco/index.html <style> block */

/* ═══════════════════════════════════════════════════════════════════
   Terms & Conditions overlay
   Shown in-iframe when a "Terms & Conditions" link is clicked. Fixed to
   the iframe's own box (position: fixed = iframe viewport), with the long
   legal copy scrolling inside the modal. Form state behind is preserved.
   ═══════════════════════════════════════════════════════════════════ */
.terms-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 30, 18, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.terms-overlay.is-open { display: flex; }

.terms-modal {
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  max-width: 720px;
  max-height: 92%;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: termsIn 0.22s ease both;
}
@keyframes termsIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.terms-modal__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--green);
  color: var(--cream);
}
.terms-modal__title {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 1.25rem;
  margin: 0;
}
.terms-modal__close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: var(--cream);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}
.terms-modal__close:hover { background: rgba(255, 255, 255, 0.28); }

.terms-modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 24px 28px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
}
.terms-modal__body h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.05rem;
  margin: 22px 0 10px;
  color: var(--green);
}
.terms-modal__body h3 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.95rem;
  margin: 20px 0 8px;
  color: var(--green-dk);
}
.terms-modal__body p { margin: 0 0 12px; }
.terms-modal__body ul { margin: 0 0 12px; padding-left: 20px; }
.terms-modal__body li { margin: 0 0 10px; }
.terms-modal__body .tcs-summary {
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 8px;
}
.terms-modal__body .tcs-summary h3 { margin-top: 0; }
.terms-modal__body a { color: var(--green-lt); }

@media (max-width: 600px) {
  .terms-modal { max-height: 96%; }
  .terms-modal__body { padding: 16px 18px 24px; }
  .terms-modal__title { font-size: 1.1rem; }
}
