:root {
  --bg-top: #2a0a4a;
  --bg-bottom: #12002b;
  --gold: #f5c542;
  --gold-soft: #ffe08a;
  --text: #f4f0ff;
  --text-dim: #d9d0f2;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(245, 197, 66, 0.25);
  --card-hover: rgba(245, 197, 66, 0.14);
  --danger: #ff8a8a;
  --radius: 18px;
  --maxw: 560px;
  --font-head: "Playfair Display", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: radial-gradient(120% 100% at 50% 0%, var(--bg-top) 0%, var(--bg-bottom) 70%);
  background-attachment: fixed;
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Suptilni "stroke" na tekstu (blaga definicija na zvjezdanoj podlozi) ---------- */
.intro__title,
.loading__title,
.question {
  text-shadow: 0 0 1px rgba(6, 0, 18, 0.3), 0 1px 2px rgba(6, 0, 18, 0.4);
}
.intro__subtitle,
.form__subtitle,
.intro__list li,
.loading__status,
.thanks__ps {
  text-shadow: 0 1px 1px rgba(6, 0, 18, 0.26);
}
.intro__badge { text-shadow: 0 1px 1px rgba(6, 0, 18, 0.3); }

/* ---------- Zvjezdana pozadina ---------- */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.stars {
  position: absolute; inset: -50% 0;
  background-repeat: repeat;
  opacity: 0.7;
}
/* Tri sloja zvjezdica raznih veličina, generirane radial-gradientima */
.stars--1 {
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 120px 80px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 200px 160px, #fff, transparent),
    radial-gradient(1px 1px at 300px 50px, #fff, transparent);
  background-size: 340px 340px;
  animation: drift 140s linear infinite;
}
.stars--2 {
  background-image:
    radial-gradient(1.5px 1.5px at 60px 120px, var(--gold-soft), transparent),
    radial-gradient(1px 1px at 180px 40px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 260px 220px, #fff, transparent);
  background-size: 420px 420px;
  opacity: 0.5;
  animation: drift 90s linear infinite reverse;
}
.stars--3 {
  background-image:
    radial-gradient(2px 2px at 90px 200px, var(--gold), transparent),
    radial-gradient(1px 1px at 240px 90px, #fff, transparent);
  background-size: 520px 520px;
  opacity: 0.6;
  animation: twinkle 6s ease-in-out infinite alternate, drift 200s linear infinite;
}
.glow {
  position: absolute; left: 50%; top: -10%;
  width: 90vw; max-width: 700px; aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(245,197,66,0.16), transparent 60%);
  filter: blur(20px);
}

@keyframes drift { from { transform: translateY(0); } to { transform: translateY(60px); } }
@keyframes twinkle { from { opacity: 0.25; } to { opacity: 0.8; } }

@media (prefers-reduced-motion: reduce) {
  .stars, .glow { animation: none !important; }
}

/* ---------- Layout ---------- */
.app {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 5vw, 28px);
  padding-top: max(env(safe-area-inset-top), 18px);
}

/* ---------- Progress ---------- */
.progress { margin: 8px 0 22px; }
.progress__label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 8px;
}
.progress__track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  box-shadow: 0 0 12px rgba(245,197,66,0.6);
  transition: width 0.45s cubic-bezier(.22,1,.36,1);
}

/* ---------- Screens & transitions ---------- */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  justify-content: center;
}
.screen.is-active { display: flex; }
.screen.is-active .card-stack { animation: screenIn 0.42s cubic-bezier(.22,1,.36,1) both; }
.screen.is-leaving .card-stack { animation: screenOut 0.28s ease-in both; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(18px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes screenOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-14px); }
}
@media (prefers-reduced-motion: reduce) {
  .screen.is-active .card-stack, .screen.is-leaving .card-stack { animation: none; }
}

.card-stack { width: 100%; }

