/* KitKat — Ustaw się na granko */

:root {
  --kitkat-red: #bd0018;
  --dark-red: #8b001b;
  --violet: #4b0174;
  --dark-violet: #2f075a;
  --grey: #a4a3a3;
  --white: #ffffff;
  --font: "formiga", system-ui, sans-serif;
  --max: 1200px;
  --form-max: 996px;
  --radius-lg: 40px;
  --radius-md: 20px;
  --radius-sm: 10px;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 28px;
  font-weight: 400;
  color: var(--white);
  background: var(--kitkat-red);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Navbar —— */

.navbar {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar__inner,
.footer-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 60px;
  gap: 16px;
}

.logos {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-shrink: 0;
}

.logos__kitkat {
  width: 77px;
  height: 50px;
  object-fit: contain;
}

.logos__zabka {
  width: 100px;
  height: 40px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  height: 47px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  color: var(--kitkat-red);
  background: var(--white);
  line-height: 28px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: #f5f5f5;
  outline: none;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--kitkat-red);
  color: var(--kitkat-red);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
}

/* —— Hero —— */

.hero {
  position: relative;
  width: 100%;
  min-height: 420px;
  aspect-ratio: 3994 / 1448;
  max-height: 750px;
  overflow: hidden;
  background: var(--kitkat-red);
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  animation: hero-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__cta {
  position: absolute;
  bottom: 17%;
  left: calc(50% + 12%);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 263px;
  padding: 28px 48px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--violet);
  color: var(--violet);
  font-weight: 700;
  font-size: 24px;
  line-height: 28px;
  text-align: center;
  z-index: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: cta-pop 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.45s both,
    cta-pulse 2.4s ease-in-out 1.3s infinite;
}

.hero__cta:hover,
.hero__cta:focus-visible {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  outline: none;
  animation-play-state: paused;
}

/* —— Sections —— */

.section-how {
  background: var(--kitkat-red);
  padding: 84px 24px 48px;
  text-align: center;
}

.section-title {
  font-size: 48px;
  font-weight: 600;
  line-height: 56px;
  text-align: center;
  margin-bottom: 40px;
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  max-width: var(--max);
  margin: 0 auto 40px;
}

.step-card {
  background: var(--dark-red);
  border-radius: var(--radius-lg);
  width: 372px;
  max-width: 100%;
  min-height: 570px;
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.step-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

.step-card__img {
  width: 100%;
  max-width: 340px;
  height: 272px;
  object-fit: contain;
}

.step-card__title {
  font-size: 36px;
  font-weight: 600;
  line-height: 44px;
  margin-bottom: 12px;
}

.step-card__text {
  font-size: 16px;
  font-weight: 400;
  line-height: 28px;
}

.contest-dates {
  font-size: 16px;
  line-height: 28px;
  text-align: center;
}

.divider {
  display: block;
  width: 100%;
  height: auto;
  line-height: 0;
}

.divider img {
  width: 100%;
  height: auto;
}

/* —— Prizes —— */

.prizes-wrap {
  position: relative;
  background: var(--violet);
  overflow: hidden;
}

.section-prizes {
  position: relative;
  z-index: 1;
  padding: 84px 24px;
}

.prizes {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  max-width: var(--max);
  margin: 0 auto;
}

.prize-card {
  background: var(--kitkat-red);
  border-radius: var(--radius-lg);
  width: 571px;
  max-width: 100%;
  padding: 24px;
  display: flex;
  gap: 15px;
  align-items: flex-start;
  min-height: 328px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.prize-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
}

.prize-card--tall {
  min-height: 404px;
}

.prize-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  min-width: 0;
}

.prize-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-red);
  border-radius: var(--radius-sm);
  padding: 8px 30px;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  white-space: nowrap;
}

.prize-badge--accent {
  background: var(--kitkat-red);
}

.prize-card__title {
  font-size: 36px;
  font-weight: 600;
  line-height: 44px;
}

.prize-card__list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.prize-card__list li + li {
  margin-top: 2px;
}

.prize-card__list strong {
  font-weight: 700;
}

.prize-card__img {
  width: 266px;
  max-width: 45%;
  flex-shrink: 0;
  border-radius: 37px;
  object-fit: contain;
  align-self: stretch;
  height: auto;
  max-height: 100%;
}

