/* ============================================================
   GLOBÁLNÍ POZADÍ (Z MAIN PAGE)
   ============================================================ */
html, body {
  overflow-x: hidden;
}

body {
  background-image: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.85)),
                    url('image (1).png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: #fff;
  margin: 0;
  font-family: 'Rubik', sans-serif;
}

/* ============================================================
   REZERVA PRO XP BAR & AKTIVNÍ NAVBAR
   ============================================================ */
.xp-bar-placeholder {
  width: 100%;
  height: 25px;
  background: transparent;
  position: relative;
  z-index: 999;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1050 !important;
}

.navbar__link.active {
  color: var(--c-accent);
}
.navbar__link.active::after {
  transform: translateX(-50%) scaleX(1);
  background: var(--c-accent);
}

/* ============================================================
   HERO SEKCE FORMULÁŘ
   ============================================================ */
.formular-hero {
  padding-top: calc(var(--nav-h) + 60px);
  padding-bottom: 30px;
  text-align: center;
  position: relative;
}

.formular-title {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(120deg, #fff 30%, var(--c-accent-h) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.formular-subtitle {
  max-width: 640px;
  margin: 0 auto;
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: var(--c-text-muted);
  line-height: 1.6;
}

/* ============================================================
   FORMULÁŘ SEKCE
   ============================================================ */
.formular-section {
  padding: 20px 0 90px;
}

/* ------ Obálka pro vložený Google Form ------ */
.formular-embed {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  background: var(--c-bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  /* Pevná rozumná výška – formulář se scrolluje UVNITŘ boxu, takže box
     nezabírá celou stránku a po přepnutí stránky netrčí prázdné místo. */
  height: 78vh;
  min-height: 520px;
  max-height: 860px;
}

.formular-embed iframe {
  display: block;
  width: 100%;
  height: 100%;         /* vyplní box; vlastní obsah formuláře se scrolluje */
  border: 0;
  background: transparent;
}

/* ------ Loader, dokud se iframe nenačte ------ */
.formular-embed__loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--c-text-muted);
  font-size: 1rem;
  background: var(--c-bg-card);
  z-index: 1;
}

.formular-embed__loader i {
  font-size: 1.8rem;
  color: var(--c-accent-h);
}

/* ------ Záložní "Odeslal jsem formulář" tlačítko ------ */
.formular-done {
  max-width: 760px;
  margin: 26px auto 0;
  text-align: center;
}

.formular-done__text {
  color: var(--c-text-dim);
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.formular-done__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 26px;
  background: #5865F2;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
  transition: background var(--tr), transform var(--tr), box-shadow var(--tr);
}
.formular-done__btn:hover {
  background: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(88, 101, 242, 0.55);
}

/* ------ Poznámka pod formulářem ------ */
.formular-note {
  max-width: 760px;
  margin: 22px auto 0;
  text-align: center;
  color: var(--c-text-dim);
  font-size: 0.92rem;
}

.formular-link {
  color: var(--c-accent-h);
  font-weight: 600;
  transition: color var(--tr);
}

.formular-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* ============================================================
   MODAL PO ODESLÁNÍ – DISCORD POZVÁNKA
   ============================================================ */
.discord-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s 0.35s;
}

.discord-modal.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease;
}

.discord-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.discord-modal__box {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1;
  /* Pevná velikost v px; JS counter-scale → stejná fyzická velikost při
     zoomu. Centrování přes translate(-50%,-50%) nezávislé na velikosti. */
  width: 420px;
  max-height: var(--box-maxh, 760px);
  overflow-y: auto;
  text-align: center;
  background: var(--c-bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid #5865F2;          /* Discord blurple */
  border-radius: var(--radius);
  padding: 30px 28px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(88, 101, 242, 0.25);

  --inv-zoom: 1;
  --enter: 0.92;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(calc(var(--inv-zoom) * var(--enter)));
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.discord-modal.is-open .discord-modal__box {
  --enter: 1;
}

.discord-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--c-text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--tr), transform var(--tr);
}
.discord-modal__close:hover {
  color: #fff;
  transform: scale(1.1);
}

.discord-modal__icon {
  /* Zmenší se na nízké obrazovce (zoom). */
  width: clamp(44px, 9vh, 64px);
  height: clamp(44px, 9vh, 64px);
  margin: 0 auto clamp(8px, 2vh, 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(88, 101, 242, 0.15);
  border: 1px solid rgba(88, 101, 242, 0.4);
  font-size: clamp(1.2rem, 4vh, 1.8rem);
  color: #5865F2;
}

.discord-modal__title {
  font-size: clamp(1.3rem, 3.5vh, 1.8rem);
  font-weight: 800;
  margin-bottom: 10px;
}

.discord-modal__text {
  color: var(--c-text-muted);
  line-height: 1.55;
  font-size: clamp(0.85rem, 2vh, 0.95rem);
  margin-bottom: clamp(12px, 2.5vh, 22px);
}

.discord-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: clamp(9px, 1.6vh, 13px) 20px;
  margin-bottom: clamp(12px, 2.5vh, 22px);
  background: #5865F2;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
  transition: background var(--tr), transform var(--tr), box-shadow var(--tr);
}
.discord-modal__btn:hover {
  background: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(88, 101, 242, 0.55);
}

.discord-modal__widget {
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.discord-modal__widget iframe {
  display: block;
  width: 100%;
  /* Přepíše pevné height="400" v HTML – výrazně se zmenší na nízké obrazovce,
     aby se celý popup vešel bez scrollbaru. */
  height: clamp(180px, 38vh, 400px) !important;
  border: 0;
}

/* ============================================================
   RESPONZIVITA
   ============================================================ */
@media (max-width: 600px) {
  /* Na mobilu dáme boxu víc výšky, ať se vejde víc otázek najednou. */
  .formular-embed {
    height: 82vh;
    max-height: none;
  }

  /* Discord popup – skoro celá šířka, scroll uvnitř když je moc vysoký. */
  .discord-modal { padding: 12px; }
  .discord-modal__box {
    width: min(92vw, 380px);
    max-height: calc(100svh - 1.5rem);
    max-height: calc(100vh - 1.5rem);
    padding: 24px 18px 20px;
  }
}