/* ---------- Intro ---------- */
.intro { text-align: center; }
.intro__badge {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 6px 16px;
  margin-bottom: 22px;
}
.intro__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.9rem, 7vw, 2.7rem);
  line-height: 1.15;
  margin-bottom: 16px;
}
.intro__subtitle, .form__subtitle {
  color: var(--text-dim);
  font-size: clamp(1.02rem, 3.8vw, 1.15rem);
  line-height: 1.62;
  margin-bottom: 28px;
  max-width: 44ch;
  margin-left: auto;
  margin-right: auto;
}
.intro__hint { color: var(--text-dim); font-size: 0.9rem; margin-top: 16px; opacity: 0.85; }

/* Tip ličnosti: kratak zlatni reveal ("Ti si ...") kao nagrada prije forme. */
.form__tip {
  color: var(--gold-soft);
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  line-height: 1.3;
  text-align: center;
  max-width: 46ch;
  margin: 0 auto 26px;
  padding: 18px 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}
.form__tip:empty { display: none; }

/* Lista "što ćeš saznati" na uvodnom ekranu */
.intro__list {
  list-style: none;
  text-align: left;
  max-width: 32ch;
  margin: 0 auto 22px;
  display: grid;
  gap: 12px;
}
.intro__list li {
  position: relative;
  padding-left: 30px;
  color: var(--text);
  font-size: clamp(1rem, 3.6vw, 1.08rem);
  line-height: 1.5;
}
.intro__list li::before {
  content: "✔";
  position: absolute;
  left: 0;
  top: 0.05em;
  color: var(--gold);
  font-weight: 700;
}
.intro__proof {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 42ch;
  margin: 0 auto 26px;
  opacity: 0.9;
}

/* ---------- Question ---------- */
.question {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.5rem, 5.5vw, 2.05rem);
  line-height: 1.28;
  text-align: center;
  margin-bottom: 26px;
}

/* ---------- Options ---------- */
.options { display: grid; gap: 12px; }
.options.is-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.option {
  appearance: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.14s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.option:hover { background: var(--card-hover); border-color: var(--gold); }
.option:active { transform: scale(0.98); }
.option.is-selected {
  background: var(--card-hover);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 8px 30px rgba(245,197,66,0.18);
}
.option__emoji { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.option__text { font-size: 1.02rem; font-weight: 500; }

/* Grid varijanta (horoskopski znakovi) */
.options.is-grid .option {
  flex-direction: column;
  gap: 8px;
  padding: 16px 8px;
  text-align: center;
  border-radius: 14px;
}
.options.is-grid .option__emoji { font-size: 1.8rem; }
.options.is-grid .option__text { font-size: 0.85rem; }
.options.is-grid .option__date {
  font-size: clamp(0.6rem, 2.3vw, 0.7rem);
  color: var(--text-dim);
  opacity: 0.72;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Široka opcija u gridu (npr. "Ne znam / nisam sigurna") — puni redak, vodoravno */
.options.is-grid .option--wide {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  padding: 15px 14px;
}
.options.is-grid .option--wide .option__emoji { font-size: 1.4rem; }
.options.is-grid .option--wide .option__text { font-size: 0.95rem; }

/* ---------- Tekstualni korak (unos imena) ---------- */
.text-step { display: grid; gap: 14px; }
.text-step__input {
  font: inherit;
  font-size: 1.1rem;
  text-align: center;
  color: var(--text);
  background: rgba(0, 0, 0, 0.25);
  border: 1.5px solid var(--card-border);
  border-radius: 14px;
  padding: 17px 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.text-step__input::placeholder { color: rgba(200, 188, 224, 0.5); }
.text-step__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.18);
}
.text-step__input.is-invalid { border-color: var(--danger); }
.text-step__skip { margin: 2px auto 0; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 16px 26px;
  width: 100%;
  transition: transform 0.14s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn--primary {
  color: #2a0a4a;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  box-shadow: 0 10px 30px rgba(245,197,66,0.35);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  position: relative;
}
.btn--primary:hover { box-shadow: 0 12px 38px rgba(245,197,66,0.5); }
.btn--primary:active { transform: translateY(1px) scale(0.99); }
.btn--primary:disabled { opacity: 0.7; cursor: default; }

/* Suptilni "disanje" glow na glavnom CTA gumbu (uvodni ekran) — nježno vuče klik */
#startBtn { animation: ctaGlow 2.6s ease-in-out infinite; }
#startBtn:hover { animation: none; }
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 10px 30px rgba(245,197,66,0.35); }
  50%      { box-shadow: 0 12px 42px rgba(245,197,66,0.62); }
}
@media (prefers-reduced-motion: reduce) {
  #startBtn { animation: none; }
}
.btn--ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
  width: auto;
  padding: 10px 4px;
  font-weight: 500;
}
.btn--ghost:hover { color: var(--gold-soft); }

