/* =============================================
   IRIS v2 — Cookie Consent Popup
   ============================================= */

/* ── Overlay ── */
.cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 9799;
  background: rgba(0, 8, 28, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.cookie-overlay.cookie-visible { display: block; }
.cookie-overlay.cookie-show    { opacity: 1; }
.cookie-overlay.cookie-hide    { opacity: 0; transition: opacity 0.4s ease; }

/* ── Wrapper ── */
.cookie-wrap {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%) scale(0.93);
  z-index: 9800;
  width: 440px;
  max-width: calc(100vw - 32px);
  /* Hidden by default — JS controls display */
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.cookie-wrap.cookie-visible {
  display: block;
}

.cookie-wrap.cookie-show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.cookie-wrap.cookie-hide {
  opacity: 0;
  transform: translate(-50%, -44%) scale(0.96);
  pointer-events: none;
  transition: opacity 0.4s ease,
              transform 0.4s ease;
}

/* ── Animated gradient border ── */
.cookie-border {
  position: relative;
  border-radius: 22px;
  padding: 1.5px;
  background: conic-gradient(
    from var(--cookie-angle),
    rgba(0, 70, 168, 0.8)     0%,
    rgba(74, 144, 217, 1)    20%,
    rgba(255, 255, 255, 0.3) 45%,
    rgba(74, 144, 217, 1)    70%,
    rgba(228, 0, 43, 0.5)    88%,
    rgba(0, 70, 168, 0.8)   100%
  );
  animation: cookieBorderSpin 4s linear infinite;
}

@keyframes cookieBorderSpin {
  to { --cookie-angle: 360deg; }
}

/* ── Inner panel ── */
.cookie-inner {
  position: relative;
  background: rgba(0, 10, 35, 0.95);
  backdrop-filter: blur(32px) saturate(1.5);
  -webkit-backdrop-filter: blur(32px) saturate(1.5);
  border-radius: 21px;
  padding: 22px 24px 18px;
  overflow: hidden;
}

/* ── Scan line on entry ── */
.cookie-scan {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(74, 144, 217, 0) 5%,
    rgba(74, 144, 217, 0.95) 50%,
    rgba(74, 144, 217, 0) 95%,
    transparent 100%
  );
  pointer-events: none;
  animation: cookieScanMove 1.4s 2.1s ease-in-out 1 both;
}

@keyframes cookieScanMove {
  0%   { opacity: 0; transform: translateY(0);    }
  10%  { opacity: 1; transform: translateY(6px);  }
  88%  { opacity: 1; transform: translateY(230px);}
  100% { opacity: 0; transform: translateY(250px);}
}

/* ── Header ── */
.cookie-header {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 13px;
}

/* Shield icon with dual pulse rings */
.cookie-icon-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  margin-top: 1px;
}

.cookie-icon-wrap svg {
  width: 36px;
  height: 36px;
  fill: #4A90D9;
  filter: drop-shadow(0 0 8px rgba(74, 144, 217, 0.55));
}

.cookie-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(74, 144, 217, 0.55);
  animation: cookieRingPulse 2.8s ease-out infinite;
}

.cookie-ring-2 {
  animation-delay: 1.4s;
}

@keyframes cookieRingPulse {
  0%   { transform: scale(1);    opacity: 0.7; }
  100% { transform: scale(1.75); opacity: 0;   }
}

/* Header text block */
.cookie-header-text {
  flex: 1;
  min-width: 0;
}

.cookie-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: #4A90D9;
  margin-bottom: 5px;
}

.cookie-eyebrow::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 1.5px;
  background: #4A90D9;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Animated signal dots */
.cookie-signal {
  display: flex;
  gap: 3px;
  align-items: center;
  margin-left: 4px;
}

.cookie-signal span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #4A90D9;
  animation: cookieDotBlink 1.6s ease-in-out infinite;
}

.cookie-signal span:nth-child(2) { animation-delay: 0.2s; }
.cookie-signal span:nth-child(3) { animation-delay: 0.4s; }

@keyframes cookieDotBlink {
  0%, 100% { opacity: 0.2; transform: scale(0.75); }
  50%       { opacity: 1;   transform: scale(1.1);  }
}

.cookie-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

/* Close button */
.cookie-close {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cookie-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.8);
}

