/* ==========================================================================
   McDowell's Soda – Yaari Ki Nayi Vibe microsite
   Pure CSS. Everything is sized from --u, which equals 1px on the 350px-wide
   reference design, so the form scales proportionally on every screen.
   ========================================================================== */

:root {
  /* Artwork is 553 x 1200 (ratio 0.4608). The stage keeps that ratio so the
     logo, form space and tagline always line up with the background art. */
  --stage-w: min(100vw, calc(100vh * 0.4608));
  --u: calc(var(--stage-w) / 350);

  --card-bg: rgba(42, 46, 56, 0.52);
  --ink: #1b1f33;
  --muted: #666b80;
  --orange: #f47b20;
  --orange-dark: #e2650c;
  --pink: #e8506b;
  --error: #ff9a9a;
  --gray-light: rgba(255, 255, 255, 0.1);

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-cond: "Barlow Condensed", "Roboto Condensed", "sans-serif-condensed",
               "Arial Narrow", "Helvetica Neue Condensed", "Avenir Next Condensed", Arial, sans-serif;
}

@supports (height: 100dvh) {
  :root { --stage-w: min(100vw, calc(100dvh * 0.4608)); }
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  overflow: hidden;            /* the page itself never scrolls */
  overscroll-behavior: none;
}

body {
  background: #2a3558;
  color: #fff;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

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

/* ---------- Background layers ---------- */
.backdrop {
  position: fixed;
  inset: -6%;
  background: url("assets/bg.jpg") center / cover no-repeat;
  filter: blur(28px) brightness(0.55) saturate(1.15);
}
/* Stage already fills the screen on phone-shaped viewports */
@media (max-aspect-ratio: 46/100) { .backdrop { display: none; } }

.stage {
  position: fixed;
  top: 0; bottom: 0; left: 50%;
  width: var(--stage-w);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #3f5489 url("assets/bg.jpg") center / cover no-repeat;
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
  .backdrop { display: none; }
  .stage {
    left: 0;
    width: 100vw;
    transform: none;
    background-size: 100% 100%;
    box-shadow: none;
  }
}

/* ---------- Navbar (logo area of the artwork) ---------- */
.navbar {
  flex: 0 0 22%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.content {
  flex: 1 1 0;
  min-height: 0;               /* lets the card shrink and scroll internally */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 max(18px, calc(22 * var(--u)));
}

.tagline-space { flex: 0 0 22.5%; }   /* clear space for the artwork's tagline banner */

/* ---------- Card ---------- */
.card {
  position: relative;
  width: 100%;
  max-height: 94%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(8 * var(--u));
  box-shadow: 0 calc(10 * var(--u)) calc(30 * var(--u)) rgba(8, 10, 24, 0.45);
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* Scrolling is allowed only here, and only when the screen is too short */
.card-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(10px, calc(10 * var(--u)));
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Inputs ---------- */
.field { position: relative; margin-bottom: max(5px, calc(5 * var(--u))); }

.field input,
.field select {
  display: block;
  width: 100%;
  min-height: max(44px, calc(36 * var(--u)));
  padding: 0 max(13px, calc(13 * var(--u)));
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 7px;
  background: rgba(250, 251, 253, 0.96);
  color: #252938;
  font: 500 15px / 1.4 var(--font-body);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(24, 30, 44, 0.05), 0 2px 8px rgba(24, 30, 44, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input::placeholder { color: #737986; opacity: 1; font-weight: 400; }
.field select {
  appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, #737986 50%), linear-gradient(135deg, #737986 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field select:disabled { color: #737986; opacity: 0.8; }
.field input:focus,
.field select:focus {
  border-color: rgba(232, 80, 107, 0.82);
  box-shadow: 0 0 0 3px rgba(232, 80, 107, 0.14), 0 3px 10px rgba(24, 30, 44, 0.08);
  background: #fff;
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"] { border-color: var(--error); }
.field input:read-only { background: rgba(240, 242, 245, 0.88); opacity: 0.78; }

/* Two-tone placeholder for the City field */
.fake-ph {
  position: absolute;
  left: calc(13 * var(--u));
  top: 0;
  height: max(34px, calc(29 * var(--u)));
  display: none;
  align-items: baseline;
  padding-top: max(8px, calc(7 * var(--u)));
  gap: 0.4em;
  color: #596273;
  font-size: 14px;
  pointer-events: none;
  white-space: nowrap;
}
.fake-ph { right: calc(10 * var(--u)); overflow: hidden; }
.fake-ph small { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 0.72em; color: #7d8491; }
.field input:placeholder-shown + .fake-ph { display: flex; }

.field-error {
  min-height: 0;
  margin: calc(4 * var(--u)) calc(3 * var(--u)) 0;
  color: #ff8787;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}
.field-error:empty { display: none; }

/* ---------- Experience radios ---------- */
.experience { border: 0; padding: 0; min-width: 0; margin-top: calc(6 * var(--u)); }

.experience legend {
  padding: 0;
  margin-bottom: calc(4 * var(--u));
  font: 600 15px / 1.4 var(--font-body);
  color: #fff;
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: max(44px, calc(34 * var(--u)));
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  font: 500 14px / 1.45 var(--font-body);
  cursor: pointer;
  margin-bottom: 4px;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s;
}
.choice:hover { border-color: rgba(255, 255, 255, 0.62); background: rgba(255, 255, 255, 0.17); }
.choice:has(input:checked) {
  border-color: rgba(232, 80, 107, 0.84);
  background: rgba(232, 80, 107, 0.17);
  box-shadow: inset 3px 0 var(--pink), 0 3px 12px rgba(35, 20, 35, 0.1);
}
.choice:has(input:checked):hover { background: rgba(232, 80, 107, 0.22); }

.choice input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin: 0;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid rgba(54, 61, 77, 0.36);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 20, 30, 0.16);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.choice input::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--pink);
  transform: scale(0);
  transition: transform 0.18s ease;
}
.choice input:checked { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(232, 80, 107, 0.13); }
.choice input:checked::after { transform: scale(1); }
.choice input:focus-visible,
.consent input:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ---------- Consents ---------- */
.consents { margin-top: calc(5 * var(--u)); }

.consent + .consent { margin-top: calc(3 * var(--u)); }

.consent label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: calc(8 * var(--u));
  align-items: start;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
}

.consent input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: max(16px, calc(12 * var(--u)));
  height: max(16px, calc(12 * var(--u)));
  margin: 2px 0 0;
  border: 1px solid rgba(54, 61, 77, 0.3);
  border-radius: 4px;
  background: rgba(250, 251, 253, 0.96);
  box-shadow: 0 1px 3px rgba(15, 20, 30, 0.12);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.consent input:checked { background: var(--orange); border-color: var(--orange); }
.consent input:checked::after {
  content: "";
  position: absolute;
  left: 30%; top: 8%;
  width: 28%; height: 56%;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.consent input[aria-invalid="true"] { outline: 2px solid var(--error); }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: max(46px, calc(36 * var(--u)));
  margin-top: calc(5 * var(--u));
  border: 0;
  border-radius: calc(6 * var(--u));
  background: linear-gradient(180deg, #f68a2f 0%, var(--orange-dark) 100%);
  color: #fff;
  font: 700 14px / 1.2 var(--font-body);
  letter-spacing: 0.08em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 calc(3 * var(--u)) calc(10 * var(--u)) rgba(226, 101, 12, 0.35);
  transition: filter 0.15s, transform 0.1s, opacity 0.15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-small { width: auto; padding: 0 calc(22 * var(--u)); margin-top: calc(14 * var(--u)); }
.btn-link { display: inline-flex; width: auto; padding: 0 calc(26 * var(--u)); }

.btn .spinner {
  position: absolute;
  display: none;
  width: 1.5em; height: 1.5em;
  border-width: 3px;
}
.btn[aria-busy="true"] { cursor: progress; opacity: 1; }
.btn[aria-busy="true"] .btn-label { opacity: 0; }
.btn[aria-busy="true"] .spinner { display: block; }

/* ---------- Spinner ---------- */
.spinner {
  display: inline-block;
  width: 28px; height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.spinner-lg { border-top-color: var(--orange); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(10 * var(--u));
  padding: calc(16 * var(--u));
  background: rgba(30, 35, 55, 0.92);
  backdrop-filter: blur(4px);
  text-align: center;
  font: 600 max(14px, calc(13 * var(--u))) / 1.4 var(--font-body);
}

/* ---------- Banner ---------- */
.banner {
  margin-bottom: calc(9 * var(--u));
  padding: calc(10 * var(--u)) calc(12 * var(--u));
  border: 1px solid rgba(255, 120, 120, 0.4);
  border-radius: calc(8 * var(--u));
  background: rgba(255, 100, 100, 0.15);
  backdrop-filter: blur(2px);
  color: #ffcdd2;
  font-size: max(13px, calc(11.5 * var(--u)));
  line-height: 1.45;
  font-weight: 500;
  white-space: pre-wrap;
}

/* ---------- Success ---------- */
.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8 * var(--u));
  padding: calc(10 * var(--u)) 0;
  text-align: center;
}
.success-icon {
  width: calc(46 * var(--u)); height: calc(46 * var(--u));
  min-width: 40px; min-height: 40px;
  padding: calc(10 * var(--u));
  border-radius: 50%;
  background: linear-gradient(180deg, #f68a2f, var(--orange-dark));
  color: #fff;
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
.success h2 {
  font: 700 max(26px, calc(28 * var(--u))) / 1.2 var(--font-cond);
  outline: none;
  color: #fff;
}
.success p {
  font-size: max(14px, calc(12.5 * var(--u)));
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
}
.details {
  width: 100%;
  margin-top: calc(6 * var(--u));
  padding: calc(12 * var(--u));
  border-radius: calc(8 * var(--u));
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  text-align: left;
  font-size: max(12px, calc(10.5 * var(--u)));
}
.details div { display: flex; justify-content: space-between; gap: 12px; padding: calc(4 * var(--u)) 0; }
.details dt { color: rgba(255, 255, 255, 0.7); font-weight: 500; }
.details dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; color: #fff; }

/* ---------- Touch devices: 16px+ inputs prevent iOS focus-zoom ---------- */
@media (pointer: coarse) {
  .field input, .field select, .fake-ph { font-size: max(16px, calc(12 * var(--u))); }
  .fake-ph { padding-top: max(8px, calc(7 * var(--u))); }
}

/* ---------- Mobile detection prompt ---------- */
.mobile-prompt {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 29, 42, 0.42);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  padding: 20px;
}

.mobile-prompt-content {
  width: min(100%, 380px);
  background: rgba(229, 232, 236, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.mobile-prompt h2 {
  color: var(--ink);
  font: 700 23px / 1.2 var(--font-cond);
  margin: 0 0 12px;
}

.mobile-prompt p {
  color: #454b59;
  font: 400 16px / 1.5 var(--font-body);
  margin: 0 0 24px;
}

.btn-dismiss {
  background: var(--orange);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 12px 28px;
  font: 600 14px / 1.2 var(--font-body);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-dismiss:hover {
  background: var(--orange-dark);
}

.btn-dismiss:active {
  transform: translateY(1px);
}

.btn-dismiss:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .success-icon, .mobile-prompt-content { animation: none; }
  .btn, .field input { transition: none; }
}

@media (max-width: 360px) {
  .content { padding-inline: 14px; }
  .card-scroll { padding: 10px; }
  .consent label { font-size: 12px; }
  .mobile-prompt-content { padding: 24px 18px; }
}
