/* ============================================================
   AUTH PAGES — login / rejestracja / aktualnosci / zasady / regulamin / kontakt
   Nowoczesny design (od 28.0): glassmorphism, ciemne gradienty,
   subtelny gold accent. Topbar sticky z nawigacja hash-based.
   ============================================================ */

/* ----- ZMIENNE ----- */
:root {
  --auth-gold:        #d4a017;
  --auth-gold-soft:   #f0c850;
  --auth-gold-dim:    #b8860b;
  --auth-bg-0:        #0a0a14;
  --auth-bg-1:        #14101f;
  --auth-bg-2:        #1d1530;
  --auth-text:        #f0e0c0;
  --auth-text-dim:    rgba(240, 224, 192, 0.65);
  --auth-text-mute:   rgba(240, 224, 192, 0.42);
  --auth-glass-bg:    rgba(20, 16, 30, 0.55);
  --auth-glass-bord:  rgba(212, 160, 23, 0.18);
  --auth-glass-bord-h:rgba(212, 160, 23, 0.40);
  --auth-shadow:      0 24px 60px -20px rgba(0, 0, 0, 0.75);
  --auth-radius:      12px;
}

/* ----- BODY / BG ----- */
/* login.html ładuje też main.css, który locka html/body na height:100% +
   overflow:hidden (SPA gry — tam scrollują tylko wewnętrzne kontenery). Na
   stronie logowania chcemy NORMALNY scroll dokumentu (długie strony: Aktualności,
   Zasady). auth.css jest ładowany PO main.css i wyłącznie przez login.html, więc
   override html/body jest bezpieczny — nie dotyka gry ani panelu admina. */
html {
  height: auto;
  overflow: visible;
}
.auth-body {
  margin: 0;
  height: auto;
  min-height: 100vh;
  background: var(--auth-bg-0);
  color: var(--auth-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-y: auto;
  /* (54.9) Flex column — stopka przyklejona do dolu viewportu takze przy
     krotkiej tresci (wczesniej min-height na .auth-main niedoszacowywal
     wysokosci topbaru+stopki i stopka "odklejala sie" od dolu). */
  display: flex;
  flex-direction: column;
}

/* Tlo: animowane gradient blobs + radialny gradient dla glebi */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.auth-bg-grad {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(184, 134, 11, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 110%, rgba(140, 80, 200, 0.12) 0%, transparent 60%),
    linear-gradient(180deg, var(--auth-bg-0) 0%, var(--auth-bg-1) 40%, var(--auth-bg-2) 100%);
}
.auth-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: authBgPulse 14s ease-in-out infinite;
}
.auth-bg-glow-1 {
  width: 600px; height: 600px;
  top: -200px; left: -100px;
  background: radial-gradient(circle, var(--auth-gold-dim) 0%, transparent 70%);
}
.auth-bg-glow-2 {
  width: 700px; height: 700px;
  bottom: -250px; right: -150px;
  background: radial-gradient(circle, #6e3d9e 0%, transparent 70%);
  animation-delay: -7s;
}
@keyframes authBgPulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50%      { opacity: 0.5;  transform: scale(1.15); }
}

/* ----- TOPBAR ----- */
.auth-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 20, 0.75);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--auth-glass-bord);
}
.auth-topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.auth-logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--auth-text);
  line-height: 1.1;
  transition: opacity 0.2s ease;
}
.auth-logo:hover { opacity: 0.85; }
.auth-logo-name {
  font-family: 'Almendra', serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--auth-gold-soft) 0%, var(--auth-gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-logo-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--auth-text-mute);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px;
}
.auth-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.auth-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--auth-text-dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.3px;
}
.auth-nav-btn:hover {
  color: var(--auth-text);
  background: rgba(212, 160, 23, 0.08);
}
.auth-nav-btn.active {
  color: var(--auth-gold-soft);
  background: rgba(212, 160, 23, 0.12);
  border-color: var(--auth-glass-bord-h);
}