.back-btn { margin: 20px auto 0; display: block; }

/* Spinner state na submit gumbu */
.btn__spinner {
  display: none;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(42,10,74,0.35);
  border-top-color: #2a0a4a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading .btn__label { visibility: hidden; }
.btn.is-loading .btn__spinner { display: block; position: absolute; inset: 0; margin: auto; }

/* ---------- Form ---------- */
#leadForm { display: grid; gap: 18px; text-align: left; }
.field { display: grid; gap: 7px; }
.field label { font-size: 0.9rem; font-weight: 600; color: var(--gold-soft); }
.field input {
  font: inherit;
  color: var(--text);
  background: rgba(0,0,0,0.25);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  padding: 15px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input::placeholder { color: rgba(200,188,224,0.5); }
.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,197,66,0.18);
}
.field input.is-invalid { border-color: var(--danger); }
.field__error {
  color: var(--danger);
  font-size: 0.82rem;
  min-height: 1em;
}
#consentError { margin-top: -8px; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 0.9rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1.45;
}
.consent input {
  width: 20px; height: 20px;
  margin-top: 2px;
  accent-color: var(--gold);
  flex-shrink: 0;
  cursor: pointer;
}

.form__error {
  color: var(--danger);
  text-align: center;
  font-size: 0.92rem;
  background: rgba(255,138,138,0.1);
  border: 1px solid rgba(255,138,138,0.3);
  border-radius: 12px;
  padding: 12px;
}

/* ---------- Thanks ---------- */
.thanks { text-align: center; }
.thanks__icon { font-size: 3.8rem; margin-bottom: 14px; animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.thanks__ps {
  color: var(--text-dim);
  font-size: clamp(0.98rem, 3.6vw, 1.06rem);
  line-height: 1.6;
  font-style: italic;
  max-width: 40ch;
  margin: 24px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.95;
}
.thanks__ps .persona-name { color: var(--gold-soft); font-style: normal; }

/* Success (hvala) ekran: veća i čitljivija slova */
.thanks .question {
  font-size: clamp(1.75rem, 7vw, 2.45rem);
  line-height: 1.25;
  margin-bottom: 16px;
}
.thanks .form__subtitle {
  color: var(--text);
  font-size: clamp(1.24rem, 5.2vw, 1.46rem);
  line-height: 1.55;
  max-width: 40ch;
}

/* Success (hvala): upozorenje o dostavi (Promotions/Spam) — istaknuto, veći font */
.thanks__alert {
  margin: 22px auto 0;
  max-width: 42ch;
  text-align: left;
  background: rgba(245, 197, 66, 0.10);
  border: 1px solid rgba(245, 197, 66, 0.45);
  border-radius: 16px;
  padding: 18px 20px;
}
.thanks__alert-title {
  margin: 0 0 10px;
  font-weight: 800;
  color: var(--gold-soft);
  font-size: clamp(1.26rem, 5.6vw, 1.52rem);
  letter-spacing: 0.02em;
}
.thanks__alert p {
  margin: 0 0 12px;
  color: var(--text);
  font-size: clamp(1.14rem, 4.9vw, 1.32rem);
  line-height: 1.55;
}
.thanks__alert p:last-child { margin-bottom: 0; }
.thanks__alert strong { color: var(--gold-soft); font-weight: 700; }

/* ---------- Loading (mapa ljubavi) ---------- */
.loading { text-align: center; }

.wheel {
  --size: min(240px, 62vw);
  position: relative;
  width: var(--size);
  height: var(--size);
  margin: 0 auto 32px;
  display: grid;
  place-items: center;
}
.wheel__halo {
  position: absolute; inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,197,66,0.24), transparent 62%);
  filter: blur(6px);
  animation: pulse 3s ease-in-out infinite;
}
.wheel__ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(245,197,66,0.35);
  box-shadow: inset 0 0 34px rgba(245,197,66,0.15);
}
/* unutarnji isprekidani prsten */
.wheel__ring::before {
  content: ""; position: absolute; inset: 15%;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.22);
  animation: spin 20s linear infinite;
}
/* zlatni luk koji se vrti (spinner) */
.wheel__ring::after {
  content: ""; position: absolute; inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--gold);
  filter: drop-shadow(0 0 6px var(--gold));
  animation: spin 1.5s linear infinite;
}
.wheel__glyphs {
  position: absolute; inset: 0;
  animation: spin 30s linear infinite;
}
.wheel__glyph {
  position: absolute; top: 50%; left: 50%;
  margin: -0.6em 0 0 -0.6em;
  width: 1.2em; height: 1.2em;
  display: grid; place-items: center;
  font-size: 1.05rem;
  color: var(--gold-soft);
  opacity: 0.85;
  transform:
    rotate(var(--a))
    translateY(calc(var(--size) * -0.4))
    rotate(calc(var(--a) * -1));
}
.wheel__core {
  position: relative;
  font-size: 1.9rem;
  color: var(--gold);
  filter: drop-shadow(0 0 10px rgba(245,197,66,0.85));
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.12); opacity: 1; }
}

