:root { color-scheme: dark; --field-height: 54px; }
* { box-sizing: border-box; }
html, body { height: 100%; overflow-x: hidden; overflow-y: auto; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  background-color: #000; /* black bars if image doesn't fill */
  /* Background image (always fully visible) */
  color: #f5f5f5;
  display: grid;
  place-items: center;
  padding: clamp(18px, 6vh, 36px) 0 clamp(180px, 24vh, 290px);
  position: relative;
}
body *, body *::before, body *::after {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}
input, textarea, select {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
/* Overlay for readability */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url('media/sillhouette.webp');
  background-size: contain;
  background-position: calc(50% - 1.5vw) calc(50% - 3vw);
  background-repeat: no-repeat;
  background-attachment: fixed;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.58);
  pointer-events: none;
  z-index: 1;
}
.wrap {
  width: min(920px, 92vw);
  padding: clamp(16px, 5vw, 48px);
  position: relative;
  z-index: 6; /* above overlay and footer */
  transform: translateY(-0.5vh);
}
.bottom-banner {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(12px, 5vh, 32px));
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 82vw);
  aspect-ratio: 915 / 232;
  z-index: 3;
  pointer-events: none;
  opacity: 0.82;
  background-image: url('media/bottom_text.svg');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  touch-action: none;
}
.brand { display: flex; justify-content: center; align-items: center; margin: 12px 0 18px; }
.brand img {
  width: clamp(140px, 22vw, 240px);
  height: auto;
  display: block;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.phone-input-wrap { position: relative; width: 100%; }
.phone-placeholder {
  position: absolute;
  top: 50%;
  left: var(--phone-placeholder-left, 0px);
  right: 12px;
  transform: translateY(-50%);
  color: rgba(207, 207, 207, 0.9);
  pointer-events: none;
  font-size: inherit;
  line-height: 1;
  opacity: 0;
  transition: opacity .12s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-placeholder.visible { opacity: 1; }
@media (max-width: 640px) {
  .brand { margin: 4px 0 12px; position: relative; top: -12px; }
}
.headline {
  margin: clamp(18px, 4vw, 32px) 0 6px 0;
  font-weight: 800;
  font-size: clamp(20px, 4.8vw, 44px);
  letter-spacing: 0.015em;
  line-height: 1.05;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.headline .headline-label {
  display: block;
  margin: 0 auto clamp(6px, 1.4vw, 12px);
  opacity: 0.95;
}
.headline-badge {
  display: block;
  height: clamp(24px, 4.6vw, 44px);
  width: auto;
  margin: 0 auto;
  pointer-events: none;
  user-select: none;
}
.headline .headline-values {
  display: inline-block;
}
@media (max-width: 360px) {
  .headline { font-size: clamp(16px, 5.5vw, 28px); letter-spacing: 0.01em; }
}
@media (min-width: 641px) {
  .headline .headline-label { margin-right: 0; }
  .headline .headline-values { display: inline-block; }
}
@media (max-width: 640px) {
  .headline { margin: 28px 0 6px 0; }
  .headline .headline-values { font-size: clamp(18px, 5vw, 26px); }
}
/* Allow line breaks in the headline for countdown layout */
@media (min-width: 768px) {
  .headline { white-space: normal; }
}
.subhead {
  margin: 0 0 28px 0;
  font-size: clamp(14px, 2.8vw, 24px);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #d6d6d6;
  text-align: center;
}
.kicker { text-align: left; font-size: clamp(12px, 1.6vw, 14px); letter-spacing: .08em; text-transform: uppercase; color: #d6d6d6; margin: 0 0 8px 0; }
/* Email bar */
.bar {
  display: flex;
  align-items: center;
  height: var(--field-height);
  border: 1.5px solid #8a8a8a;
  border-radius: 2px;
  padding: 0 20px;
  transition: border-color .15s ease;
}
.bar:focus-within { border-color: #ffffff; }
.bar input[type="email"] {
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  font-size: clamp(16px, 2.8vw, 22px);
  width: 100%;
  height: 100%;
}
.bar input::placeholder { color: #cfcfcf; opacity: .9; }
.arrow-btn {
  height: var(--field-height);
  aspect-ratio: 1 / 1; /* square, matches email bar height */
  display: grid; place-items: center;
  background: rgba(255,255,255,0.10); /* translucent white */
  color: #111;
  border: 1.5px solid rgba(255,255,255,0.45);
  border-radius: 2px; /* square to match input boxes */
  cursor: pointer;
  transition: opacity .15s ease, background-color .15s ease, border-color .15s ease;
  font-size: 0; /* hide any text spacing */
}
.arrow-btn:hover { background: rgba(255,255,255,0.98); border-color: rgba(255,255,255,0.98); }
.arrow-btn:hover { color: #fff; }
.arrow-btn[disabled] { opacity: .6; cursor: default; }
.arrow-btn .icon {
  width: 32px;
  height: 32px;
  display: block;
  opacity: 0.85;
  transition: filter .18s ease, opacity .18s ease;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}
.arrow-btn:hover .icon {
  opacity: 1;
  filter: invert(1); /* white arrow -> black */
}

.status { min-height: 1.2em; margin-top: 10px; color: #e6e6e6; transition: color .2s ease, opacity .2s ease; }
.status:empty { margin-top: 0; min-height: 0; }
.status.ok { color: #7cf39b; animation: none; }
.status.err { color: #ff6b6b; animation: none; }
.status.pending { color: #ffffff; animation: statusPulse 1.4s ease-in-out infinite; }

@keyframes statusPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* Hidden helpers */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -9999px; top: -9999px; }

/* Country + phone row */
.row-contacts {
  margin-top: 12px;
  display: grid;
  grid-template-columns: max-content 1fr; /* dropdown shrinks to content */
  gap: 12px;
}
/* Container to align elements with the left column (excluding arrow) */
.left-col { width: 100%; }
/* Grid that places the arrow to the right of both rows */
.fields-grid { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 12px; column-gap: 12px; align-items: stretch; }
.fields-grid .bar { grid-column: 1; grid-row: 1; }
.fields-grid .row-contacts { grid-column: 1 / span 2; grid-row: 2; margin-top: 0; }
.fields-grid .arrow-btn { grid-column: 2; grid-row: 1; align-self: stretch; justify-self: end; }

/* Mobile: email input + arrow on same line; phone/region below */
@media (max-width: 640px) {
  .fields-grid { grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 10px; column-gap: 10px; align-items: stretch; }
  .fields-grid .bar { grid-column: 1; grid-row: 1; }
  .fields-grid .arrow-btn { grid-column: 2; grid-row: 1; align-self: stretch; justify-self: end; margin-top: 0; height: var(--field-height); }
  .fields-grid .row-contacts { grid-column: 1 / span 2; grid-row: 2; }
  .left-col { width: 100%; }
}
.field {
  background: transparent;
  border: 1.5px solid #8a8a8a;
  border-radius: 2px;
  color: #fff;
  padding: 0 12px;
  font-size: clamp(15px, 2.2vw, 18px);
  outline: none;
  width: 100%;
  height: var(--field-height);
  transition: border-color .15s ease;
}
.field:focus { border-color: #ffffff; }
select.field { color-scheme: dark; }

@media (max-width: 480px) {
  :root { --field-height: 48px; }
  .field { font-size: clamp(14px, 4.4vw, 16px); padding: 0 10px; }
  .arrow-btn { height: var(--field-height); }
  .arrow-btn .icon { width: 28px; height: 28px; }
  .dropdown-toggle { gap: 8px; padding-right: 10px; }
  .dropdown-toggle .label::after { width: 20px; }
  .phone-placeholder { font-size: 0.92em; right: 10px; }
}

/* Custom dropdown */
.dropdown { position: relative; width: auto; }
.dropdown-toggle {
  --country-toggle-max-width: 220px;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  white-space: nowrap;
  max-width: calc(var(--country-toggle-max-width, 220px) + 28px);
  padding-right: 12px;
}
.dropdown-toggle .label {
  display: inline-block;
  overflow: hidden;
  text-overflow: clip;
  max-width: var(--country-toggle-max-width, 220px);
  position: relative;
}
.dropdown-toggle .label::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 20px;
  background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,0.85));
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s ease;
}
.dropdown-toggle.is-truncated .label::after { opacity: 1; }
.dropdown-toggle .caret {
  margin-left: auto;
  opacity: .85;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.dropdown-menu { position: absolute; z-index: 400; top: calc(100% + 6px); left: 0; right: auto; width: 248px; max-width: calc(100vw - 40px); max-height: 260px; overflow: auto; background: #1b1b1b; border: 1px solid #8a8a8a; border-radius: 2px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.dropdown-menu[hidden] { display: none; }
.option { padding: 10px 10px; border-radius: 2px; cursor: pointer; }
.option:hover, .option[aria-selected="true"] { background: #2a2a2a; }

/* Mobile: nudge background image (headphones) downward and left */
@media (max-width: 640px) {
  html, body { min-height: 100dvh; height: 100dvh; overflow: hidden; }
  body {
    padding-top: clamp(12px, 3vh, 20px);
    padding-bottom: clamp(110px, 18vh, 180px);
  }
  body::before { background-position: calc(50% - 2vw) 48% !important; }
  .wrap {
    transform: translateY(0);
    width: min(92vw, 540px);
    max-height: calc(100dvh - clamp(12px, 3vh, 20px) - clamp(110px, 18vh, 180px));
    overflow: visible;
  }
  .fields-grid { gap: 8px; column-gap: 8px; }
  .row-contacts { gap: 8px; }
  .bottom-banner { width: min(300px, 80vw); bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(18px, 7vh, 36px)); }
}

@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  html, body { overflow: auto; }
  body { padding-bottom: clamp(24px, 10vh, 48px); }
  body::before { background-position: calc(50% - 1.5vw) calc(50% - 3vw); }
  .wrap { transform: translateY(0); padding-bottom: clamp(32px, 12vh, 64px); }
  .bottom-banner {
    position: static;
    display: block;
    width: min(360px, 84vw);
    max-width: 420px;
    margin: clamp(24px, 12vh, 48px) auto calc(env(safe-area-inset-bottom, 0px) + clamp(20px, 8vh, 40px));
    pointer-events: none;
    transform: none;
    left: auto;
    right: auto;
    bottom: auto;
  }
}

@media (min-width: 641px) and (max-height: 520px) {
  body { padding-bottom: clamp(24px, 10vh, 48px); }
  .wrap { transform: translateY(0); padding-bottom: clamp(32px, 12vh, 64px); }
  .bottom-banner {
    position: static;
    display: block;
    width: min(420px, 82vw);
    max-width: 420px;
    margin: clamp(24px, 12vh, 48px) auto calc(env(safe-area-inset-bottom, 0px) + clamp(20px, 8vh, 40px));
    pointer-events: none;
    transform: none;
    left: auto;
    right: auto;
    bottom: auto;
  }
}
/* Custom checkbox (square with filled square when checked) */
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: #e6e6e6; cursor: pointer; user-select: none; }
.checkbox input[type="checkbox"] {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border: 0; border-radius: 2px; display: grid; place-items: center; background: transparent; margin: 0;
  box-shadow: inset 0 0 0 1.5px #8a8a8a; /* draw border via inset shadow to avoid double-border look */
  background-clip: padding-box;
  transition: box-shadow .15s ease;
}
.checkbox input[type="checkbox"]:hover { box-shadow: inset 0 0 0 1.5px #ffffff; }
.checkbox input[type="checkbox"]:focus { outline: none; box-shadow: inset 0 0 0 1.5px #ffffff; }
.checkbox input[type="checkbox"]::after {
  content: ""; width: 10px; height: 10px; background: #ffffff; transform: scale(0); transition: transform .12s ease; border-radius: 1px;
}
.checkbox input[type="checkbox"]:checked::after { transform: scale(1); }
@media (max-width: 640px) { .checkbox input[type="checkbox"] { width: 16px; height: 16px; } .checkbox input[type="checkbox"]::after { width: 9px; height: 9px; } }