.prize-card--extra {
  background: transparent;
  border: 1px solid var(--white);
  min-height: auto;
  width: 571px;
  align-items: center;
  padding: 24px 36px;
}

.prize-card--extra .prize-card__content {
  justify-content: space-between;
  min-height: 192px;
  align-items: center;
}

.prize-card__kinguin {
  width: 190px;
  max-width: 40%;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.rock {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.95;
}

.rock--left {
  left: -187px;
  bottom: 49px;
  width: 593px;
  max-width: 40vw;
}

.rock--right {
  right: -178px;
  bottom: 63px;
  width: 592px;
  max-width: 40vw;
}

/* —— Form —— */

.section-form {
  background: var(--violet);
  padding: 56px 24px;
  position: relative;
  z-index: 1;
}

.section-form .section-title {
  max-width: var(--form-max);
  margin-left: auto;
  margin-right: auto;
}

.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: var(--form-max);
  margin: 0 auto;
  padding: 56px;
  color: var(--dark-violet);
}

.form-label-group {
  margin-bottom: 56px;
}

.form-label-group > .hint {
  margin-bottom: 13px;
  color: var(--dark-violet);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.field input,
.field textarea {
  width: 100%;
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--violet);
  background: var(--white);
  color: var(--dark-violet);
  line-height: 28px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--grey);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--dark-violet);
  box-shadow: 0 0 0 3px rgba(75, 1, 116, 0.15);
}

.field textarea {
  background: var(--violet);
  border-color: var(--white);
  color: var(--white);
  min-height: 140px;
  resize: vertical;
}

.field textarea::placeholder {
  color: var(--grey);
}

.field textarea:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.field.is-invalid input,
.field.is-invalid textarea {
  border-color: var(--kitkat-red);
}

.field__error {
  font-kerning: none;
  font-size: 12px;
  line-height: 18px;
  color: var(--kitkat-red);
  min-height: 18px;
}

.question-block .hint {
  margin-bottom: 4px;
}

.question-block .question {
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--dark-violet);
}

.consents {
  max-width: var(--form-max);
  margin: 24px auto 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  color: var(--white);
  font-size: 12px;
  line-height: 18px;
}

.consent input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 0;
  border: 2px solid var(--white);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.consent input[type="checkbox"]:checked {
  background: var(--white);
}

.consent input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid var(--violet);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.consent input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

.consent a {
  text-decoration: underline;
}

.consent.is-invalid input[type="checkbox"] {
  border-color: #ffb3b3;
  box-shadow: 0 0 0 2px rgba(189, 0, 24, 0.4);
}

.form-actions {
  max-width: var(--form-max);
  margin: 32px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 263px;
  padding: 28px 48px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid var(--violet);
  color: var(--violet);
  font-weight: 700;
  font-size: 24px;
  line-height: 28px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn-submit:hover:not(:disabled),
.btn-submit:focus-visible:not(:disabled) {
  transform: scale(1.03);
  outline: none;
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  font-kerning: none;
  max-width: var(--form-max);
  width: 100%;
  text-align: center;
  font-size: 16px;
  line-height: 28px;
  min-height: 28px;
}

.form-status.is-error {
  color: #ffb3b3;
}

.form-status.is-success {
  color: #b8f5c4;
}

.form-success {
  display: none;
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: var(--form-max);
  margin: 0 auto;
  padding: 56px;
  text-align: center;
  color: var(--dark-violet);
}

.form-success.is-visible {
  display: block;
}

.form-success h2 {
  font-size: 36px;
  font-weight: 600;
  line-height: 44px;
  margin-bottom: 16px;
}

.form-card.is-hidden {
  display: none;
}

.consents.is-hidden,
.form-actions.is-hidden {
  display: none;
}

/* —— Contact / Footer —— */

.section-contact {
  background: var(--kitkat-red);
  padding: 64px 24px;
}

.contact-inner {
  max-width: 650px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.contact-logo {
  width: 187px;
  max-width: 100%;
}

.contact-info {
  color: var(--white);
}

.contact-info__title {
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  margin-bottom: 0;
}

.contact-info p {
  font-size: 16px;
  line-height: 28px;
}

.footer-bar {
  background: var(--white);
}

.footer-bar .nav-links a {
  color: var(--kitkat-red);
}

/* —— Modal —— */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(47, 7, 90, 0.55);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  max-height: min(90vh, 900px);
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  color: var(--dark-violet);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid #ebe4f2;
  flex-shrink: 0;
}

.modal__header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  color: var(--violet);
}

