/* =========================================================
   PACK PREMIUM — DESKTOP + MOBILE DÉDIÉS
   Un seul HTML, un seul CSS, deux compositions distinctes.
   ========================================================= */

:root {
  --primary: #ff536c;
  --primary-dark: #e74059;
  --primary-soft: #fff5f7;
  --text: #41424a;
  --muted: #747680;
  --border: #e4e5e9;
  --desktop-field-height: 52px;
  --mobile-field-height: 58px;
  --radius: 12px;
  --focus-ring: 0 0 0 4px rgba(255, 83, 108, 0.14);
  --page-max-width: 1450px;
  --contest-image-width: 486px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 12px;
  background:
    repeating-linear-gradient(
      90deg,
      #fff 0,
      #fff 16px,
      #fff7f8 16px,
      #fff7f8 30px
    );
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

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

.page-shell {
  width: min(100%, var(--page-max-width));
  margin: 0 auto;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(44, 44, 52, 0.08);
}

.site-banner img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.mobile-only {
  display: none;
}

.responsive-layout {
  display: grid;
  grid-template-columns: var(--contest-image-width) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding: 26px 28px 24px;
}

.contest-image {
  width: var(--contest-image-width);
}

.contest-image img {
  width: var(--contest-image-width);
  max-width: none;
  height: auto;
  object-fit: contain;
}

.form-panel {
  min-width: 0;
}

.form-header {
  /*
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  */
  margin-bottom: 18px;
}

.form-header h1 {
  margin: 0;
  color: #37383f;
  font-size: clamp(22px, 2vw, 31px);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.form-header strong {
  color: var(--primary);
}

.required-note {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  text-align: right;
}

.required-note span,
.field-required,
.date-row legend span,
.check-line label > span {
  color: var(--primary-dark);
}

.registration-form {
  display: grid;
  gap: 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid-3 {
  grid-template-columns: 1fr 1fr 1.08fr;
}

.address-grid {
  grid-template-columns: 0.9fr 1fr 1.08fr;
}

.email-line {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(280px, 1.2fr);
  gap: 14px;
  align-items: center;
}

.field {
  min-width: 0;
}

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

.input-wrap,
.select-wrap {
  position: relative;
}

.input-wrap input,
.select-wrap select,
.date-fields select {
  width: 100%;
  min-height: var(--desktop-field-height);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.input-wrap input {
  padding: 0 38px 0 50px;
}

.input-wrap input::placeholder {
  color: #747680;
  opacity: 1;
}

.input-wrap input:hover,
.select-wrap select:hover,
.date-fields select:hover {
  border-color: #d0d1d6;
}

.input-wrap input:focus,
.select-wrap select:focus,
.date-fields select:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 19px;
  pointer-events: none;
}

.field-required {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-weight: 700;
  pointer-events: none;
}

.help-text {
  margin: 0;
  color: #686a73;
  font-size: 14px;
  line-height: 1.4;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #6d6e76;
  border-bottom: 2px solid #6d6e76;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select-wrap select,
.date-fields select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.select-wrap select {
  padding: 0 44px 0 16px;
}

.check-line {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.check-line input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.check-line label {
  color: #555760;
  font-size: 14px;
  line-height: 1.5;
}

.check-line a {
  color: var(--primary-dark);
  text-underline-offset: 2px;
}

.date-section {
  display: grid;
  gap: 10px;
}

.date-row {
  display: grid;
  grid-template-columns: 240px minmax(360px, 500px);
  gap: 18px;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
}

.date-row legend {
  padding: 0;
  color: #4d4f58;
  font-size: 16px;
  font-weight: 750;
}

.date-fields {
  display: grid;
  grid-template-columns: 1fr auto 1.15fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.date-fields select {
  min-height: 48px;
  padding: 0 35px 0 12px;
  background-image:
    linear-gradient(45deg, transparent 50%, #6d6e76 50%),
    linear-gradient(135deg, #6d6e76 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.partner-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 12px;
  background: #fffafb;
}

.gift-icon {
  color: var(--primary);
  font-size: 38px;
  text-align: center;
}

.submit-button {
  width: min(430px, 100%);
  min-height: 58px;
  justify-self: center;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(90deg, #ff5b72 0%, #ff4560 100%);
  color: #fff;
  box-shadow: 0 12px 26px rgba(255, 83, 108, 0.23);
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

.submit-button:hover {
  filter: brightness(0.98);
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(255, 83, 108, 0.29);
}

.submit-button:focus-visible {
  outline: 3px solid rgba(255, 83, 108, 0.28);
  outline-offset: 3px;
}

.privacy-box {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 0 28px 20px;
  padding: 17px 22px;
  border-radius: 14px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
    repeating-linear-gradient(
      90deg,
      #fff1f3 0,
      #fff1f3 2px,
      #fff8f9 2px,
      #fff8f9 14px
    );
}

.privacy-box p {
  margin: 0;
  color: #666873;
  font-size: 13px;
  line-height: 1.5;
}

.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;
}

.only-mobile {
  display: none;
}

#error {
  /*
  padding-left: 10px;
  background: #ffeded;
  */
  font-weight: bold;
  color: red;
  width: 100%;
}

#error p {
  padding: 10px;
  margin: 0;
  background: #ffeded;
}

#error p.error_partners_wrapper {
  margin: -10px 0 10px 10px;
  padding: 0;
  background: none;
}

@media (min-width: 921px) {
  .date-fields select {
    width: auto;
  }
}

/* Ajustement desktop intermédiaire */
@media (max-width: 1180px) and (min-width: 921px) {
  :root {
    --contest-image-width: 420px;
  }

  .responsive-layout {
    gap: 24px;
    padding-inline: 20px;
  }
/*
  .form-header {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .required-note {
    text-align: right;
  }
*/
  .date-row {
    grid-template-columns: 200px minmax(300px, 1fr);
  }
}

/* =========================================================
   MOBILE DÉDIÉ — composition différente du desktop
   ========================================================= */

@media (max-width: 920px) {
  body {
    padding: 0;
    background: #fff;
  }

  .only-desktop {
    display: none;
  }

  .only-mobile {
    display: block;
  }

  .page-shell {
    border-radius: 0;
    box-shadow: none;
  }

  .site-banner {
    display: none;
  }

  .mobile-only {
    display: initial;
  }

  .desktop-title-tail {
    display: none;
  }

  .responsive-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
  }

  .contest-image {
    width: 100%;
  }

  .contest-image img {
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0;
  }

  .form-panel {
    padding: 26px 16px 34px;
  }
/*
  .form-header {
    display: block;
    margin-bottom: 22px;
  }
*/
  .form-header h1 {
    /*max-width: 720px;*/
    margin: 0 auto;
    color: #303138;
    font-size: clamp(22px, 6vw, 31px);
    line-height: 1.28;
    text-align: center;
  }

  .required-note {
    margin-top: 20px;
    font-size: 14px;
    text-align: right;
  }

  .registration-form {
    gap: 16px;
  }

  .grid-3,
  .email-line,
  .address-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .input-wrap input,
  .select-wrap select {
    min-height: var(--mobile-field-height);
    border-radius: 14px;
  }

  .input-wrap input {
    padding-left: 52px;
  }

  .input-icon {
    left: 18px;
    font-size: 20px;
  }

  .help-text {
    margin: -8px 10px 0;
    font-size: 13px;
  }

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

  .address-grid .field:last-child {
    grid-column: 1 / -1;
  }

  .adult-consent {
    margin-top: 4px;
  }

  .check-line {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 12px;
  }

  .check-line input {
    width: 22px;
    height: 22px;
  }

  .check-line label {
    font-size: 14px;
    line-height: 1.55;
  }

  .date-row {
    display: block;
  }

  .date-row + .date-row {
    margin-top: 4px;
  }

  .date-row legend {
    margin-bottom: 10px;
    font-size: 17px;
  }

  .date-fields {
    grid-template-columns: 1fr auto 1fr auto 1.2fr;
    gap: 7px;
  }

  .date-fields select {
    min-height: 56px;
    border-radius: 13px;
  }

  .partner-box {
    grid-template-columns: 1fr;
    padding: 0;
    background: transparent;
  }

  .gift-icon {
    display: none;
  }

  .submit-button {
    width: 100%;
    min-height: 60px;
    margin-top: 2px;
    border-radius: 15px;
    font-size: 18px;
  }

  .privacy-box {
    margin: 0 16px 22px;
    padding: 18px;
    border-radius: 16px;
  }
}

@media (max-width: 420px) {
  .form-panel {
    padding-right: 12px;
    padding-left: 12px;
  }

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

  .address-grid .field:last-child {
    grid-column: auto;
  }

  .date-fields {
    gap: 5px;
  }

  .date-fields select {
    padding-right: 28px;
    padding-left: 9px;
    font-size: 14px;
    background-position:
      calc(100% - 14px) 50%,
      calc(100% - 9px) 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
