/**
 * NexiBook Cookie Consent — Italian / Dark Theme
 * NexiBook brand colours: gold #d4af37, bg #0f1117, bg2 #1a1d2e
 */

/* ── Banner ─────────────────────────────────────────── */
#nc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: #1a1d2e;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  padding: 1.25rem 1.5rem;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));

  /* Slide-up animation */
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#nc-banner.nc-visible {
  transform: translateY(0);
}

#nc-banner.nc-hiding {
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nc-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nc-text {
  flex: 1 1 340px;
}

.nc-title {
  font-size: 1rem;
  font-weight: 700;
  color: #d4af37;
  margin: 0 0 0.35rem 0;
}

.nc-body {
  font-size: 0.875rem;
  color: #c8cfe0;
  margin: 0;
  line-height: 1.5;
}

.nc-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.nc-policy-link {
  font-size: 0.82rem;
  color: #d4af37;
  text-decoration: underline;
  white-space: nowrap;
}

.nc-btn {
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.nc-btn-accept {
  background: #d4af37;
  color: #0f1117;
}

.nc-btn-accept:hover {
  opacity: 0.88;
}

.nc-btn-reject {
  background: transparent;
  color: #d4af37;
  border: 2px solid #d4af37;
}

.nc-btn-reject:hover {
  background: rgba(212, 175, 55, 0.12);
}

.nc-btn-custom {
  background: #2a2d3e;
  color: #e2e8f0;
}

.nc-btn-custom:hover {
  background: #323650;
}

/* ── Modal Backdrop ───────────────────────────────────── */
.nc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  animation: nc-fadein 0.2s ease;
}

@keyframes nc-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Modal Box ───────────────────────────────────────── */
#nc-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100000;
}

.nc-modal-box {
  background: #1a1d2e;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  padding: 2rem;
  max-width: 480px;
  width: 90vw;
  position: relative;
  animation: nc-modal-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes nc-modal-in {
  from {
    opacity: 0;
    transform: translate(-50%, -52%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.nc-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #8892a4;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
}

.nc-modal-close:hover {
  color: #e2e8f0;
}

.nc-modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #d4af37;
  margin: 0 0 1.5rem 0;
}

/* ── Toggle Rows ─────────────────────────────────────── */
.nc-toggles {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.nc-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nc-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nc-toggle-label {
  font-size: 0.9rem;
  color: #e2e8f0;
  font-weight: 500;
}

.nc-toggle-sub {
  font-size: 0.75rem;
  color: #8892a4;
}

/* ── CSS Toggle Switch ───────────────────────────────── */
.nc-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.nc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.nc-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #2a2d3e;
  border-radius: 24px;
  transition: background 0.25s;
}

.nc-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #8892a4;
  border-radius: 50%;
  transition: transform 0.25s, background 0.25s;
}

/* Checked (on) state */
.nc-switch input:checked + .nc-slider {
  background: #d4af37;
}

.nc-switch input:checked + .nc-slider::before {
  transform: translateX(20px);
  background: #0f1117;
}

/* Always-on (disabled) state */
.nc-switch-on .nc-slider {
  background: #d4af37;
  cursor: not-allowed;
}

.nc-switch-on .nc-slider::before {
  transform: translateX(20px);
  background: #0f1117;
}

.nc-switch input:disabled + .nc-slider {
  cursor: not-allowed;
}

/* ── Save Button ─────────────────────────────────────── */
.nc-btn-save {
  width: 100%;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  #nc-banner {
    padding: 1rem 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }

  .nc-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.875rem;
  }

  .nc-text {
    flex: none;
    width: 100%;
  }

  .nc-actions {
    width: 100%;
    flex-direction: column;
  }

  .nc-btn {
    width: 100%;
    text-align: center;
  }

  .nc-policy-link {
    width: 100%;
    text-align: center;
    order: -1;
    margin-bottom: -0.25rem;
  }

  .nc-modal-box {
    padding: 1.5rem 1.25rem;
  }
}