.modal__close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 28px;
  line-height: 1;
  color: var(--violet);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal__close:hover,
.modal__close:focus-visible {
  background: #f5f0fa;
  outline: none;
}

.modal__frame {
  width: 100%;
  flex: 1;
  min-height: 50vh;
  border: 0;
  background: var(--white);
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .modal {
    padding: 12px;
  }

  .modal__dialog {
    max-height: 92vh;
    border-radius: 24px;
  }

  .modal__header {
    padding: 14px 16px;
  }

  .modal__header h2 {
    font-size: 16px;
    line-height: 22px;
  }

  .modal__frame {
    min-height: 60vh;
  }
}

/* —— Mobile —— */

@media (max-width: 1024px) {
  .navbar__inner,
  .footer-bar__inner {
    padding: 16px 20px;
  }

  .hero {
    aspect-ratio: auto;
    min-height: 280px;
    max-height: none;
    height: 56vw;
    min-height: 320px;
  }

  .hero__cta {
    left: 50%;
    bottom: 24px;
    min-width: 200px;
    padding: 18px 32px;
    font-size: 18px;
  }

  .section-title {
    font-size: 36px;
    line-height: 44px;
  }

  .step-card {
    min-height: 0;
  }

  .step-card__title {
    font-size: 28px;
    line-height: 36px;
  }

  .prize-card,
  .prize-card--extra {
    width: 100%;
    max-width: 571px;
  }

  .rock {
    display: none;
  }

  .form-card {
    padding: 32px 24px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 20px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  }

  .navbar.is-open .nav-links {
    display: flex;
  }

  .nav-links a {
    justify-content: center;
  }

  .navbar {
    position: sticky;
  }

  .logos {
    gap: 16px;
  }

  .logos__kitkat {
    width: 56px;
    height: 36px;
  }

  .logos__zabka {
    width: 72px;
    height: 28px;
  }

  .section-how,
  .section-prizes {
    padding: 48px 16px;
  }

  .prize-card {
    flex-direction: column;
    align-items: center;
  }

  .prize-card__img {
    max-width: 220px;
    width: 100%;
    align-self: center;
    margin-inline: auto;
  }

  .prize-card--extra {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .prize-card__kinguin {
    max-width: 160px;
    width: 100%;
    align-self: center;
    margin-inline: auto;
  }

  .btn-submit,
  .hero__cta {
    width: calc(100% - 32px);
    max-width: 320px;
    min-width: 0;
  }

  .contact-inner {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }

  .footer-bar__inner {
    flex-direction: column;
    gap: 12px;
  }

  .footer-bar .nav-links {
    display: flex;
    position: static;
    box-shadow: none;
    padding: 0;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* —— Motion —— */

@keyframes hero-in {
  from {
    opacity: 0;
    transform: scale(1.06);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes cta-pop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes cta-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(255, 255, 255, 0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

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

.nav-links a {
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  transform: translateY(-2px);
}

.modal:not([hidden]) .modal__backdrop {
  animation: fade-in 0.25s ease both;
}

.modal:not([hidden]) .modal__dialog {
  animation: modal-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.btn-submit {
  transition: opacity 0.15s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-submit:hover:not(:disabled),
.btn-submit:focus-visible:not(:disabled) {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  .hero__img,
  .hero__cta,
  .modal:not([hidden]) .modal__backdrop,
  .modal:not([hidden]) .modal__dialog {
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .step-card:hover,
  .prize-card:hover,
  .nav-links a:hover,
  .nav-links a:focus-visible,
  .btn-submit:hover:not(:disabled),
  .btn-submit:focus-visible:not(:disabled),
  .hero__cta:hover,
  .hero__cta:focus-visible {
    transform: none;
  }

  .hero__cta:hover,
  .hero__cta:focus-visible {
    transform: translateX(-50%);
  }
}
