/* ════════════════════════════════════════════════════════════════════════════
   MATHrix – Legal pages stylesheet (polityka, regulaminy)
   Extends v2.css — load after it.
   ════════════════════════════════════════════════════════════════════════════ */

body { padding-top: 72px; }

/* ─── Navigation ─────────────────────────────────────────────────────────── */

.legal-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  gap: 24px;
}

.legal-nav .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 1;
}

.legal-nav .logo-icon { height: 32px; width: 32px; }

.legal-nav .logo-wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 21px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.legal-nav .logo-rix { font-weight: 500; }

.legal-back {
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: color 0.2s;
}
.legal-back:hover { color: var(--text); }

/* ─── Layout ─────────────────────────────────────────────────────────────── */

.legal-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 64px 40px 96px;
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */

.legal-hero {
  margin-bottom: 52px;
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--badge-text);
  background: var(--badge-bg);
  border: 1px solid rgba(124,58,237,0.18);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 20px;
}

.legal-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.15;
}

.legal-date {
  font-size: 14px;
  color: var(--text-3);
}

/* ─── Content sections ───────────────────────────────────────────────────── */

.legal-section {
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.legal-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.legal-section h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
}

.legal-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 22px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
  color: var(--text-3);
}

.legal-section p {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-2);
  margin-bottom: 12px;
}

.legal-section p:last-child { margin-bottom: 0; }

.legal-section ul {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}

.legal-section ul li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-2);
  padding-left: 20px;
  position: relative;
  margin-bottom: 6px;
}

.legal-section ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ─── Links ──────────────────────────────────────────────────────────────── */

.accent-link {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}
.accent-link:hover { opacity: 0.8; text-decoration: underline; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */

.regulamin-table-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.regulamin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.regulamin-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.regulamin-table td {
  padding: 13px 16px;
  color: var(--text-2);
  border-bottom: 1px solid var(--table-border);
  vertical-align: middle;
  line-height: 1.5;
}

.regulamin-table tr:last-child td { border-bottom: none; }

.regulamin-table tr:nth-child(even) td { background: var(--table-stripe); }

.table-note {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ─── Dane firmowe ───────────────────────────────────────────────────────── */

.dane-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 8px;
}

.dane-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.dane-card-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.4;
}

.dane-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.dane-row:last-child { margin-bottom: 0; }

.dane-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 2px;
}

.dane-value {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
}

/* ─── Cookie table (polityka prywatnosci) ────────────────────────────────── */

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.cookie-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.cookie-table td {
  padding: 13px 16px;
  color: var(--text-2);
  border-bottom: 1px solid var(--table-border);
  vertical-align: top;
  line-height: 1.6;
}

.cookie-table tr:last-child td { border-bottom: none; }
.cookie-table tr:nth-child(even) td { background: var(--table-stripe); }

/* ─── PDF download button ────────────────────────────────────────────────── */

.legal-download {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.legal-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--pdf-color, #ef4444);
  text-decoration: none;
  padding: 10px 18px;
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 8px;
  background: rgba(239,68,68,0.06);
  transition: background 0.2s, border-color 0.2s;
}

.legal-pdf-btn:hover {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.4);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .legal-nav   { padding: 0 20px; }
  .legal-wrap  { padding: 48px 20px 64px; }
  .dane-grid   { grid-template-columns: 1fr; }
  .cookie-table th:last-child,
  .cookie-table td:last-child { display: none; }
}

/* ─── Regulaminy index page ──────────────────────────────────────────────── */

.regulaminy-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.regulamin-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 28px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.regulamin-card:hover {
  background: var(--bg-card-h);
  border-color: var(--border-h);
  transform: translateX(4px);
}

.regulamin-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--badge-bg);
  color: var(--badge-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.regulamin-card-body {
  flex: 1;
}

.regulamin-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.regulamin-card-desc {
  font-size: 14px;
  color: var(--text-2);
}

.regulamin-card-arrow {
  color: var(--text-3);
  font-size: 14px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.regulamin-card:hover .regulamin-card-arrow {
  color: var(--accent);
}

/* ─── Cookie consent banner ──────────────────────────────────────────────── */

#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--bg-card, #111128);
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
  box-shadow: 0 -8px 32px rgba(0,0,0,0.45);
  padding: 20px 40px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#cookie-banner.visible { transform: translateY(0); }

#cookie-banner.hiding {
  transform: translateY(110%);
  pointer-events: none;
}

.cookie-banner-text {
  flex: 1;
  min-width: 240px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2, #94a3b8);
}

.cookie-banner-text strong {
  color: var(--text, #f1f5f9);
  font-weight: 600;
}

.cookie-banner-text a {
  color: var(--accent, #7c3aed);
  text-decoration: none;
}
.cookie-banner-text a:hover { text-decoration: underline; }

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.cookie-btn-accept {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  color: #fff;
  background: var(--gradient, linear-gradient(135deg, #7c3aed, #3b82f6));
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.cookie-btn-accept:hover { opacity: 0.88; }

.cookie-btn-decline {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-2, #94a3b8);
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.cookie-btn-decline:hover {
  border-color: var(--text-3, #475569);
  color: var(--text, #f1f5f9);
}

@media (max-width: 600px) {
  #cookie-banner {
    padding: 16px 20px;
    gap: 16px;
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-banner-actions {
    justify-content: stretch;
  }
  .cookie-btn-accept,
  .cookie-btn-decline {
    flex: 1;
    text-align: center;
  }
}