.loading__title {
  font-family: var(--font-head);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: clamp(1.1rem, 4.6vw, 1.5rem);
  line-height: 1.4;
  color: var(--gold-soft);
  margin-bottom: 14px;
}
.loading__status {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.4;
  height: 2.8em; /* fiksna visina (do 2 retka) -> layout ne skače */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 22px;
  transition: opacity 0.25s ease;
  will-change: opacity;
}
.loading__status.is-fading { opacity: 0; }
.loading__track {
  height: 6px;
  max-width: 280px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
}
.loading__fill {
  height: 100%; width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  box-shadow: 0 0 12px rgba(245,197,66,0.6);
}

@media (prefers-reduced-motion: reduce) {
  .wheel__ring::before, .wheel__ring::after, .wheel__glyphs, .wheel__core, .wheel__halo {
    animation: none !important;
  }
}

/* ---------- Spol (prvi korak) ---------- */
.gender__q {
  text-align: center;
  color: var(--gold-soft);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.gender__hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 16px auto 0;
  max-width: 38ch;
  opacity: 0.85;
}

/* ---------- Kraj za muške korisnike ---------- */
.blocked { text-align: center; }
.blocked__line {
  color: var(--text);
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  line-height: 1.5;
  max-width: 38ch;
  margin: 0 auto 18px;
}
/* Glavna poruka "kviz nije za muškarce" — najveća i istaknuta. */
.blocked__line:first-of-type {
  color: var(--gold-soft);
  font-size: clamp(1.55rem, 6.4vw, 2rem);
  line-height: 1.32;
  margin-bottom: 22px;
}
.blocked__sign {
  font-family: var(--font-head);
  font-size: 1.35rem;
  color: var(--gold-soft);
  margin-top: 24px;
}

/* ---------- Footer ---------- */
.foot { text-align: center; padding: 22px 0 8px; }
.foot__link {
  color: var(--text-dim);
  font-size: 0.8rem;
  text-decoration: none;
  opacity: 0.6;
}
.foot__link:hover { opacity: 1; color: var(--gold-soft); }

/* Vrlo uski ekrani: znakovi u 2 stupca */
@media (max-width: 340px) {
  .options.is-grid { grid-template-columns: repeat(2, 1fr); }
}
