/* Cookie Consent — compact UI, dark mode, mobile polish */

/* ---------- Theme tokens ---------- */
:root {
  --lcc-bg: #ffffff;
  --lcc-text: #1f2937;     /* gray-800 */
  --lcc-muted: #6b7280;    /* gray-500 */
  --lcc-btn-acc-bg: #2563eb;  /* blue-600 */
  --lcc-btn-acc-bg-h: #1d4ed8;/* blue-700 */
  --lcc-btn-dec-bg: #e5e7eb;  /* gray-200 */
  --lcc-btn-dec-tx: #1f2937;  /* gray-800 */
  --lcc-btn-dec-bg-h: #d1d5db;/* gray-300 */
  --lcc-overlay: rgba(0,0,0,.55);
  --lcc-radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --lcc-bg: #0b0b10;
    --lcc-text: #e5e7eb;     /* gray-200 */
    --lcc-muted: #9ca3af;    /* gray-400 */
    --lcc-btn-acc-bg: #3b82f6; /* blue-500 */
    --lcc-btn-acc-bg-h: #2563eb;/* blue-600 */
    --lcc-btn-dec-bg: #111827;  /* gray-900 */
    --lcc-btn-dec-tx: #e5e7eb;  /* gray-200 */
    --lcc-btn-dec-bg-h: #1f2937;/* gray-800 */
    --lcc-overlay: rgba(0,0,0,.65);
  }
}

/* Tailwind .dark support */
.dark :root, .dark {
  --lcc-bg: #0b0b10;
  --lcc-text: #e5e7eb;
  --lcc-muted: #9ca3af;
  --lcc-btn-acc-bg: #3b82f6;
  --lcc-btn-acc-bg-h: #2563eb;
  --lcc-btn-dec-bg: #111827;
  --lcc-btn-dec-tx: #e5e7eb;
  --lcc-btn-dec-bg-h: #1f2937;
  --lcc-overlay: rgba(0,0,0,.65);
}

/* ---------- Layering ---------- */

.lcc-backdrop{
  background:rgba(0,0,0,.6);
  bottom:0;
  left:0;
  position:fixed;
  right:0;
  top:0;
  transition:opacity .2s ease-in-out;z-index:10000
}

.lcc-modal,
.lcc-modal.lcc-modal--settings {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 2147483647 !important;
}

/* ---------- Card ---------- */
.lcc-modal,
.lcc-modal.lcc-modal--settings {
  background: var(--lcc-bg) !important;
  color: var(--lcc-text) !important;
  border-radius: var(--lcc-radius) !important;
  box-shadow: 0 20px 40px rgba(0,0,0,.20) !important;
  padding: 18px !important;
  max-width: 32rem !important; /* ~512px */
  width: 90vw !important;
  max-height: 90dvh !important;
  overflow: auto !important;
}

/* ---------- Title & sections ---------- */
.lcc-modal .lcc-modal__title {
  font-weight: 700 !important;
  font-size: 1.1rem !important;
  line-height: 1.35 !important;
  margin: 0 0 .75rem !important;
  padding-right: 2.25rem !important; /* room for X */
}

.lcc-modal .lcc-modal__section { margin: 0 0 .75rem !important; }
.lcc-modal .lcc-modal__section:last-child { margin-bottom: 0 !important; }

/* ---------- Typography ---------- */
.lcc-text {
  color: var(--lcc-text) !important;
  font-size: .9rem !important;
  line-height: 1.45 !important;
  opacity: .95;
  margin: 0 0 .75rem !important;
}
.lcc-modal .lcc-modal__section .lcc-text,
.lcc-label {
  color: var(--lcc-muted) !important;
  font-size: .85rem !important;
}

/* ---------- Close button (X) ---------- */
.lcc-modal .lcc-modal__close {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  left: auto !important;
  transform: none !important;
  width: 30px !important;
  height: 30px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 32px !important;
}
.lcc-modal .lcc-modal__close:hover,
.lcc-modal .lcc-modal__close:focus-visible {
  color: var(--lcc-btn-acc-bg-h) !important;
  outline: none !important;
}

/* ---------- Actions row ---------- */
.lcc-modal .lcc-modal__actions {
  display: flex !important;
  gap: .5rem !important;
  margin-top: .75rem !important;
  /* Desktop: keep on one line */
  flex-wrap: nowrap !important;
}
.lcc-modal .lcc-modal__actions > * {
  margin-top: 0 !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

/* ---------- Buttons ---------- */
.lcc-button {
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: .875rem !important;   /* smaller */
  padding: 7px 12px !important;    /* smaller */
  min-height: 36px !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  cursor: pointer !important;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease !important;
}

/* Primary */
.lcc-button:not(.lcc-button--ghost):not(.lcc-button--link) {
  background-color: var(--lcc-btn-acc-bg) !important;
  border-color: var(--lcc-btn-acc-bg) !important;
  color: #fff !important;
}
.lcc-button:not(.lcc-button--ghost):not(.lcc-button--link):hover,
.lcc-button:not(.lcc-button--ghost):not(.lcc-button--link):focus {
  background-color: var(--lcc-btn-acc-bg-h) !important;
  border-color: var(--lcc-btn-acc-bg-h) !important;
}

/* Ghost / decline */
.lcc-button.lcc-button--ghost {
  background-color: var(--lcc-btn-dec-bg) !important;
  border-color: var(--lcc-btn-dec-bg) !important;
  color: var(--lcc-btn-dec-tx) !important;
}
.lcc-button.lcc-button--ghost:hover,
.lcc-button.lcc-button--ghost:focus {
  background-color: var(--lcc-btn-dec-bg-h) !important;
  border-color: var(--lcc-btn-dec-bg-h) !important;
  color: var(--lcc-btn-dec-tx) !important;
}

/* Link / settings */
.lcc-button.lcc-button--link {
  color: var(--lcc-btn-acc-bg) !important;
  background: transparent !important;
  border: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-decoration: underline !important;
}
.lcc-button.lcc-button--link:hover,
.lcc-button.lcc-button--link:focus {
  color: var(--lcc-btn-acc-bg-h) !important;
  text-decoration: none !important;
}

/* ---------- Focus states ---------- */
.lcc-button:focus-visible {
  outline: 2px solid var(--lcc-btn-acc-bg) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

/* ---------- Mobile polish ---------- */
@media (max-width: 480px) {
  .lcc-modal {
    width: calc(100vw - 2rem) !important;
    max-height: calc(100dvh - 2rem) !important;
    padding: 1rem !important;
    border-radius: 12px !important;
  }
  .lcc-modal .lcc-modal__title {
    font-size: 1rem !important;
    margin-bottom: .5rem !important;
  }
  .lcc-text { font-size: .875rem !important; }
  /* Mobile: stack actions full-width */
  .lcc-modal .lcc-modal__actions {
    flex-wrap: wrap !important;
    justify-content: stretch !important;
  }
  .lcc-modal .lcc-modal__actions > .lcc-button {
    flex: 1 1 100% !important;
  }
}
