/* ═══════════════════════════════════════════════════════════════
   Betsy Schwartz — Event Raffle Form
   Tokens pulled from betsy-schwartz-site/src/styles/homepage.css
   Layout: landscape split (brand left, form right) with portrait fallback
   ═══════════════════════════════════════════════════════════════ */

:root {
  --indigo: #3B3480;
  --lavender: #6B5CA5;
  --sage: #4A8B6F;
  --coral: #E06B4F;
  --coral-hover: #C85A40;
  --wash: #EEEAF5;
  --wash-light: #F5F2FA;
  --white: #fff;
  --error: #C0392B;

  /* Banner-matched accents */
  --banner-teal: #2E7FA8;    /* for Betsy's cursive name (cerulean script) */
  --banner-violet: #6A3DA8;  /* for "Spiritual Tour Guide" tagline (purple) */

  --head: 'Bricolage Grotesque', sans-serif;
  --body: 'Quicksand', sans-serif;
  --script: 'Kaushan Script', cursive;

  --radius: 14px;
}

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

/* Force [hidden] to beat class-level display rules */
[hidden] { display: none !important; }

/* Visually-hidden utility — for screen-reader-only labels */
.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;
}

/* ─── Branded tooltips via [data-tooltip] ─────────────────────── */
/* Tooltip appears BELOW the element by default (top controls friendly).
   Add data-tooltip-pos="above" to flip it above. */

[data-tooltip] { position: relative; }

[data-tooltip]::after,
[data-tooltip]::before {
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 1000;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--indigo);
  color: #fff;
  font-family: var(--body, sans-serif);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.2px;
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 240px;
  width: max-content;
  white-space: normal;
  text-align: center;
  box-shadow: 0 6px 18px rgba(59, 52, 128, 0.28);
  text-transform: none;
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--indigo);
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus::after,
[data-tooltip]:focus::before,
[data-tooltip]:focus-within::after,
[data-tooltip]:focus-within::before {
  opacity: 1;
}

[data-tooltip-pos="above"]::after {
  top: auto;
  bottom: calc(100% + 10px);
}
[data-tooltip-pos="above"]::before {
  top: auto;
  bottom: calc(100% + 4px);
  border-bottom-color: transparent;
  border-top-color: var(--indigo);
}

/* Anchor tooltip to right edge (for buttons near viewport right) */
[data-tooltip-align="right"]::after {
  left: auto;
  right: 0;
  transform: none;
}
[data-tooltip-align="right"]::before {
  left: auto;
  right: 16px;
  transform: none;
}

/* Anchor tooltip to left edge */
[data-tooltip-align="left"]::after {
  left: 0;
  right: auto;
  transform: none;
}
[data-tooltip-align="left"]::before {
  left: 16px;
  right: auto;
  transform: none;
}

/* Disable tooltips on touch devices (no hover) — they also caused phantom
   horizontal overflow from the 240px-max pseudo-elements at narrow viewports. */
@media (hover: none), (max-width: 640px) {
  [data-tooltip]::after,
  [data-tooltip]::before {
    display: none !important;
  }
}

html, body { height: 100%; }

body {
  font-family: var(--body);
  color: var(--indigo);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;

  /* Watercolor sky — echoes Betsy's event banner */
  background:
    radial-gradient(ellipse 70% 50% at 18% 22%, rgba(176, 216, 232, 0.55), transparent 62%),
    radial-gradient(ellipse 60% 45% at 82% 28%, rgba(232, 180, 203, 0.45), transparent 62%),
    radial-gradient(ellipse 75% 55% at 50% 92%, rgba(200, 180, 230, 0.4), transparent 64%),
    radial-gradient(ellipse 40% 30% at 30% 70%, rgba(180, 220, 200, 0.28), transparent 60%),
    linear-gradient(180deg, #F8F4FB 0%, #EEEAF5 100%);
  background-attachment: fixed;
}

input, textarea, button { user-select: auto; }

/* ─── Stage ────────────────────────────────────────────────────── */
.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

/* ─── Card: 2-column landscape grid ────────────────────────────── */
.card {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border: 1px solid rgba(107, 92, 165, 0.14);
  border-radius: var(--radius);
  padding: 36px 48px;
  width: 100%;
  max-width: 920px;
  box-shadow: 0 14px 44px rgba(59, 52, 128, 0.12);

  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
  align-items: center;
}

/* ─── Brand column (left) ──────────────────────────────────────── */
.brand-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  padding-right: 8px;
}

/* Subtle vertical divider between columns */
.brand-col::after {
  content: '';
  position: absolute;
  right: -24px;
  top: 8%;
  bottom: 8%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(107, 92, 165, 0.25), transparent);
}

.logo-mark {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin-bottom: 14px;
}

.brand-name {
  font-family: var(--script);
  font-weight: 400;  /* Kaushan is naturally thick, single weight */
  font-size: 42px;
  line-height: 1.3;   /* Kaushan descenders (y, g, z) need headroom */
  color: var(--banner-teal);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.tagline {
  font-family: var(--head);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--banner-violet);
}

/* ─── Form column (right) ──────────────────────────────────────── */
.form-col {
  display: flex;
  flex-direction: column;
}

h1 {
  font-family: var(--head);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.15;
  color: var(--indigo);
  margin: 14px 0 6px;
  text-align: center;
}

