/* ===== Cookie consent — Mutilva Web ===== */
/* Floating glass card (bottom-left) + iOS-style settings modal */

.cookie-card {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: min(380px, calc(100% - 40px));
  padding: 18px 20px 18px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(20, 28, 45, 0.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow:
    0 24px 48px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: var(--font);
  z-index: 9999;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.cookie-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.cookie-card__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.cookie-card__body {
  flex: 1;
  min-width: 0;
}

.cookie-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: #fff;
  letter-spacing: -0.01em;
}

.cookie-card__text {
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 14px;
}

.cookie-card__text a {
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.cookie-card__text a:hover {
  color: #bfdbfe;
}

.cookie-card__actions {
  display: flex;
  gap: 8px;
}

.cookie-card__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.cookie-card__close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ===== Buttons inside cookie UI ===== */
.cookie-btn {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.cookie-btn--primary {
  background: linear-gradient(135deg, #4f8ff7 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.cookie-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

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

.cookie-btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.cookie-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ===== Settings modal ===== */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cookie-modal.is-open {
  display: flex;
}

.cookie-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 25, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: cookieFade 0.3s ease;
}

.cookie-modal__panel {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: rgba(24, 32, 48, 0.85);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 28px;
  color: #fff;
  box-shadow:
    0 32px 64px -16px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: cookieRise 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cookieFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cookieRise {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cookie-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.cookie-modal__close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.cookie-modal__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.cookie-modal__desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 24px;
}

/* Cookie option row */
.cookie-option {
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-option:last-of-type {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}

.cookie-option__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.cookie-option__title {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin: 0 8px 0 0;
  vertical-align: middle;
}

.cookie-option__badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.cookie-option__badge--muted {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
}

.cookie-option__desc {
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

/* iOS-style switch */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

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

.cookie-switch__slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 26px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-switch__slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-switch input:checked + .cookie-switch__slider {
  background: linear-gradient(135deg, #4f8ff7, #2563eb);
  border-color: transparent;
}

.cookie-switch input:checked + .cookie-switch__slider::before {
  transform: translateX(18px);
}

.cookie-switch--locked .cookie-switch__slider {
  cursor: not-allowed;
  opacity: 0.7;
}

.cookie-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cookie-modal__actions .cookie-btn {
  flex: 1;
  max-width: 180px;
}

/* Responsive */
@media (max-width: 520px) {
  .cookie-card {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    padding: 16px;
  }
  .cookie-card__actions { flex-direction: column; }
  .cookie-card__actions .cookie-btn { width: 100%; }
  .cookie-modal__panel { padding: 24px 20px; }
  .cookie-modal__actions { flex-direction: column-reverse; }
  .cookie-modal__actions .cookie-btn { max-width: 100%; }
}
