/* ============================================================
   rascue-legal.css
   Covers:  Legal pages + Cookie banner + Cookie settings modal
   Used by: rascue.de (Datenschutz, Nutzungsbedingungen,
            Impressum, AGB) and provider.rascue.de
   ============================================================ */


/* ── LEGAL PAGES ──────────────────────────────────────────── */

.rascue-legal-page {
  background: #f9fafb;
  min-height: 100vh;
  padding: 2rem 0 4rem;
}

.legal-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.legal-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 1.5rem;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #667085;
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color 0.15s;
}
.legal-back:hover { color: #0B3B3A; }

.legal-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #0B3B3A;
  line-height: 1.2;
  margin: 0 0 0.25rem;
}

.legal-header .legal-meta {
  font-size: 13px;
  color: #667085;
  margin: 0;
}

.legal-content {
  font-size: 16px;
  line-height: 1.7;
  color: #374151;
}

.legal-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #f3f4f6;
}
.legal-section:last-of-type { border-bottom: none; }

.legal-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0B3B3A;
  margin: 0 0 0.75rem;
}

.legal-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
  margin: 1.25rem 0 0.4rem;
}

.legal-content p { margin-bottom: 0.85rem; }

.legal-content ul {
  padding-left: 1.4rem;
  margin-bottom: 0.85rem;
}
.legal-content ul li { margin-bottom: 0.4rem; }

.legal-content a { color: #0B3B3A; }
.legal-content a:hover { color: #E8A020; }

.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 14px;
}
.legal-content th {
  background: #0B3B3A;
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  font-weight: 600;
}
.legal-content td {
  padding: 9px 12px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}
.legal-content tr:nth-child(even) td { background: #f9fafb; }

/* Callout boxes */
.legal-box {
  border-left: 4px solid #E8A020;
  background: #fffbeb;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 1rem 0;
  font-size: 14px;
}
.legal-box.red   { background: #fef2f2; border-color: #ef4444; }
.legal-box.green { background: #f0fdf4; border-color: #22c55e; }
.legal-box.blue  { background: #eff6ff; border-color: #3b82f6; }

/* Footer note / stand */
.legal-note {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
  font-size: 13px;
  color: #667085;
}

/* PDF download button */
.legal-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #0B3B3A;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  margin-top: 0.5rem;
}
.legal-pdf-btn:hover { background: #0f5251; color: #fff; }
.legal-pdf-btn svg   { flex-shrink: 0; }


/* ── COOKIE BANNER ────────────────────────────────────────── */

#rascue-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999999;
  background: #fff;
  border-top: 1px solid #e5e0d8;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.10);
  padding: 20px 24px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.cookie-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}

.cookie-banner-text h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #1a1f2e;
  margin: 0 0 6px;
}

.cookie-banner-text p {
  font-size: 13px;
  color: #667085;
  line-height: 1.6;
  margin: 0;
}

.cookie-banner-text a {
  color: #0B3B3A;
  font-weight: 500;
}

.cookie-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}

.cookie-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
}

.cookie-btn.accept-all         { background: #0B3B3A; color: #fff; }
.cookie-btn.accept-all:hover   { background: #082f2e; }

.cookie-btn.accept-essential       { background: #f0f0ee; color: #444c5e; }
.cookie-btn.accept-essential:hover { background: #e5e0d8; }

.cookie-btn.settings       { background: none; color: #667085; font-weight: 500; padding: 6px 18px; font-size: 12px; }
.cookie-btn.settings:hover { color: #0B3B3A; }


/* ── COOKIE SETTINGS MODAL ────────────────────────────────── */

#rascue-cookie-settings {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#rascue-cookie-settings.open {
  display: flex;
}

.cookie-settings-card {
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18);
}

.cookie-settings-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #0B3B3A;
  margin: 0 0 8px;
}

.cookie-settings-card > p {
  font-size: 13px;
  color: #667085;
  margin: 0 0 24px;
  line-height: 1.6;
}

.cookie-category {
  border: 1px solid #e5e0d8;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.cookie-category-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1f2e;
}

.cookie-category-desc {
  font-size: 12px;
  color: #667085;
  line-height: 1.5;
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.cookie-toggle-track {
  position: absolute;
  inset: 0;
  background: #e5e0d8;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.2s;
}

.cookie-toggle input:checked + .cookie-toggle-track {
  background: #0B3B3A;
}

.cookie-toggle-track::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.cookie-toggle input:checked + .cookie-toggle-track::after {
  transform: translateX(18px);
}

.cookie-toggle input:disabled + .cookie-toggle-track {
  opacity: 0.6;
  cursor: not-allowed;
}

.cookie-settings-footer {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  justify-content: flex-end;
}


/* ── RESPONSIVE ───────────────────────────────────────────── */

@media (max-width: 640px) {
  /* Cookie banner stacks vertically */
  .cookie-banner-inner {
    grid-template-columns: 1fr;
  }
  .cookie-banner-actions {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: unset;
  }
  .cookie-btn.settings {
    width: 100%;
    text-align: center;
  }

  /* Legal sections get side padding on mobile — FIX: preserve bottom spacing */
  .legal-section {
    padding: 0 20px 2rem;  /* was: padding:20px which killed padding-bottom:2rem */
  }

  /* Legal text sizing */
  .legal-header h1  { font-size: 1.5rem; }
  .legal-content h2 { font-size: 1rem; }
  .legal-content    { font-size: 15px; }
  .legal-content table { font-size: 12px; }
}


/* ── PRINT / PDF ──────────────────────────────────────────── */

@media print {
  .legal-back,
  .legal-pdf-btn,
  nav,
  .rascue-nav,
  footer,
  .footer,
  #rascue-cookie-banner,
  #rascue-cookie-settings { display: none !important; }

  .rascue-legal-page { background: #fff; padding: 0; }
  .legal-container   { max-width: 100%; padding: 0; }
  .legal-section     { break-inside: avoid; border-bottom: 1px solid #e5e7eb; }
  .legal-content a   { color: #0B3B3A; text-decoration: none; }
  body               { font-size: 12pt; color: #000; }
}