/* ── Description ── */
.cookie-desc {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.65;
  margin-bottom: 16px;
}

/* ── Separator ── */
.cookie-sep {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  margin-bottom: 14px;
}

/* ── Categories ── */
.cookie-categories {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.cookie-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.055);
  /* Entry animation (triggered via JS class) */
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.2s, border-color 0.2s;
}

.cookie-cat.visible {
  opacity: 1;
  transform: translateX(0);
}

.cookie-cat:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.1);
}

.cookie-cat-name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.cookie-cat-sub {
  display: block;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 2px;
}

/* Required badge */
.cookie-required-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #4A90D9;
  background: rgba(74, 144, 217, 0.1);
  border: 1px solid rgba(74, 144, 217, 0.22);
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Custom toggle switch ── */
.cookie-toggle {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  flex-shrink: 0;
}

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

.cookie-track {
  width: 42px;
  height: 23px;
  border-radius: 11.5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
}

.cookie-thumb {
  position: absolute;
  top: 3.5px;
  left: 3.5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.35s,
              box-shadow 0.35s;
}

.cookie-toggle input:checked ~ .cookie-track {
  background: rgba(74, 144, 217, 0.2);
  border-color: rgba(74, 144, 217, 0.45);
  box-shadow: 0 0 10px rgba(74, 144, 217, 0.18);
}

.cookie-toggle input:checked ~ .cookie-track .cookie-thumb {
  transform: translateX(19px);
  background: #4A90D9;
  box-shadow: 0 0 8px rgba(74, 144, 217, 0.65);
}

/* ── Actions ── */
.cookie-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 11px;
}

.cookie-btn-accept {
  flex: 1;
  height: 40px;
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, #0046A8 0%, #4A90D9 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: opacity 0.2s, transform 0.15s;
}

/* Shimmer sweep on hover */
.cookie-btn-accept::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: -100%; width: 60%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
}

.cookie-btn-accept:hover::after { left: 160%; }
.cookie-btn-accept:hover { opacity: 0.92; }
.cookie-btn-accept:active { transform: scale(0.97); }

.cookie-btn-save {
  height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cookie-btn-save:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

/* ── Footer links ── */
.cookie-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.cookie-footer-links a,
.cookie-footer-links button {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.28);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 5px;
  transition: color 0.2s, background 0.2s;
  line-height: 1.4;
}

.cookie-footer-links a:hover,
.cookie-footer-links button:hover {
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.05);
}

.cookie-footer-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

/* ── Success overlay ── */
.cookie-success-overlay {
  position: absolute;
  inset: 0;
  border-radius: 21px;
  background: linear-gradient(150deg, rgba(0,15,45,0.98) 0%, rgba(0,40,100,0.98) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 10;
}

.cookie-success-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.cookie-success-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
}

/* ── SVG animated checkmark ── */
.cookie-success-check {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 144, 217, 0.08);
  border-radius: 50%;
}

/* Pulse ring */
@keyframes csoPulse {
  0%   { transform: scale(1);    opacity: 0.5; }
  100% { transform: scale(1.6);  opacity: 0; }
}
.cookie-success-overlay.cso-animate .cookie-success-check::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(74,144,217,0.3);
  animation: csoPulse 0.85s ease-out 1.15s forwards;
}

.cookie-success-svg {
  width: 60px;
  height: 60px;
  overflow: visible;
}

/* Circle draw-on */
.cso-circle {
  stroke-dasharray: 188;
  stroke-dashoffset: 188;
}
.cookie-success-overlay.cso-animate .cso-circle {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

/* Tick draw-on */
.cso-tick {
  fill: none;
  stroke-dasharray: 52;
  stroke-dashoffset: 52;
}
.cookie-success-overlay.cso-animate .cso-tick {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.6s;
}

/* Text */
.cookie-success-title {
  font-size: 15px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(6px);
}
.cookie-success-overlay.cso-animate .cookie-success-title {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease 0.85s, transform 0.4s ease 0.85s;
}

.cookie-success-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.38);
  opacity: 0;
  transform: translateY(6px);
}
.cookie-success-overlay.cso-animate .cookie-success-sub {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease 1s, transform 0.4s ease 1s;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .cookie-wrap {
    width: calc(100vw - 32px);
  }
}