/* (55.3) Selektor jezyka w topbarze — natywny <select> byl calkiem bez
   stylu (bialy systemowy kwadrat na ciemnym tle). */
.auth-lang-select {
  background: rgba(0, 0, 0, 0.4);
  color: var(--auth-text);
  border: 1px solid var(--auth-glass-bord-h);
  border-radius: 8px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.auth-lang-select:hover,
.auth-lang-select:focus { outline: none; border-color: var(--auth-gold); }
.auth-lang-select option { background: #14101f; color: var(--auth-text); }

/* ----- MAIN / PAGES ----- */
.auth-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  width: 100%;
  flex: 1 0 auto; /* (54.9) wypelnia przestrzen — stopka zawsze na dole */
}
.auth-page { display: none; animation: authFade 0.35s ease; }
.auth-page.active { display: block; }
@keyframes authFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----- HERO (na login page) ----- */
.auth-hero {
  text-align: center;
  margin-bottom: 32px;
}
.auth-hero-title {
  font-family: 'Almendra', serif;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  margin: 0 0 8px;
  background: linear-gradient(135deg, #f0e0c0 0%, var(--auth-gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}
.auth-hero-sub {
  font-size: 15px;
  color: var(--auth-text-dim);
  margin: 0;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* ----- LOGIN PAGE — shell 2-column ----- */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  align-items: start;
  max-width: 880px;
  margin: 0 auto;
}
@media (max-width: 768px) {
  .auth-shell { grid-template-columns: 1fr; max-width: 460px; }
  .auth-side { order: -1; }
}

/* Aside / side-panel z grafika */
.auth-side {
  background: var(--auth-glass-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--auth-glass-bord);
  border-radius: var(--auth-radius);
  padding: 20px;
  box-shadow: var(--auth-shadow);
}
.auth-side-img {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(212, 160, 23, 0.12) 0%, rgba(110, 61, 158, 0.12) 100%),
    rgba(10, 10, 20, 0.5);
  border: 1px dashed var(--auth-glass-bord-h);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-text-mute);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.auth-side-title {
  font-family: 'Almendra', serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--auth-gold-soft);
}
.auth-side-text {
  font-size: 13px;
  color: var(--auth-text-dim);
  margin: 0;
}

/* ----- AUTH-TABS (login/register switch w login page) ----- */
.auth-tabs {
  display: flex;
  gap: 6px;
  background: rgba(10, 10, 20, 0.45);
  border: 1px solid var(--auth-glass-bord);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--auth-text-dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.auth-tab:hover { color: var(--auth-text); }
.auth-tab.active {
  background: linear-gradient(135deg, var(--auth-gold-dim) 0%, var(--auth-gold) 100%);
  color: #14101f;
  box-shadow: 0 4px 12px -4px rgba(212, 160, 23, 0.55);
}

/* ----- AUTH-CARD (glassmorphism) ----- */
.auth-card {
  background: var(--auth-glass-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--auth-glass-bord);
  border-radius: var(--auth-radius);
  padding: 28px 28px 24px;
  box-shadow: var(--auth-shadow);
}
.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }
.auth-h2 {
  font-family: 'Almendra', serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--auth-gold-soft);
  letter-spacing: 0.3px;
}
.auth-text {
  font-size: 14px;
  color: var(--auth-text-dim);
  margin: 0;
}
.auth-text strong { color: var(--auth-text); }
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.auth-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--auth-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.auth-input {
  font-family: inherit;
  font-size: 15px;
  background: rgba(10, 10, 20, 0.55);
  color: var(--auth-text);
  border: 1px solid var(--auth-glass-bord);
  border-radius: 8px;
  padding: 11px 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.auth-input::placeholder { color: var(--auth-text-mute); }
.auth-input:focus {
  outline: none;
  border-color: var(--auth-gold);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.18);
}
.auth-input:invalid:not(:placeholder-shown) {
  border-color: #d04040;
}
.auth-hint {
  font-size: 12px;
  color: var(--auth-text-mute);
  margin-top: 2px;
}

