/* ================================================================
   LOGOWANIE / REJESTRACJA — karta auth w stylu Trellus
   ================================================================ */

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

/* ── TŁO SEKCJI ── */
.panel-bg--auth {
  background:
    radial-gradient(ellipse 60% 55% at 78% 25%, rgba(183,63,255,0.18) 0%, transparent 68%),
    radial-gradient(ellipse 45% 55% at 15% 85%, rgba(61,244,255,0.14) 0%, transparent 62%),
    linear-gradient(180deg, #07050f 0%, #05040b 100%);
}

/* ── LAYOUT ── */
.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
}

.auth-glow-orb {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 640px; height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(183,63,255,0.14) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ══════════════════════════════════════════
   KARTA
══════════════════════════════════════════ */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 2.5rem 2.25rem;
  border-radius: 24px;
  background: rgba(10, 8, 20, 0.72);
  border: 1px solid rgba(255,255,255,0.09);
  backdrop-filter: blur(22px);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.45),
    0 0 0 1px rgba(183,63,255,0.06) inset,
    0 0 60px rgba(61,244,255,0.05);
}

/* subtelny gradientowy top-border */
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(61,244,255,0.5), rgba(183,63,255,0.35), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

/* ── NAGŁÓWEK ── */
.auth-head {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin: 0 auto 0.9rem;
  filter: drop-shadow(0 0 18px rgba(183,63,255,0.5));
}

.auth-head .eyebrow { margin-bottom: 0.5rem; }

.auth-title {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  font-weight: 900;
  line-height: 1.15;
  color: #f5f6ff;
}

.auth-subtitle {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ══════════════════════════════════════════
   ZAKŁADKI
══════════════════════════════════════════ */
.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.auth-tab {
  position: relative;
  z-index: 1;
  padding: 0.65rem 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  transition: color 0.25s;
}

.auth-tab.active { color: #07070d; }

.auth-tab-indicator {
  position: absolute;
  z-index: 0;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 10px;
  background: var(--grad);
  box-shadow: 0 6px 20px rgba(61,244,255,0.25);
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
}

.auth-tabs[data-active="register"] .auth-tab-indicator {
  transform: translateX(100%);
}

/* ══════════════════════════════════════════
   FORMULARZE
══════════════════════════════════════════ */
.auth-form { display: none; flex-direction: column; gap: 1rem; }
.auth-form.active { display: flex; animation: auth-fade 0.4s ease; }

@keyframes auth-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-field { display: flex; flex-direction: column; gap: 0.4rem; }

.auth-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #c8caff;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 0.9rem;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.2s;
}

.auth-input-wrap input {
  width: 100%;
  padding: 0.8rem 0.9rem 0.8rem 2.7rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 0.92rem;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-input-wrap input::placeholder { color: #55587c; }

.auth-input-wrap input:focus {
  outline: none;
  border-color: rgba(61,244,255,0.55);
  background: rgba(61,244,255,0.04);
  box-shadow: 0 0 0 3px rgba(61,244,255,0.12);
}

.auth-input-wrap input:focus + .auth-toggle-pass,
.auth-input-wrap input:focus ~ .auth-input-icon { color: var(--cyan); }

.auth-field.has-error .auth-input-wrap input {
  border-color: rgba(255,80,120,0.6);
  box-shadow: 0 0 0 3px rgba(255,80,120,0.1);
}

.auth-toggle-pass {
  position: absolute;
  right: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.auth-toggle-pass svg { width: 18px; height: 18px; }
.auth-toggle-pass:hover { color: var(--cyan); background: rgba(61,244,255,0.08); }

.auth-error {
  font-size: 0.76rem;
  color: #ff6b8a;
  min-height: 0;
  line-height: 1.3;
}
.auth-field.has-error .auth-error { min-height: 1rem; }

/* ── wiersz: zapamiętaj + zapomniałem ── */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: -0.25rem;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.auth-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.auth-check input:checked {
  background: var(--grad);
  border-color: transparent;
}

.auth-check input:checked::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #07070d;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-check--terms { margin-top: 0.15rem; align-items: flex-start; }
.auth-check--terms input { margin-top: 1px; }

.auth-link-mini {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}
.auth-link-mini:hover { color: var(--pink); }

.auth-submit {
  justify-content: center;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem;
}

.auth-submit.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

.auth-switch {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ── siła hasła ── */
.auth-strength {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: -0.1rem;
}

.auth-strength-bar {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.auth-strength-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.3s, background 0.3s;
}

.auth-strength-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 58px;
  text-align: right;
}

.auth-strength[data-level="1"] i { width: 33%;  background: #ff5f7a; }
.auth-strength[data-level="2"] i { width: 66%;  background: #ffb347; }
.auth-strength[data-level="3"] i { width: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); }

/* ── alert ── */
.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 1.25rem;
}
.auth-alert--error {
  background: rgba(255,80,120,0.1);
  border: 1px solid rgba(255,80,120,0.3);
  color: #ff8fa6;
}
.auth-alert--success {
  background: rgba(61,244,255,0.1);
  border: 1px solid rgba(61,244,255,0.3);
  color: var(--cyan);
}

/* ══════════════════════════════════════════
   WIDOK ZALOGOWANO
══════════════════════════════════════════ */
.auth-logged {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  animation: auth-fade 0.4s ease;
}
.auth-logged.active { display: flex; }

/* ukryj zakładki i podtytuł, gdy użytkownik jest zalogowany
   albo czeka na potwierdzenie maila */
.auth-card.is-logged .auth-tabs,
.auth-card.is-logged .auth-subtitle,
.auth-card.is-pending .auth-tabs,
.auth-card.is-pending .auth-subtitle { display: none; }

/* zapas na przyklejony nagłówek, gdy JS przewija do karty
   (patrz scrollToCard w auth.js) */
.auth-card { scroll-margin-top: 88px; }

/* ══════════════════════════════════════════
   WIDOK: CZEKAMY NA POTWIERDZENIE MAILA
══════════════════════════════════════════ */
.auth-pending {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  animation: auth-fade 0.4s ease;
}
.auth-pending.active { display: flex; }

.auth-mail-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  background: rgba(61,244,255,0.08);
  border: 1px solid rgba(61,244,255,0.25);
  box-shadow: 0 10px 30px rgba(61,244,255,0.18);
}
.auth-mail-icon svg { width: 34px; height: 34px; }

.auth-pending-email {
  font-family: "Orbitron", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cyan);
  word-break: break-all;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  background: rgba(61,244,255,0.06);
  border: 1px solid rgba(61,244,255,0.18);
}

.auth-pending-hint {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 340px;
}

.auth-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Orbitron", sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: #07070d;
  background: var(--grad);
  box-shadow: 0 10px 30px rgba(183,63,255,0.35);
  text-transform: uppercase;
}

.auth-welcome {
  font-family: "Orbitron", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #f5f6ff;
}

.auth-logged-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 320px;
}

.auth-logged-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ── nota ── */
.auth-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.72rem;
  color: #4a4d70;
  line-height: 1.5;
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 480px) {
  .auth-card { padding: 2rem 1.4rem; }
  .auth-title { font-size: 1.5rem; }
  .auth-logged-actions { flex-direction: column; width: 100%; }
  .auth-logged-actions .btn { width: 100%; justify-content: center; }
}
