/* Cookie consent banner + preferences modal.
   Uses Nutrifix palette vars where present, with fallbacks so it also renders
   correctly on the static marketing site (which has its own stylesheet). */

.nf-cc,
.nf-cc * {
  box-sizing: border-box;
}

.nf-cc {
  --cc-bg: var(--nf-surface-strong, #0E0F11);
  --cc-border: var(--nf-border, rgba(255, 255, 255, 0.14));
  --cc-text: var(--nf-text, #ecf2ff);
  --cc-muted: var(--nf-text-muted, #9aabaa);
  --cc-primary: var(--nf-primary, #6BC3B2);
  --cc-radius: 14px;
  font-family: 'Satoshi', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------------------------------------------------------------- Banner --- */
.nf-cc-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2147483646; /* above app chrome, below the modal */
  margin: 0 auto;
  max-width: 920px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding: 18px 20px;
  background: var(--cc-bg);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  animation: nf-cc-rise 0.32s ease both;
}

@keyframes nf-cc-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nf-cc-banner__text {
  flex: 1 1 320px;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--cc-muted);
}

.nf-cc-banner__text strong { color: var(--cc-text); }

.nf-cc-link {
  color: var(--cc-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nf-cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* --------------------------------------------------------------- Buttons --- */
.nf-cc-btn {
  appearance: none;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid var(--cc-border);
  padding: 9px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  background: transparent;
  color: var(--cc-text);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.nf-cc-btn:hover { border-color: var(--cc-primary); }
.nf-cc-btn:active { transform: translateY(1px); }

.nf-cc-btn--primary {
  background: var(--cc-primary);
  border-color: var(--cc-primary);
  color: #08110f;
}

.nf-cc-btn--primary:hover { filter: brightness(1.06); }

.nf-cc-btn--ghost { color: var(--cc-muted); }

.nf-cc-btn:focus-visible {
  outline: 2px solid var(--cc-primary);
  outline-offset: 2px;
}

/* ----------------------------------------------------------------- Modal --- */
.nf-cc-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  animation: nf-cc-fade 0.2s ease both;
}

@keyframes nf-cc-fade { from { opacity: 0; } to { opacity: 1; } }

.nf-cc-modal__dialog {
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--cc-bg);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  padding: 26px;
}

.nf-cc-modal__title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 700;
}

.nf-cc-modal__intro {
  margin: 0 0 18px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--cc-muted);
}

/* ------------------------------------------------------------ Categories --- */
.nf-cc-cat {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 0;
  border-top: 1px solid var(--cc-border);
}

.nf-cc-cat__body { flex: 1; }

.nf-cc-cat__name {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
}

.nf-cc-cat__desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--cc-muted);
}

/* Toggle switch */
.nf-cc-switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  margin-top: 2px;
}

.nf-cc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.nf-cc-switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.18s ease;
}

.nf-cc-switch__track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.nf-cc-switch input:checked + .nf-cc-switch__track { background: var(--cc-primary); }
.nf-cc-switch input:checked + .nf-cc-switch__track::before { transform: translateX(20px); }
.nf-cc-switch input:disabled { cursor: not-allowed; }
.nf-cc-switch input:disabled + .nf-cc-switch__track { background: var(--cc-primary); opacity: 0.55; }
.nf-cc-switch input:focus-visible + .nf-cc-switch__track {
  outline: 2px solid var(--cc-primary);
  outline-offset: 2px;
}

.nf-cc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ----------------------------------------------------- Re-open affordance --- */
.nf-cc-reopen {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 2147483645;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--cc-text);
  background: var(--cc-bg);
  border: 1px solid var(--cc-border);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0.85;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.nf-cc-reopen:hover { opacity: 1; border-color: var(--cc-primary); }
.nf-cc-reopen:focus-visible { outline: 2px solid var(--cc-primary); outline-offset: 2px; }

@media (max-width: 600px) {
  .nf-cc-banner { padding: 16px; gap: 14px; }
  .nf-cc-actions { width: 100%; }
  .nf-cc-actions .nf-cc-btn { flex: 1 1 auto; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .nf-cc-banner, .nf-cc-modal { animation: none; }
}
