:root {
  --page-bg: #f6f7f9;
  --surface: #ffffff;
  --text: #15171d;
  --muted: #667085;
  --border: #d9dee7;
  --accent: #f2b106;
  --accent-dark: #9a6200;
  --danger: #b42318;
  --success: #067647;
  --shadow: 0 18px 48px rgba(20, 28, 45, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, #ffffff 0%, #f6f7f9 42%, #eef2f6 100%);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

.competition-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Future banner replacement:
   Desktop/tablet asset: 720 x 230 px.
   Mobile asset: 390 x 210 px, with important text inside the center 342 px.
   Export at 2x when possible: 1440 x 460 and 780 x 420.
*/
.intro-band {
  background:
    radial-gradient(circle at 15% 18%, rgba(242, 177, 6, 0.16), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #fff8e3 48%, #eef6f5 100%);
  border-bottom: 1px solid rgba(217, 222, 231, 0.85);
}

.intro-inner {
  width: min(100%, 720px);
  min-height: 210px;
  margin: 0 auto;
  padding: 30px 20px 24px;
}

.brand-logo {
  display: block;
  width: 160px;
  height: auto;
  object-fit: contain;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin: 0;
  color: #101828;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0;
}

.lead {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.form-section {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 22px 16px 34px;
}

.form-warning {
  margin: 0 0 10px;
  color: var(--danger);
  font-size: 15px;
  line-height: 1.8;
  font-weight: 900;
  text-align: right;
}

.form-stack {
  overflow: hidden;
  border-radius: var(--radius);
}

.form-track {
  display: grid;
  grid-template-columns: 100% 100%;
  grid-template-areas: "form success";
  align-items: stretch;
  transition: transform 360ms ease;
  will-change: transform;
}

.form-stack.is-success .form-track {
  transform: translateX(100%);
}

.competition-form {
  grid-area: form;
  display: grid;
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label,
legend {
  color: #253047;
  font-size: 14px;
  font-weight: 800;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

input[type="text"],
input[type="tel"] {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

input[type="text"]:focus,
input[type="tel"]:focus {
  border-color: rgba(242, 177, 6, 0.9);
  box-shadow: 0 0 0 4px rgba(242, 177, 6, 0.2);
}

input::placeholder {
  color: #98a2b3;
}

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

.segmented label {
  display: block;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  color: #344054;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 800;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
}

.segmented input:checked + span {
  color: #111827;
  background: #fff4cf;
  border-color: rgba(242, 177, 6, 0.95);
  box-shadow: 0 0 0 3px rgba(242, 177, 6, 0.16);
}

.consent {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  color: #344054;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 700;
}

.consent input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--accent);
}

.submit-button {
  position: relative;
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  color: #111827;
  background: var(--accent);
  border: 1px solid rgba(154, 98, 0, 0.25);
  border-radius: var(--radius);
  font-weight: 900;
  cursor: pointer;
  transition:
    filter 150ms ease,
    transform 150ms ease;
}

.submit-button:active {
  transform: translateY(1px);
}

.submit-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.2) opacity(0.72);
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(17, 24, 39, 0.25);
  border-top-color: #111827;
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

.competition-form.is-submitting .spinner {
  display: inline-block;
}

.error {
  min-height: 18px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

.no-terms-page .intro-band {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
}

.no-terms-page .intro-inner {
  width: 100%;
  min-height: 136px;
  margin: 0;
  padding: 18px 10px 16px;
}

.no-terms-page .brand-logo {
  width: 132px;
  margin-bottom: 12px;
}

.no-terms-page h1 {
  font-size: 25px;
  line-height: 1.22;
}

.no-terms-page .form-section {
  width: 100%;
  padding: 10px 4px 18px;
}

.no-terms-page .form-warning {
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.no-terms-page .competition-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px 8px;
  box-shadow: 0 10px 28px rgba(20, 28, 45, 0.09);
}

.no-terms-page .field:first-child,
.no-terms-page .field:nth-child(2),
.no-terms-page .consent,
.no-terms-page .submit-button,
.no-terms-page .status-message {
  grid-column: 1 / -1;
}

.no-terms-page .field {
  gap: 4px;
}

.no-terms-page label,
.no-terms-page legend {
  font-size: 13px;
}

.no-terms-page input[type="text"],
.no-terms-page input[type="tel"] {
  min-height: 42px;
  padding: 8px 11px;
}

.no-terms-page .segmented {
  gap: 6px;
}

.no-terms-page .segmented span {
  min-height: 42px;
  padding: 8px 10px;
}

.no-terms-page .consent {
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 1.45;
}

.no-terms-page .consent a {
  color: #667085;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.no-terms-page .submit-button {
  min-height: 44px;
  padding: 10px 14px;
}

.no-terms-page .error {
  min-height: 0;
}

.no-terms-page .error:empty {
  display: none;
}

.status-message {
  padding: 12px 13px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.status-message.is-success {
  color: var(--success);
  background: #ecfdf3;
  border: 1px solid #abefc6;
}

.status-message.is-error {
  color: var(--danger);
  background: #fef3f2;
  border: 1px solid #fecdca;
}

.success-panel {
  grid-area: success;
  position: relative;
  display: grid;
  min-height: 100%;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 44px 18px 38px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.success-back-button {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #111827;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.success-back-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.success-animation {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
}

.success-check {
  width: 132px;
  height: 132px;
  overflow: visible;
}

.success-circle {
  fill: #ecfdf3;
  stroke: #12b76a;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 290;
  stroke-dashoffset: 290;
  animation: drawCircle 700ms ease-out forwards;
}

.success-tick {
  fill: none;
  stroke: #067647;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 72;
  stroke-dashoffset: 72;
  animation: drawTick 520ms 420ms ease-out forwards;
}

.success-panel h2 {
  margin: 4px 0 0;
  color: #101828;
  font-size: 28px;
  line-height: 1.35;
  letter-spacing: 0;
}

.success-panel p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  font-weight: 800;
}

.terms-section {
  margin-top: 22px;
  padding: 20px 18px 22px;
  color: #253047;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(217, 222, 231, 0.95);
  border-radius: var(--radius);
  direction: rtl;
  text-align: right;
}

.terms-section h2,
.terms-section h3 {
  margin: 0;
  color: #101828;
  line-height: 1.55;
  letter-spacing: 0;
}

.terms-section h2 {
  font-size: 21px;
}

.terms-section h3 {
  margin-top: 20px;
  font-size: 17px;
}

.terms-section p {
  margin: 10px 0 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.65;
}

.terms-section ol,
.terms-section ul {
  margin: 10px 0 0;
  padding: 0 22px 0 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.65;
}

.terms-section li {
  padding-right: 4px;
  margin-top: 4px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes drawCircle {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes drawTick {
  to {
    stroke-dashoffset: 0;
  }
}

@media (min-width: 640px) {
  .intro-inner {
    min-height: 230px;
    padding-top: 42px;
  }

  h1 {
    font-size: 38px;
  }

  .competition-form {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    padding: 22px;
  }

  .field:first-child,
  .consent,
  .submit-button,
  .status-message {
    grid-column: 1 / -1;
  }

  .no-terms-page .intro-inner {
    min-height: 150px;
    padding-top: 22px;
  }

  .no-terms-page h1 {
    font-size: 30px;
  }

  .no-terms-page .competition-form {
    gap: 12px;
    padding: 14px;
  }
}
