*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --mi-charcoal: #313139;
  --mi-green: #47b549;
  --mi-green-mid: #5eba47;
  --mi-green-light: #8cc13f;
  --dunlop-red: #c8102e;
  --dunlop-red-dark: #9a0c24;
  --srixon-navy: #002147;
  --white: #ffffff;
  --surface: #f7f8fa;
  --surface-muted: #eef0f4;
  --text: #1a1b1f;
  --text-muted: #5f6368;
  --border: rgba(49, 49, 57, 0.1);
  --border-strong: rgba(49, 49, 57, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 16px 48px rgba(49, 49, 57, 0.1);
  --shadow-card: 0 2px 16px rgba(49, 49, 57, 0.06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
}

html {
  font-size: 17px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

.ambient__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(71, 181, 73, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(71, 181, 73, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 15%, transparent 70%);
}

.ambient__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}

.ambient__glow--green {
  width: 480px;
  height: 480px;
  top: -200px;
  left: -100px;
  background: var(--mi-green-light);
  opacity: 0.12;
}

.ambient__glow--red {
  width: 360px;
  height: 360px;
  top: 80px;
  right: -80px;
  background: var(--dunlop-red);
  opacity: 0.06;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 1rem 2rem;
}

/* Brand bar */
.brand-bar {
  width: 100%;
  max-width: 980px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.brand-bar__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.brand-bar__logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  width: 100%;
  margin-inline: auto;
}

.brand-bar__logo--dunlop {
  height: 38px;
  width: auto;
}

.brand-bar__logo--mi {
  height: 48px;
  width: auto;
}

.brand-bar__mark {
  width: 1px;
  height: 32px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--border-strong),
    transparent
  );
}

.brand-bar__label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Main shell */
.shell {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  background: var(--white);
}

.prize-section {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 1rem;
}

.prize-section__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mi-charcoal);
}

.prize-section__image-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}

.prize-section__image {
  max-height: 180px;
  width: auto;
}

.prize-section__name {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-muted);
  max-width: 32ch;
}

/* Showcase panel */
.showcase {
  position: relative;
  padding: 2.5rem 2.25rem;
  background:
    linear-gradient(165deg, rgba(71, 181, 73, 0.06) 0%, transparent 50%),
    linear-gradient(200deg, rgba(200, 16, 46, 0.04) 0%, transparent 45%),
    var(--white);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: 100%;
  border-right: 1px solid var(--border);
}

.showcase__content {
  flex: 1;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mi-green);
  background: rgba(71, 181, 73, 0.08);
  border: 1px solid rgba(71, 181, 73, 0.2);
  border-radius: 100px;
}

.headline {
  margin: 0 0 1rem;
  line-height: 1.05;
}

.headline__accent {
  display: block;
  font-size: clamp(2.2rem, 5vw, 2.75rem);
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.02em;
  color: var(--mi-charcoal);
}

.headline__rest {
  display: block;
  margin-top: 0.15rem;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.lead {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 38ch;
}

.stats {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stats__item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stats__value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--mi-green-light), var(--mi-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Form panel */
.form-panel {
  padding: 2.25rem 2.25rem 2rem;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.form-panel__header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.form-panel__header h2 {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--mi-charcoal);
}

.subtitle {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
}

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

.field {
  margin-bottom: 0;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mi-charcoal);
}

.field input {
  width: 100%;
  padding: 0.8rem 0.95rem;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.field input::placeholder {
  color: rgba(95, 99, 104, 0.55);
}

.field input:focus {
  outline: none;
  border-color: var(--mi-green);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(71, 181, 73, 0.15);
}

.field input.error {
  border-color: var(--dunlop-red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.field-error {
  display: none;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--dunlop-red);
}

.field-error.visible {
  display: block;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.checkbox-field input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
  accent-color: var(--mi-green);
  cursor: pointer;
}

.checkbox-field label {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  cursor: pointer;
}

.entry-form > .field-error {
  margin-top: 0.5rem;
}

.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  background: linear-gradient(
    135deg,
    var(--dunlop-red) 0%,
    var(--dunlop-red-dark) 100%
  );
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
  box-shadow: 0 4px 16px rgba(200, 16, 46, 0.25);
}

.submit-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(71, 181, 73, 0.25) 100%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

.submit-btn:hover:not(:disabled)::before {
  opacity: 1;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(200, 16, 46, 0.3);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.submit-btn__text {
  position: relative;
}

.submit-btn__arrow {
  position: relative;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.submit-btn__arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
}

.form-disclaimer {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.config-warning {
  display: none;
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  background: #fff8e6;
  border: 1px solid #f0c040;
  border-left: 4px solid #f0c040;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.45;
  color: #7a5c00;
}

.config-warning.visible {
  display: block;
}

/* Success overlay */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 100;
  padding: 1rem;
}

.overlay.visible {
  opacity: 1;
  visibility: visible;
}

.overlay-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.overlay.visible .overlay-card {
  transform: scale(1);
}

.overlay-card__stripe {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--mi-green),
    var(--dunlop-red)
  );
}

.overlay-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(71, 181, 73, 0.12), rgba(140, 193, 63, 0.06));
  border: 2px solid rgba(71, 181, 73, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-icon svg {
  width: 32px;
  height: 32px;
  color: var(--mi-green);
}

.overlay-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--mi-charcoal);
}

.overlay-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.overlay-card__note {
  margin-top: 1rem !important;
  font-size: 0.78rem !important;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(95, 99, 104, 0.7) !important;
}

/* Footer */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-top: 1.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.footer__brand--dunlop {
  color: var(--dunlop-red);
}

.footer__brand--mi {
  color: var(--mi-green);
}

.footer__sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-strong);
}

.footer__copy {
  width: 100%;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(95, 99, 104, 0.6);
}

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

  .showcase {
    display: contents;
  }

  .showcase__content {
    order: 1;
    padding: 2rem 1.75rem;
    background:
      linear-gradient(165deg, rgba(71, 181, 73, 0.06) 0%, transparent 50%),
      linear-gradient(200deg, rgba(200, 16, 46, 0.04) 0%, transparent 45%),
      var(--white);
    border-bottom: 1px solid var(--border);
  }

  .form-panel {
    order: 2;
    padding: 1.75rem;
  }

  .prize-section {
    order: 3;
    margin-top: 0;
    padding: 1.5rem 1.75rem 1.75rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    align-items: center;
    text-align: center;
  }

  .stats {
    gap: 1.25rem;
  }
}

@media (max-width: 540px) {
  html {
    font-size: 16px;
  }

  .brand-bar__logo--dunlop {
    height: 32px;
  }

  .brand-bar__logo--mi {
    height: 40px;
  }

  .prize-section__image {
    max-height: 140px;
  }
}

@media (max-width: 414px) {
  .page {
    padding-inline: 0.75rem;
  }

  .brand-bar__logos {
    gap: 0.65rem;
    max-width: 100%;
    padding-inline: 0.25rem;
  }

  .brand-bar__logo--mi,
  .brand-bar__logo--dunlop {
    flex-shrink: 1;
    min-width: 0;
    width: auto;
    object-fit: contain;
  }

  .brand-bar__logo--mi {
    height: clamp(20px, 7.5vw, 30px);
    max-width: 45%;
  }

  .brand-bar__logo--dunlop {
    height: clamp(18px, 6.5vw, 26px);
    max-width: 38%;
  }

  .brand-bar__mark {
    height: 22px;
    flex-shrink: 0;
  }

  .brand-bar__label {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    padding-inline: 0.5rem;
  }
}
