/* Legal Modals & Cookie Banner - SOC2 / ISO 27001 aligned */
.legal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  animation: legalFadeIn 0.3s ease;
}
.legal-overlay.open { display: flex; }
@keyframes legalFadeIn { from { opacity: 0; } to { opacity: 1; } }

.legal-modal {
  background: var(--bg-card, #161b22);
  border: 1px solid var(--border, #30363d);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: legalSlideIn 0.3s ease;
}
@keyframes legalSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.legal-modal-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border, #30363d);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.legal-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-primary, #e6edf3);
}
.legal-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary, #8b949e);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}
.legal-modal-close:hover { color: var(--text-primary, #e6edf3); }

.legal-modal-body {
  padding: 32px;
  overflow-y: auto;
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.7;
}
.legal-modal-body h3 {
  font-size: 1.1rem;
  margin: 24px 0 12px;
  color: var(--text-primary, #e6edf3);
}
.legal-modal-body h3:first-child { margin-top: 0; }
.legal-modal-body p { margin-bottom: 12px; color: var(--text-secondary, #8b949e); }
.legal-modal-body ul { margin: 12px 0; padding-left: 24px; color: var(--text-secondary); }
.legal-modal-body li { margin-bottom: 8px; }
.legal-modal-body a { color: var(--accent, #58a6ff); }
.legal-modal-body strong { color: var(--text-primary); }
.legal-modal-body .legal-updated { font-size: 0.85rem; color: var(--text-muted, #6e7681); margin-bottom: 24px; }

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-elevated, #21262d);
  border-top: 1px solid var(--border, #30363d);
  padding: 24px 32px;
  z-index: 9999;
  display: none;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  animation: cookieSlideUp 0.4s ease;
}
.cookie-banner.open { display: block; }
@keyframes cookieSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cookie-banner-text {
  flex: 1;
  min-width: 280px;
}
.cookie-banner-text p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary, #8b949e);
  line-height: 1.6;
}
.cookie-banner-text a {
  color: var(--accent, #58a6ff);
  text-decoration: underline;
  cursor: pointer;
}
.cookie-banner-buttons {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.cookie-banner-buttons button {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.cookie-btn-accept {
  background: var(--accent, #58a6ff);
  color: #fff;
}
.cookie-btn-accept:hover { background: var(--accent-hover, #79b8ff); }
.cookie-btn-essential {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.cookie-btn-essential:hover { border-color: var(--accent); color: var(--accent); }
.cookie-btn-reject {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.cookie-btn-reject:hover { color: var(--text-secondary); }

@media (max-width: 600px) {
  .legal-modal { max-height: 95vh; }
  .legal-modal-header, .legal-modal-body { padding: 20px; }
  .cookie-banner-inner { flex-direction: column; align-items: stretch; }
  .cookie-banner-buttons { justify-content: stretch; }
  .cookie-banner-buttons button { flex: 1; }
}