/* Small decorative divider between brand block and heading */
h1::before {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  margin: 0 auto 14px;
  background: linear-gradient(90deg, transparent, rgba(107, 92, 165, 0.35), transparent);
}

.sub {
  color: var(--lavender);
  font-size: 14px;
  margin-bottom: 0;
  text-align: center;
}

/* ─── Fields ───────────────────────────────────────────────────── */
.field { margin-bottom: 12px; }

label, legend {
  display: block;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  color: var(--indigo);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.optional {
  color: var(--lavender);
  font-weight: 400;
  font-style: italic;
  margin-left: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  color: var(--indigo);
  background: var(--white);
  border: 1.5px solid rgba(107, 92, 165, 0.25);
  border-radius: 8px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(224, 107, 79, 0.15);
}

input::placeholder { color: rgba(107, 92, 165, 0.45); }

/* ─── Radio choice grid — 3-col landscape ─────────────────────── */
.choice { border: none; }

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.choice-btn {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--indigo);
  background: var(--white);
  border: 1.5px solid rgba(107, 92, 165, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s ease;
  margin: 0;
}

.choice-btn input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-btn:hover { border-color: var(--lavender); }

.choice-btn:has(input:checked) {
  border-color: var(--coral);
  background: rgba(224, 107, 79, 0.08);
  color: var(--coral-hover);
}

/* ─── Consent checkbox ─────────────────────────────────────────── */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--indigo);
  margin: 14px 0 14px;
  cursor: pointer;
}

.consent input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--coral);
  cursor: pointer;
}

/* ─── Error ────────────────────────────────────────────────────── */
.error {
  color: var(--error);
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 8px;
}
.error:empty { display: none; }

/* ─── Button ───────────────────────────────────────────────────── */
.btn {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px 28px;
  border: none;
  border-radius: 8px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: lowercase;
  cursor: pointer;
  transition: all .25s ease;
}

.btn-coral { background: var(--coral); color: var(--white); }

.btn-coral:hover:not(:disabled) {
  background: var(--coral-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(224, 107, 79, 0.3);
}

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

/* ─── Thank-you card: override grid to single column ───────────── */
.card.thank-you {
  grid-template-columns: 1fr;
  text-align: center;
  max-width: 560px;
  padding: 48px 56px;
}

.thank-you h1 {
  text-align: center;
  margin-bottom: 16px;
}

.thank-you p {
  color: var(--indigo);
  font-size: 16px;
  line-height: 1.55;
  margin-bottom: 12px;
}

.thank-you .signoff {
  color: var(--lavender);
  font-style: italic;
  margin-top: 20px;
}

/* ─── Compact height: browser windows with chrome eating vertical space ─── */
@media (max-height: 740px) and (min-width: 761px) {
  .stage { padding: 16px; }
  .card {
    padding: 22px 36px;
    gap: 28px;
    grid-template-columns: 280px 1fr;
  }
  .logo-mark { width: 112px; height: 112px; margin-bottom: 8px; }
  .brand-name { font-size: 36px; margin-bottom: 8px; }
  .tagline { font-size: 10px; letter-spacing: 3.5px; }
  h1 { font-size: 24px; margin: 10px 0 4px; }
  h1::before { margin-bottom: 10px; }
  .sub { font-size: 13px; }
  .field { margin-bottom: 9px; }
  label, legend { font-size: 12.5px; margin-bottom: 4px; }
  input[type="text"], input[type="email"], input[type="tel"] { min-height: 42px; padding: 8px 12px; }
  .choice-btn { min-height: 40px; padding: 5px 6px; font-size: 12px; }
  .consent { font-size: 12px; margin: 10px 0 10px; }
  .error { margin-bottom: 6px; }
  .btn { min-height: 46px; padding: 12px 24px; }
}

/* ─── Responsive: stack to portrait under 820px (covers tablets portrait) ─── */
@media (max-width: 820px) {
  .stage { padding: 20px; align-items: flex-start; }

  /* Allow scrolling on mobile/tablet — kiosk "no scroll" assumption only holds desktop */
  body { overflow: auto; user-select: auto; height: auto; min-height: 100vh; }
  html { height: auto; }

  .card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 28px;
    max-width: 480px;
  }

  .brand-col::after { display: none; }
  .brand-col { padding-right: 0; }

  .logo-mark { width: 100px; height: 100px; margin-bottom: 8px; }
  .brand-name { font-size: 36px; margin-bottom: 8px; }

  h1 { font-size: 24px; margin-top: 8px; text-align: center; }
  .sub { font-size: 14px; text-align: center; }

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

/* Phones */
@media (max-width: 480px) {
  .stage { padding: 14px; }
  .card { padding: 22px 20px; }
  .logo-mark { width: 88px; height: 88px; }
  .brand-name { font-size: 32px; }
  h1 { font-size: 22px; }
  .choices { grid-template-columns: 1fr; }
  .choice-btn { min-height: 48px; font-size: 14px; }  /* solid touch target */
  .btn { min-height: 52px; padding: 15px 22px; font-size: 15px; }  /* comfortable thumb target */
  .consent { font-size: 13px; line-height: 1.5; }
  .consent input { width: 22px; height: 22px; }  /* bigger checkbox tap area */
  /* Prevent iOS auto-zoom on focus — font must be 16px+ */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"] {
    font-size: 16px;
  }
}