/* ----- CHECKBOX (Remember-me) ----- */
.auth-checkbox-row {
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.auth-checkbox-input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--auth-gold);
  margin: 0;
}
.auth-checkbox-label {
  font-size: 14px;
  color: var(--auth-text-dim);
  user-select: none;
}

/* ----- 6-DIGIT CODE BOXES ----- */
.auth-code {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 4px 0;
}
.auth-code-cell {
  width: 44px;
  height: 54px;
  text-align: center;
  font-family: 'Almendra', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--auth-text);
  background: rgba(10, 10, 20, 0.55);
  border: 1px solid var(--auth-glass-bord);
  border-radius: 8px;
  transition: all 0.18s ease;
}
.auth-code-cell:focus {
  outline: none;
  border-color: var(--auth-gold);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.22);
}
.auth-code-cell.filled {
  background: rgba(212, 160, 23, 0.10);
  border-color: var(--auth-glass-bord-h);
}
.auth-code-cell.shake {
  animation: authShake 0.35s ease;
}
@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* ----- BUTTONS ----- */
.auth-btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.3px;
  border: 0;
}
.auth-btn-primary {
  background: linear-gradient(135deg, var(--auth-gold-dim) 0%, var(--auth-gold) 100%);
  color: #14101f;
  box-shadow: 0 6px 18px -6px rgba(212, 160, 23, 0.5);
}
.auth-btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.auth-btn-primary:active { transform: translateY(0); }
.auth-btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none !important;
  box-shadow: none;
}

