/* ==========================================================================
   NOERON CUSTOM COOKIE CONSENT & PREFERENCE CENTER
   WCAG 2.2 AA Compliant | Google Consent Mode v2 Ready | Premium Dark Design
   ========================================================================== */

:root {
  --noeron-consent-bg: rgba(2, 6, 18, 0.95);
  --noeron-consent-surface: rgba(15, 23, 42, 0.85);
  --noeron-consent-border: rgba(56, 189, 248, 0.22);
  --noeron-consent-text: #f8fafc;
  --noeron-consent-muted: #8494a7;
  --noeron-consent-primary: #38bdf8;
  --noeron-consent-primary-hover: #0284c7;
  --noeron-consent-focus: #38bdf8;
}

/* Base Reset for Consent Component */
.noeron-consent-banner,
.noeron-consent-modal {
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--noeron-consent-text);
  -webkit-font-smoothing: antialiased;
}

.noeron-consent-banner *,
.noeron-consent-modal * {
  box-sizing: border-box;
}

/* ==========================================================================
   1. FIRST-LEVEL CONSENT BANNER (Floating Bottom Bar)
   ========================================================================== */

.noeron-consent-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 980px;
  background: var(--noeron-consent-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--noeron-consent-border);
  border-radius: 16px;
  padding: 22px 28px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.12);
  z-index: 999990;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.noeron-consent-banner.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.noeron-consent-content {
  flex: 1;
  min-width: 0;
}

.noeron-consent-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.noeron-consent-shield-icon {
  width: 18px;
  height: 18px;
  color: var(--noeron-consent-primary);
  flex-shrink: 0;
}

.noeron-consent-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}

.noeron-consent-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--noeron-consent-muted);
  margin: 0;
}

.noeron-consent-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ==========================================================================
   BUTTONS & FOCUS INDICATORS
   ========================================================================== */

.noeron-consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  min-height: 42px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  text-decoration: none;
  border: 1px solid transparent;
}

.noeron-consent-btn:focus-visible {
  outline: 2px solid var(--noeron-consent-focus) !important;
  outline-offset: 3px !important;
}

.noeron-consent-btn-primary {
  background: var(--noeron-consent-primary);
  color: #020408;
  border-color: var(--noeron-consent-primary);
}

.noeron-consent-btn-primary:hover {
  background: #7dd3fc;
  border-color: #7dd3fc;
}

.noeron-consent-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.14);
}

.noeron-consent-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.noeron-consent-btn-ghost {
  background: transparent;
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.1);
}

.noeron-consent-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.4);
}

/* ==========================================================================
   2. SETTINGS MODAL / PREFERENCE CENTER
   ========================================================================== */

.noeron-consent-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.noeron-consent-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.noeron-consent-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: calc(100% - 32px);
  max-width: 580px;
  max-height: 90vh;
  background: var(--noeron-consent-bg);
  border: 1px solid var(--noeron-consent-border);
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85), 0 0 30px rgba(56, 189, 248, 0.15);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
  overflow: hidden;
}

.noeron-consent-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.noeron-consent-modal-header {
  padding: 24px 28px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.noeron-consent-modal-title-group h2 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.noeron-consent-modal-title-group p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--noeron-consent-muted);
  margin: 0;
}

.noeron-consent-modal-close {
  background: transparent;
  border: none;
  color: var(--noeron-consent-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background-color 0.15s;
  min-width: 36px;
  min-height: 36px;
}

.noeron-consent-modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.noeron-consent-modal-close:focus-visible {
  outline: 2px solid var(--noeron-consent-focus) !important;
  outline-offset: 2px !important;
}

.noeron-consent-modal-body {
  padding: 20px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Category Item Card */
.noeron-consent-category-card {
  background: var(--noeron-consent-surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color 0.2s;
}

.noeron-consent-category-card:hover {
  border-color: rgba(56, 189, 248, 0.2);
}

.noeron-consent-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.noeron-consent-category-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.noeron-consent-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 9999px;
}

.noeron-consent-badge-required {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.noeron-consent-badge-optional {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.noeron-consent-category-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--noeron-consent-muted);
  margin: 0;
}

/* Accessible Toggle Switch */
.noeron-consent-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.noeron-consent-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: 0.2s;
  border-radius: 24px;
}

.noeron-consent-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 50%;
}

.noeron-consent-toggle input:checked + .noeron-consent-slider {
  background-color: var(--noeron-consent-primary);
  border-color: var(--noeron-consent-primary);
}

.noeron-consent-toggle input:checked + .noeron-consent-slider:before {
  transform: translateX(20px);
  background-color: #020408;
}

.noeron-consent-toggle input:disabled + .noeron-consent-slider {
  cursor: not-allowed;
  opacity: 0.75;
}

.noeron-consent-toggle input:focus-visible + .noeron-consent-slider {
  outline: 2px solid var(--noeron-consent-focus) !important;
  outline-offset: 3px !important;
}

/* Modal Footer */
.noeron-consent-modal-footer {
  padding: 16px 28px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 6, 18, 0.8);
}

/* Footer Trigger Link Styling */
.footer-cookie-trigger {
  background: transparent;
  border: none;
  font: inherit;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  color: inherit;
  transition: color 0.2s;
}

.footer-cookie-trigger:hover {
  color: #38bdf8;
}

.footer-cookie-trigger:focus-visible {
  outline: 2px solid var(--noeron-consent-focus) !important;
  outline-offset: 2px !important;
}

/* ==========================================================================
   RESPONSIVENESS & REDUCED MOTION
   ========================================================================== */

@media (max-width: 768px) {
  .noeron-consent-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 20px;
    bottom: 16px;
    width: calc(100% - 24px);
  }

  .noeron-consent-actions {
    flex-wrap: wrap;
  }

  .noeron-consent-actions .noeron-consent-btn {
    flex: 1 1 calc(50% - 6px);
    min-height: 44px;
    font-size: 13.5px;
  }

  .noeron-consent-actions .noeron-consent-btn-primary {
    flex: 1 1 100%;
    order: -1;
  }

  .noeron-consent-modal {
    width: calc(100% - 24px);
    max-height: 85vh;
  }

  .noeron-consent-modal-header,
  .noeron-consent-modal-body,
  .noeron-consent-modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .noeron-consent-banner,
  .noeron-consent-modal,
  .noeron-consent-modal-backdrop,
  .noeron-consent-btn,
  .noeron-consent-slider,
  .noeron-consent-slider:before {
    transition: none !important;
    animation: none !important;
  }
}
