/* ============================================
   AUTH – styl nawigacji logowania + modala + profilu
   Jedno źródło dla strony głównej (link) i podstron (inline w build.js).
   Samowystarczalny: nie polega na zmiennych spoza obu arkuszy
   (--purple-dark / --ease są zapisane na sztywno).
   ============================================ */

/* nawigacja: marketing links (Oferta/FAQ/Kontakt) + Blog + logowanie */
.nav-right {
  justify-self: end;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  row-gap: 6px;
}
.nav-account {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Przycisk główny marki = atrament (Prymo). Złoto rezerwujemy dla sukcesu ucznia. */
.nav-auth-btn {
  display: inline-block;
  padding: 8px 15px;
  font-size: 0.844rem;
  font-weight: 600;
  color: var(--paper, #FBFAF7);
  background: var(--ink, #17143A);
  border: 1px solid transparent;
  border-radius: 9px;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-auth-btn:hover { background: #241F52; }
.nav-logout-btn {
  color: var(--text-soft);
  background: none;
  border-color: transparent;
}
.nav-logout-btn:hover { background: var(--surface-alt); color: var(--text); }

/* hidden attribute musi wygrać z display:flex / display:inline-block */
.nav-account[hidden],
.auth-form[hidden],
.nav-auth-btn[hidden],
.auth-tabs[hidden],
.auth-google[hidden],
.auth-or[hidden] { display: none; }

/* ===== MODAL LOGOWANIA / REJESTRACJI ===== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 15, 61, 0.45);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.auth-overlay.is-open { opacity: 1; pointer-events: all; }
.auth-overlay[hidden] { display: none; }
.auth-modal {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(26, 15, 61, 0.18);
  width: 100%;
  max-width: 420px;
  padding: 48px 28px 24px; /* górny pas mieści przycisk X, by nie nachodził na zakładki */
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}
.auth-overlay.is-open .auth-modal { transform: translateY(0) scale(1); }
.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.auth-close:hover { background: var(--border); color: var(--text); }
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 100px;
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  padding: 9px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  border: none;
  background: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.auth-tab.is-active { background: var(--purple); color: #fff; }
.auth-title {
  font-family: 'Lexend', sans-serif;
  font-size: 1.3rem;
  margin-bottom: 16px;
  color: var(--text);
}
/* Przycisk „Kontynuuj przez Google” – wygląd zgodny z wytycznymi Google
   (białe tło, neutralna ramka, oficjalne 4-kolorowe logo „G”, ciemny tekst) */
.auth-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 11px 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #3c4043;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.auth-google:hover {
  background: #f7f8f8;
  border-color: #d2d3d5;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.15);
}
.auth-google-ico { display: inline-flex; flex-shrink: 0; }
.auth-google-ico svg { display: block; }
.auth-or {
  display: flex;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.auth-or::before, .auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
}
.auth-label input {
  padding: 11px 14px;
  font-size: 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
}
.auth-label input:focus { border-color: var(--purple); }
.auth-submit {
  margin-top: 4px;
  padding: 12px;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  background: var(--purple);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.auth-submit:hover { background: #4A1D96; }
.auth-forgot-link {
  align-self: flex-end;
  margin-top: -4px;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--purple);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}
.auth-forgot-link:hover { color: #4A1D96; }
.auth-back-link {
  padding: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-align: center;
}
.auth-back-link:hover { color: var(--purple); }
.auth-forgot-intro {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: -4px 0 2px;
}
.auth-msg {
  margin-top: 12px;
  font-size: 0.86rem;
  min-height: 1.2em;
  color: var(--text-muted);
}
.auth-msg--error { color: #DC2626; }
.auth-msg--ok { color: #166534; }

/* ===== EKRAN SUKCESU REJESTRACJI ===== */
.auth-success[hidden] { display: none; }
.auth-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 4px 0 2px;
}
.auth-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #EDE9FE;
  margin-bottom: 2px;
}
.auth-success-icon .ti { font-size: 38px; color: var(--purple); }
.auth-success-title {
  font-family: 'Lexend', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.auth-success-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}
.auth-success-text strong { color: var(--text); word-break: break-word; }
.auth-success-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #92400E;
  background: #FEF3C7;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0;
}
.auth-success-hint .ti { flex: none; font-size: 16px; margin-top: 1px; color: #D97706; }
.auth-success-hint strong { color: #92400E; }
.auth-success .auth-submit { width: 100%; margin-top: 6px; }

/* Notka o wglądzie nauczyciela (rejestracja z zaproszenia) – ma być zauważona,
   więc wyróżniona jak hint, ale w kolorze marki, nie ostrzegawczym. */
.auth-invite-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #4C1D95;
  background: #F5F3FF;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 4px;
}
.auth-invite-note .ti { flex: none; font-size: 16px; margin-top: 1px; color: var(--purple, #6C2BD9); }

/* Akceptacja regulaminu + oświadczenie o wieku – drobne, pod przyciskiem. */
.auth-terms {
  font-size: 0.74rem;
  line-height: 1.45;
  color: #6B7280;
  text-align: center;
  margin: 2px 0 0;
}
.auth-terms a { color: #6B7280; text-decoration: underline; }
.auth-terms a:hover { color: var(--purple, #6C2BD9); }

/* ===== STRONA PROFILU ===== */
.profile-wrap {
  max-width: 640px;
  margin: 48px auto;
  padding: 0 24px;
}
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
}
.profile-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.profile-row:last-child { border-bottom: none; }
.profile-key {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.profile-val {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

/* ===== ZARZĄDZANIE KONTAMI / ZAPROSZENIA ===== */
.invite-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
}
.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.invite-actions .auth-submit { margin-top: 0; max-width: 240px; }
.invite-new-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-soft);
  margin: 16px 0 6px;
}
.invite-list-heading {
  font-family: 'Lexend', sans-serif;
  font-size: 1rem;
  color: var(--text);
  margin: 22px 0 10px;
}
.invite-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.invite-link-input {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  font-size: 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text-soft);
  outline: none;
}
.invite-link-input:focus { border-color: var(--purple); }
.invite-link-row .nav-auth-btn { padding: 8px 14px; font-size: 0.85rem; }
.invite-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.invite-item:last-child { border-bottom: none; }
.invite-item-head {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--purple);
  margin-bottom: 8px;
}
.invite-empty { font-size: 0.88rem; color: var(--text-muted); }