/* ----- LINKS / FOOT ----- */
.auth-foot {
  text-align: center;
  font-size: 13px;
  color: var(--auth-text-dim);
  margin: 4px 0 0;
}
.auth-link {
  background: transparent;
  border: 0;
  color: var(--auth-gold-soft);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(240, 200, 80, 0.4);
  transition: color 0.18s ease;
}
.auth-link:hover {
  color: var(--auth-gold);
  text-decoration-color: var(--auth-gold);
}
.auth-cooldown {
  display: inline-block;
  margin-left: 6px;
  color: var(--auth-text-mute);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ----- MESSAGES ----- */
.auth-msg {
  min-height: 18px;
  font-size: 13px;
  border-radius: 8px;
  padding: 0;
}
.auth-msg:not(:empty) {
  padding: 9px 12px;
}
.auth-msg.error {
  background: rgba(208, 64, 64, 0.12);
  color: #ff8a8a;
  border: 1px solid rgba(208, 64, 64, 0.35);
}
.auth-msg.ok {
  background: rgba(76, 175, 80, 0.10);
  color: #8de094;
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.auth-msg.info {
  background: rgba(212, 160, 23, 0.10);
  color: var(--auth-gold-soft);
  border: 1px solid var(--auth-glass-bord-h);
}

/* ============================================================
   CONTENT PAGES (News / Rules / TOS / Contact)
   ============================================================ */
.auth-content {
  max-width: 720px;
  margin: 0 auto;
  background: var(--auth-glass-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--auth-glass-bord);
  border-radius: var(--auth-radius);
  padding: 32px;
  box-shadow: var(--auth-shadow);
}
.auth-content-wide { max-width: 1040px; }
.auth-content-head {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--auth-glass-bord);
}
.auth-content-title {
  font-family: 'Almendra', serif;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  margin: 0 0 6px;
  background: linear-gradient(135deg, #f0e0c0 0%, var(--auth-gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-content-sub {
  color: var(--auth-text-dim);
  font-size: 14px;
  margin: 0;
}

/* ----- NEWS ----- */
.auth-news-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.auth-news-loading {
  text-align: center;
  color: var(--auth-text-mute);
  font-style: italic;
  padding: 40px 0;
}
.auth-news-session {
  background: rgba(10, 10, 20, 0.35);
  border: 1px solid var(--auth-glass-bord);
  border-radius: 10px;
  padding: 18px 20px;
  transition: border-color 0.2s ease;
}
.auth-news-session:hover { border-color: var(--auth-glass-bord-h); }
.auth-news-session-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--auth-glass-bord);
}
.auth-news-session-title {
  font-family: 'Almendra', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--auth-gold-soft);
  margin: 0;
}
.auth-news-session-date {
  font-size: 12px;
  color: var(--auth-text-mute);
  font-variant-numeric: tabular-nums;
}
.auth-news-entry {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 6px 0;
}
.auth-news-badge {
  flex-shrink: 0;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  min-width: 56px;
  text-align: center;
}
.auth-news-badge-new       { background: rgba(76, 175, 80, 0.15); color: #8de094; border: 1px solid rgba(76, 175, 80, 0.4); }
.auth-news-badge-ux        { background: rgba(110, 130, 200, 0.15); color: #9caedf; border: 1px solid rgba(110, 130, 200, 0.4); }
.auth-news-badge-fix-major { background: rgba(208, 80, 60, 0.15); color: #ff8a78; border: 1px solid rgba(208, 80, 60, 0.4); }
.auth-news-badge-fix-minor { background: rgba(180, 130, 60, 0.15); color: #e6c080; border: 1px solid rgba(180, 130, 60, 0.4); }
.auth-news-badge-balans    { background: rgba(140, 80, 180, 0.15); color: #c8a0e0; border: 1px solid rgba(140, 80, 180, 0.4); }
.auth-news-entry-text {
  font-size: 14px;
  color: var(--auth-text);
  line-height: 1.55;
}

/* ----- RULES (grid sekcji) ----- */
.auth-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.auth-rules-section {
  background: rgba(10, 10, 20, 0.35);
  border: 1px solid var(--auth-glass-bord);
  border-radius: 10px;
  padding: 20px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.auth-rules-section:hover {
  border-color: var(--auth-glass-bord-h);
  transform: translateY(-2px);
}
.auth-rules-section h2 {
  font-family: 'Almendra', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--auth-gold-soft);
  margin: 0 0 10px;
}
.auth-rules-section p {
  font-size: 14px;
  color: var(--auth-text-dim);
  margin: 0;
  line-height: 1.6;
}
.auth-rules-img {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(212, 160, 23, 0.10) 0%, rgba(110, 61, 158, 0.10) 100%),
    rgba(10, 10, 20, 0.5);
  border: 1px dashed var(--auth-glass-bord-h);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-text-mute);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ----- PLACEHOLDER (TOS / CONTACT empty pages) ----- */
.auth-placeholder {
  text-align: center;
  padding: 40px 20px;
}
.auth-placeholder-img {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 16 / 9;
  margin: 0 auto 24px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(212, 160, 23, 0.10) 0%, rgba(110, 61, 158, 0.10) 100%),
    rgba(10, 10, 20, 0.5);
  border: 1px dashed var(--auth-glass-bord-h);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-text-mute);
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.auth-placeholder p {
  font-size: 15px;
  color: var(--auth-text-dim);
  margin: 0;
  font-style: italic;
}

/* ----- FOOTER ----- */
.auth-footer {
  border-top: 1px solid var(--auth-glass-bord);
  background: rgba(10, 10, 20, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.auth-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--auth-text-mute);
  text-align: center;
  flex-wrap: wrap;
}
.auth-footer-sep { opacity: 0.5; }

/* ----- RESPONSIVE ----- */
@media (max-width: 640px) {
  .auth-topbar-inner {
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
  }
  .auth-nav { width: 100%; justify-content: center; }
  .auth-nav-btn { font-size: 13px; padding: 7px 11px; }
  .auth-main { padding: 24px 14px 60px; }
  .auth-card { padding: 20px 18px; }
  .auth-content { padding: 24px 18px; }
  .auth-code-cell { width: 38px; height: 48px; font-size: 22px; }
}
