/* ═══════════════════════════════════════════════════════════
   COOKIE CONSENT — Matches INTERY industrial design system
   ═══════════════════════════════════════════════════════════ */

.cookie-consent {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.cookie-consent-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 41, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition: background .4s ease, backdrop-filter .4s ease;
  pointer-events: none;
}

.cookie-consent.show .cookie-consent-backdrop {
  background: rgba(10, 25, 41, .35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
}

.cookie-consent-panel {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  width: calc(100% - 3rem);
  max-width: 640px;
  background: linear-gradient(135deg, rgba(15, 30, 50, .98) 0%, rgba(10, 25, 41, .98) 100%);
  border: 1px solid rgba(56, 189, 248, .15);
  border-radius: 18px;
  box-shadow:
    0 24px 60px -12px rgba(0, 0, 0, .6),
    0 8px 24px -8px rgba(56, 189, 248, .15),
    inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #e2e8f0;
  pointer-events: auto;
  transition: transform .5s cubic-bezier(.16, 1, .3, 1), opacity .4s ease;
  opacity: 0;
  overflow: hidden;
}

.cookie-consent.show .cookie-consent-panel {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Decorative top accent line */
.cookie-consent-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, .6), transparent);
}

/* Subtle grid pattern overlay */
.cookie-consent-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, .025) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  opacity: .6;
}

/* View switching */
.cookie-consent-view {
  display: none;
  position: relative;
  padding: 1.75rem;
}

.cookie-consent-panel[data-view="main"] .cookie-consent-main { display: grid; }
.cookie-consent-panel[data-view="settings"] .cookie-consent-settings { display: block; }

/* Main view layout */
.cookie-consent-main {
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: flex-start;
}

.cookie-consent-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, .15), rgba(3, 105, 161, .25));
  border: 1px solid rgba(56, 189, 248, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  position: relative;
  z-index: 1;
}

.cookie-consent-icon svg {
  width: 26px;
  height: 26px;
}

.cookie-consent-content {
  position: relative;
  z-index: 1;
  grid-column: 2;
}

.cookie-consent-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -.01em;
  margin: 0 0 .5rem;
  color: #ffffff;
  line-height: 1.2;
}

.cookie-consent-message {
  font-size: .9rem;
  line-height: 1.55;
  margin: 0;
  color: rgba(226, 232, 240, .8);
}

.cookie-consent-policy-link {
  display: inline-block;
  margin-top: .5rem;
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  font-size: .85rem;
  border-bottom: 1px solid rgba(56, 189, 248, .35);
  transition: border-color .2s ease, color .2s ease;
}

.cookie-consent-policy-link:hover {
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, .8);
}

/* Action buttons */
.cookie-consent-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 1.25rem;
  position: relative;
  z-index: 1;
}

.cookie-consent-actions-settings {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(56, 189, 248, .1);
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .7rem 1.25rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.cookie-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.cookie-btn-ghost {
  background: transparent;
  color: rgba(226, 232, 240, .7);
  border-color: rgba(255, 255, 255, .08);
}

.cookie-btn-ghost:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, .04);
  border-color: rgba(255, 255, 255, .15);
}

.cookie-btn-secondary {
  background: rgba(255, 255, 255, .06);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, .12);
}

.cookie-btn-secondary:hover {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .2);
  color: #ffffff;
}

.cookie-btn-primary {
  background: linear-gradient(135deg, #0369A1 0%, #0284c7 50%, #38bdf8 100%);
  color: #ffffff;
  border-color: rgba(56, 189, 248, .4);
  box-shadow: 0 4px 14px -2px rgba(3, 105, 161, .4);
}

.cookie-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -2px rgba(56, 189, 248, .5);
}

.cookie-btn-primary:active { transform: translateY(0); }

/* Settings view */
.cookie-consent-settings-header {
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}

.cookie-consent-categories {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  position: relative;
  z-index: 1;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: .5rem;
}

.cookie-consent-categories::-webkit-scrollbar { width: 6px; }
.cookie-consent-categories::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, .25);
  border-radius: 3px;
}
.cookie-consent-categories::-webkit-scrollbar-track { background: transparent; }

.cookie-category {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 10px;
  padding: .9rem 1rem;
  transition: border-color .2s ease;
}

.cookie-category:hover { border-color: rgba(56, 189, 248, .15); }

.cookie-category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-category-header > div { flex: 1; min-width: 0; }

.cookie-category h4 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .02em;
  margin: 0 0 .25rem;
  color: #ffffff;
  text-transform: uppercase;
}

.cookie-category p {
  font-size: .8rem;
  line-height: 1.5;
  margin: 0;
  color: rgba(226, 232, 240, .65);
}

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

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

.cookie-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 22px;
  transition: all .25s ease;
}

.cookie-toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #94a3b8;
  border-radius: 50%;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: linear-gradient(135deg, #0369A1, #38bdf8);
  border-color: rgba(56, 189, 248, .5);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
  left: 20px;
  background: #ffffff;
}

.cookie-toggle:hover .cookie-toggle-slider { border-color: rgba(56, 189, 248, .4); }

.cookie-toggle-locked {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #38bdf8;
  background: rgba(56, 189, 248, .1);
  border: 1px solid rgba(56, 189, 248, .2);
  padding: .35rem .65rem;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .cookie-consent-panel {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: translateY(140%);
    border-radius: 18px 18px 0 0;
    border-bottom: none;
  }
  .cookie-consent.show .cookie-consent-panel { transform: translateY(0); }

  .cookie-consent-view { padding: 1.5rem 1.25rem 1.25rem; }

  .cookie-consent-main {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .cookie-consent-content { grid-column: 1; }
  .cookie-consent-icon {
    width: 40px;
    height: 40px;
  }
  .cookie-consent-icon svg { width: 22px; height: 22px; }

  .cookie-consent-title { font-size: 1.2rem; }
  .cookie-consent-message { font-size: .85rem; }

  .cookie-consent-actions {
    flex-direction: column-reverse;
    gap: .5rem;
  }
  .cookie-btn {
    width: 100%;
    justify-content: center;
    padding: .85rem 1rem;
  }

  .cookie-consent-actions-settings { flex-direction: column-reverse; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .cookie-consent-panel,
  .cookie-consent-backdrop,
  .cookie-btn,
  .cookie-toggle-slider,
  .cookie-toggle-slider::before {
    transition: none !important;
  }
}

/* Footer "Cookie Settings" link */
[data-cookie-settings-link] {
  color: inherit;
  text-decoration: none;
  opacity: .85;
  transition: opacity .2s ease, color .2s ease;
  cursor: pointer;
}
[data-cookie-settings-link]:hover {
  opacity: 1;
  color: #38bdf8;
}
.footer-bottom-sep {
  margin: 0 .35rem;
  opacity: .5;
}
