/* ── Personality Archetype Quiz — celestial tarot deck ──────────────
   Near-black violet night with twinkling gold stars, engraved serif
   with star arch, gilded option cards with nouveau filigree, moon
   phase progress, flipping tarot result card with gold double border. */

:root {
  --night: #16101f;
  --night-deep: #0d0a14;
  --veil: #211831;
  --gold: #d4af5c;
  --gold-bright: #ecc978;
  --gold-dim: rgba(212, 175, 92, 0.35);
  --moon: #f4ecdb;
  --mist: #a99cc0;
  --err: #e0796b;
  --serif: 'Cormorant Garamond', serif;
  --sans: 'Outfit', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--moon);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background: radial-gradient(ellipse at 50% -10%, #2a1e3f, var(--night) 55%, var(--night-deep));
  background-attachment: fixed;
  min-height: 100vh;
}

.night { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* twinkling stars */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, var(--gold-bright), transparent),
    radial-gradient(1px 1px at 34% 8%, var(--moon), transparent),
    radial-gradient(1.5px 1.5px at 56% 30%, var(--gold), transparent),
    radial-gradient(1px 1px at 78% 12%, var(--moon), transparent),
    radial-gradient(1.5px 1.5px at 90% 42%, var(--gold-bright), transparent),
    radial-gradient(1px 1px at 8% 64%, var(--moon), transparent),
    radial-gradient(1.5px 1.5px at 28% 84%, var(--gold), transparent),
    radial-gradient(1px 1px at 66% 74%, var(--moon), transparent),
    radial-gradient(1.5px 1.5px at 84% 88%, var(--gold-bright), transparent);
  animation: twinkle 4.5s ease-in-out infinite alternate;
}

@keyframes twinkle { from { opacity: 0.45; } to { opacity: 1; } }

.wrap { width: 100%; max-width: 600px; margin: 0 auto; padding: 0 24px; }

main { flex: 1 0 auto; padding-bottom: 60px; position: relative; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { position: relative; text-align: center; padding: 52px 24px 8px; }

.star-arch { width: 200px; height: 44px; color: var(--gold); }

.kicker {
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 12px 0 12px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 8vw, 3.3rem);
  line-height: 1.1;
  color: var(--moon);
}

.hero h1 em { font-style: italic; color: var(--gold-bright); }

.sub { color: var(--mist); max-width: 420px; margin: 14px auto 0; }

/* ── Veil card ────────────────────────────────────────────────────── */
.veil {
  background: rgba(33, 24, 49, 0.75);
  border: 1px solid var(--gold-dim);
  border-radius: 18px;
  padding: 30px 30px 28px;
  margin-top: 30px;
  backdrop-filter: blur(4px);
}

/* moon phases */
.moons { display: flex; justify-content: center; gap: 12px; margin-bottom: 26px; }

.moon-ph {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  position: relative;
  overflow: hidden;
  opacity: 0.45;
  transition: all 0.3s ease;
}

.moon-ph::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--fill, 0%);
  background: var(--gold);
  transition: width 0.3s ease;
}

.moon-ph.current { opacity: 1; box-shadow: 0 0 10px rgba(212, 175, 92, 0.5); }
.moon-ph.done { opacity: 0.9; }

/* question */
.q-text {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.3;
  text-align: center;
  margin-bottom: 22px;
  color: var(--moon);
}

.choices { display: grid; gap: 10px; }

.choice-btn {
  position: relative;
  width: 100%;
  text-align: center;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1rem;
  color: var(--moon);
  background: rgba(244, 236, 219, 0.04);
  border: 1px solid rgba(212, 175, 92, 0.28);
  border-radius: 12px;
  padding: 15px 20px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.choice-btn::before,
.choice-btn::after {
  content: '\2726';
  position: absolute;
  top: 6px;
  font-size: 0.6rem;
  color: transparent;
  transition: color 0.16s ease;
}

.choice-btn::before { left: 10px; }
.choice-btn::after { right: 10px; }

.choice-btn:hover:not(:disabled) { border-color: var(--gold); background: rgba(212, 175, 92, 0.08); }
.choice-btn:hover:not(:disabled)::before,
.choice-btn:hover:not(:disabled)::after { color: var(--gold-dim); }

.choice-btn.picked {
  border-color: var(--gold-bright);
  background: rgba(212, 175, 92, 0.16);
  box-shadow: 0 0 18px rgba(212, 175, 92, 0.25);
}

.choice-btn.picked::before,
.choice-btn.picked::after { color: var(--gold-bright); }

.choice-btn:disabled { cursor: default; }

/* ── Gate ─────────────────────────────────────────────────────────── */
.gate { text-align: center; }

.gate-glyph { font-size: 2rem; color: var(--gold-bright); margin-bottom: 8px; }

.gate h2 { font-family: var(--serif); font-weight: 600; font-size: 1.9rem; color: var(--moon); }

.lead { color: var(--mist); margin: 8px 0 22px; }

.field { margin-bottom: 16px; text-align: left; }

label {
  display: block;
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--gold);
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 13px 15px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--moon);
  background: rgba(244, 236, 219, 0.05);
  border: 1px solid rgba(212, 175, 92, 0.3);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}

input:focus { outline: none; border-color: var(--gold-bright); }
input.error { border-color: var(--err); }
input::placeholder { color: rgba(169, 156, 192, 0.5); }

/* ── Button ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--night-deep);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border: none;
  border-radius: 999px;
  padding: 16px 32px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
  box-shadow: 0 8px 24px rgba(212, 175, 92, 0.3);
}

.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(212, 175, 92, 0.42); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--moon); outline-offset: 3px; }

.btn-block { width: 100%; }

.form-error { color: var(--err); font-weight: 500; text-align: center; margin-top: 14px; }

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2.5px solid rgba(13, 10, 20, 0.3);
  border-top-color: var(--night-deep);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Tarot result ─────────────────────────────────────────────────── */
.tarot {
  perspective: 1200px;
  margin: 30px auto 0;
  max-width: 380px;
}

.tarot-border {
  background: linear-gradient(160deg, #241a37, #191128);
  border: 2px solid var(--gold);
  outline: 1px solid var(--gold-dim);
  outline-offset: 5px;
  border-radius: 16px;
  padding: 30px 26px 24px;
  text-align: center;
  animation: cardflip 0.9s ease both;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(212, 175, 92, 0.12);
}

@keyframes cardflip {
  from { transform: rotateY(90deg); opacity: 0; }
  to   { transform: rotateY(0deg); opacity: 1; }
}

.tarot-tag {
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.tarot-border h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--gold-bright);
  line-height: 1.15;
}

.tarot-art {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--gold-dim);
  margin: 16px 0 4px;
  display: block;
}

.tarot-desc { color: var(--mist); font-size: 0.95rem; margin-top: 12px; }

.tarot-numeral {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--gold);
  margin-top: 16px;
}

/* share */
.share-row { text-align: center; margin-top: 26px; }

.share-label {
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: 12px;
}

.share-btns { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.share-btn {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--gold-bright);
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 999px;
  padding: 9px 22px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.share-btn:hover { border-color: var(--gold-bright); background: rgba(212, 175, 92, 0.1); }

/* ── Footer ───────────────────────────────────────────────────────── */
.foot {
  position: relative;
  text-align: center;
  padding: 30px 20px;
  color: rgba(169, 156, 192, 0.5);
  font-size: 0.8rem;
}

#wbx-powered-by-slot { margin-top: 12px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .veil { padding: 24px 18px 22px; }
  .q-text { font-size: 1.28rem; }
}
