:root {
  color-scheme: dark;
  --gold: #f6c412;
  --danger: #ee3037;
  --ink: #090a12;
  --paper: #fff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Tahoma, "Segoe UI", sans-serif; background: #02030b; }
button, input { font: inherit; }
.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; }
.stage { min-height: 100vh; min-height: 100svh; }
.screen { display: none; min-height: 100vh; min-height: 100svh; width: 100%; background-color: #02030b; background-position: top center; background-repeat: no-repeat; background-size: contain; }
.screen.is-active { display: flex; animation: reveal .28s ease-out both; }

.screen--welcome { background-image: url("../assets/movie-mobile-welcome.jpg"); align-items: flex-start; justify-content: center; padding-top: min(68vh, 147.2vw); }
.screen--form { background-image: url("../assets/movie-mobile-form.jpg"); align-items: flex-start; justify-content: center; padding: 44vh 24px 70px; }
.screen--thankyou { background-image: url("../assets/movie-mobile-thankyou.jpg"); align-items: flex-end; justify-content: center; padding: 0 20px 5vh; }

.art-button { border: 0; background: transparent; padding: 0; cursor: pointer; transition: transform .16s ease, filter .16s ease; }
.art-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.art-button:focus-visible { outline: 3px solid #fff; outline-offset: 4px; border-radius: 999px; }
.art-button:disabled { opacity: .55; cursor: wait; transform: none; }
.art-button img { display: block; width: 100%; height: auto; }
.register-button { width: clamp(210px, 62vw, 255px); }

.movie-form {
  width: min(100%, 390px);
  padding: 20px 18px 16px;
  color: #fff;
  background: rgba(3, 4, 12, .72);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  backdrop-filter: blur(5px);
}
.field { margin-bottom: 11px; }
.field label { display: block; margin: 0 8px 5px; font-size: 12px; font-weight: 700; text-shadow: 0 1px 4px #000; }
.field input { width: 100%; height: 42px; border: 2px solid transparent; border-radius: 999px; padding: 0 18px; color: #141620; background: rgba(255,255,255,.97); outline: none; }
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246,196,18,.2); }
.field input.invalid { border-color: var(--danger); }
.error { display: block; margin: 3px 8px 0; color: #ff9b9f; font-size: 11px; min-height: 0; }
.error:not(:empty) { min-height: 14px; }
.form-message { min-height: 18px; margin: 4px 0; color: #ffb0b3; text-align: center; font-size: 12px; }
.form-actions { display: flex; justify-content: space-between; gap: 18px; padding: 4px 2px 0; }
.action-button { width: min(43%, 142px); }

.success-card { width: min(100%, 390px); padding: 15px 18px; text-align: center; color: #fff; background: rgba(2,3,10,.88); border: 1px solid rgba(246,196,18,.55); border-radius: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.screen--thankyou .success-card { display: none; }
.success-qr { width: 132px; height: 132px; padding: 7px; background: #fff; border-radius: 12px; }
.success-card p { margin: 8px 0; font-weight: 700; }
.success-card small { display: block; margin-top: 8px; line-height: 1.5; color: #d4d4d8; }
.personal-link { display: inline-block; color: var(--gold); font-weight: 700; }

/* Landscape devices use the full-width artwork. */
@media (orientation: landscape) {
  .screen--welcome { background-image: url("../assets/movie-desktop-welcome.jpg"); padding-top: min(63vh, 35.4375vw); }
  .screen--form { background-image: url("../assets/movie-desktop-form.jpg"); align-items: center; padding: 5vh 20px 4vh; }
  .screen--thankyou { background-image: url("../assets/movie-desktop-thankyou.jpg"); padding-bottom: 4vh; }
  .register-button { width: clamp(220px, 25vw, 300px); }
  .movie-form { width: min(28vw, 380px); margin-top: 2vh; padding: 15px 18px 12px; transform: translateY(10vh); }
  .field { margin-bottom: 7px; }
  .field input { height: 36px; }
  .success-card { margin-left: auto; margin-right: 4vw; width: 330px; }
}

/* Phones in landscape need a compact, scrollable form. */
@media (max-width: 999px) and (orientation: landscape) {
  .screen--form { align-items: flex-start; padding: clamp(140px, 38vh, 190px) 16px 32px; }
  .movie-form { width: min(78vw, 430px); margin-top: 0; padding: 12px 16px 11px; transform: none; }
  .field { margin-bottom: 5px; }
  .field label { margin-bottom: 3px; font-size: 13px; }
  .field input { height: 34px; padding: 0 15px; }
  .form-actions { margin-top: 10px; }
  .action-button { height: 42px; font-size: 19px; }
}

/* Portrait tablets: viewport shape is authoritative because desktop is landscape-only. */
@media (min-width: 700px) and (max-width: 1100px) and (orientation: portrait) {
  .screen {
    background-size: 100% 100%;
    background-position: center center;
  }
  .screen--welcome { background-image: url("../assets/movie-ipad-portrait-welcome.jpg"); }
  .screen--form { background-image: url("../assets/movie-ipad-portrait-form.jpg"); }
  .screen--thankyou { background-image: url("../assets/movie-ipad-portrait-thankyou.jpg"); }
  .screen--welcome { padding-top: min(68vh, 147.2vw); }
  .screen--form { padding: 46vh 32px 70px; }
  .register-button { width: clamp(270px, 36vw, 320px); }
  .movie-form { width: min(58vw, 460px); padding: 22px 22px 18px; }
  .field { margin-bottom: 12px; }
  .field input { height: 44px; }
}

/* iPad Mini through iPad Pro in landscape. */
@media (min-width: 1000px) and (max-width: 1366px) and (orientation: landscape) {
  html[data-device="ipad"] .screen {
    background-size: 100% 100%;
    background-position: center center;
  }
  html[data-device="ipad"] .screen--welcome { background-image: url("../assets/movie-ipad-landscape-welcome.jpg"); }
  html[data-device="ipad"] .screen--form { background-image: url("../assets/movie-ipad-landscape-form.jpg"); }
  html[data-device="ipad"] .screen--thankyou { background-image: url("../assets/movie-ipad-landscape-thankyou.jpg"); }
  html[data-device="ipad"] .screen--welcome { padding-top: min(68vh, 42vw); }
  html[data-device="ipad"] .screen--form { align-items: flex-start; padding: min(42vh, 26vw) 24px 48px; }
  html[data-device="ipad"] .register-button { width: clamp(280px, 25vw, 330px); }
  html[data-device="ipad"] .movie-form { width: clamp(380px, 42vw, 460px); margin-top: 0; padding: 16px 18px 14px; transform: none; }
  html[data-device="ipad"] .field { margin-bottom: 8px; }
  html[data-device="ipad"] .field input { height: 38px; }
}

/* Desktop only: device classification keeps this separate from equal-sized iPads. */
@media (min-width: 1024px) and (orientation: landscape) {
  html[data-device="pc"] .register-button { width: clamp(300px, 18vw, 350px); }
  html[data-device="pc"] .movie-form {
    width: clamp(480px, 32vw, 720px);
    padding: clamp(18px, 1.6vh, 24px) clamp(20px, 1.6vw, 28px);
    transform: translateY(13vh);
  }
  html[data-device="pc"] .field { margin-bottom: clamp(8px, 1vh, 12px); }
  html[data-device="pc"] .field label { margin-bottom: 5px; font-size: clamp(14px, .85vw, 17px); }
  html[data-device="pc"] .field input { height: clamp(48px, 4.5vh, 58px); padding: 0 20px; font-size: 16px; }
  html[data-device="pc"] .form-message { min-height: 18px; margin: 4px 0; font-size: 13px; }
  html[data-device="pc"] .form-actions { gap: 24px; padding-top: 6px; }
  html[data-device="pc"] .action-button { width: min(41%, 180px); }
}

/* Keep the enlarged desktop form fully visible on short laptop displays. */
@media (min-width: 1024px) and (max-height: 850px) and (orientation: landscape) {
  html[data-device="pc"] .movie-form {
    width: clamp(460px, 32vw, 560px);
    padding: 14px 20px;
    transform: translateY(10vh);
  }
  html[data-device="pc"] .field { margin-bottom: 6px; }
  html[data-device="pc"] .field label { margin-bottom: 3px; font-size: 13px; }
  html[data-device="pc"] .field input { height: 44px; padding: 0 18px; font-size: 15px; }
  html[data-device="pc"] .form-message { min-height: 16px; margin: 3px 0; font-size: 12px; }
  html[data-device="pc"] .form-actions { gap: 20px; padding-top: 4px; }
  html[data-device="pc"] .action-button { width: min(41%, 160px); }
}

@media (max-width: 699px) and (max-height: 740px) and (orientation: portrait) {
  .screen--form { padding-top: 43vh; }
  .movie-form { padding-top: 14px; }
  .field { margin-bottom: 7px; }
  .field input { height: 38px; }
}

@media (max-width: 360px) and (orientation: portrait) {
  .screen--form { padding-right: 14px; padding-left: 14px; }
  .movie-form { padding-right: 14px; padding-left: 14px; }
  .action-button { width: 46%; }
}

@keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .screen.is-active { animation: none; } .art-button { transition: none; } }
