/* ============================================================
   JTCS — Cookies Consent UI
   ============================================================ */

.jtcs-cookie-root {
  position: relative;
  z-index: 10050;
}

/* ----- Banner ----- */
.jtcs-cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 920px;
  margin: 0 auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
  pointer-events: none;
}

.jtcs-cookie-banner.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.jtcs-cookie-banner__card {
  position: relative;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--card, #fff);
  color: var(--paragraph, #475569);
  border: 1px solid rgba(15, 76, 129, 0.1);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.jtcs-cookie-banner__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(15, 76, 129, 0.12), rgba(16, 185, 129, 0.15));
  color: #0F4C81;
  font-size: 1.25rem;
}

.jtcs-cookie-banner__title {
  font-family: var(--font-heading, 'Poppins', sans-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--heading, #0F172A);
  margin: 0 0 8px;
}

.jtcs-cookie-banner__text {
  font-size: 0.98rem;
  line-height: 1.65;
  margin: 0 0 16px;
  max-width: 62ch;
}

.jtcs-cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.jtcs-cookie-banner__link {
  font-family: var(--font-heading, 'Poppins', sans-serif);
  font-size: 0.92rem;
  font-weight: 600;
  color: #0F4C81;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: 4px;
}

.jtcs-cookie-banner__link:hover { color: #10B981; }

.jtcs-cookie-banner__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--muted, #94A3B8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, color 0.25s ease;
}

.jtcs-cookie-banner__close:hover {
  background: var(--bg-alt, #F1F5F9);
  color: var(--heading, #0F172A);
}

/* ----- Buttons ----- */
.jtcs-cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 12px;
  font-family: var(--font-heading, 'Poppins', sans-serif);
  font-size: 0.92rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.jtcs-cookie-btn:hover { transform: translateY(-1px); }

.jtcs-cookie-btn--primary {
  background: linear-gradient(135deg, #0F4C81, #10B981);
  color: #fff;
}

.jtcs-cookie-btn--primary:hover { filter: brightness(1.05); }

.jtcs-cookie-btn--outline {
  background: transparent;
  border-color: rgba(15, 76, 129, 0.25);
  color: #0F4C81;
}

.jtcs-cookie-btn--outline:hover {
  border-color: #0F4C81;
  background: rgba(15, 76, 129, 0.06);
}

.jtcs-cookie-btn--ghost {
  background: var(--bg-alt, #F1F5F9);
  color: var(--heading, #0F172A);
}

.jtcs-cookie-btn--ghost:hover { background: #E2E8F0; }

/* ----- Modal ----- */
.jtcs-cookie-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.jtcs-cookie-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.jtcs-cookie-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}

.jtcs-cookie-modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  background: var(--card, #fff);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.jtcs-cookie-modal.is-open .jtcs-cookie-modal__panel {
  transform: translateY(0) scale(1);
}

.jtcs-cookie-modal__header,
.jtcs-cookie-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
}

.jtcs-cookie-modal__header {
  border-bottom: 1px solid rgba(15, 76, 129, 0.08);
}

.jtcs-cookie-modal__header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-family: var(--font-heading, 'Poppins', sans-serif);
  color: var(--heading, #0F172A);
}

.jtcs-cookie-modal__close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--muted, #94A3B8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.jtcs-cookie-modal__close:hover {
  background: var(--bg-alt, #F1F5F9);
  color: var(--heading, #0F172A);
}

.jtcs-cookie-modal__body { padding: 8px 22px 10px; }

.jtcs-cookie-modal__intro {
  font-size: 0.98rem;
  line-height: 1.6;
  margin: 8px 0 18px;
  color: var(--paragraph, #475569);
}

.jtcs-cookie-modal__footer {
  border-top: 1px solid rgba(15, 76, 129, 0.08);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.jtcs-cookie-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(15, 76, 129, 0.06);
}

.jtcs-cookie-row:last-child { border-bottom: none; }

.jtcs-cookie-row__text h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-family: var(--font-heading, 'Poppins', sans-serif);
  color: var(--heading, #0F172A);
}

.jtcs-cookie-row__text p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--paragraph, #475569);
}

/* Toggle switch */
.jtcs-cookie-switch {
  position: relative;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
  cursor: pointer;
}

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

.jtcs-cookie-switch__ui {
  position: absolute;
  inset: 0;
  background: #CBD5E1;
  border-radius: 999px;
  transition: background 0.25s ease;
}

.jtcs-cookie-switch__ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  transition: transform 0.25s ease;
}

.jtcs-cookie-switch input:checked + .jtcs-cookie-switch__ui {
  background: linear-gradient(135deg, #0F4C81, #10B981);
}

.jtcs-cookie-switch input:checked + .jtcs-cookie-switch__ui::after {
  transform: translateX(22px);
}

.jtcs-cookie-switch.is-locked {
  cursor: not-allowed;
  opacity: 0.85;
}

.jtcs-cookie-switch.is-locked .jtcs-cookie-switch__ui {
  background: #10B981;
}

.jtcs-cookie-switch.is-locked .jtcs-cookie-switch__ui::after {
  transform: translateX(22px);
}

body.jtcs-cookie-modal-open { overflow: hidden; }

[data-theme="dark"] .jtcs-cookie-banner__card,
[data-theme="dark"] .jtcs-cookie-modal__panel {
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .jtcs-cookie-btn--ghost {
  background: #1F2937;
  color: #F1F5F9;
}

[data-theme="dark"] .jtcs-cookie-btn--outline {
  color: #93C5FD;
  border-color: rgba(147, 197, 253, 0.35);
}

[data-theme="dark"] .jtcs-cookie-banner__link { color: #93C5FD; }

@media (max-width: 768px) {
  .jtcs-cookie-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .jtcs-cookie-banner__card {
    flex-direction: column;
    padding: 18px 16px 16px;
    border-radius: 18px;
  }

  .jtcs-cookie-banner__actions {
    width: 100%;
  }

  .jtcs-cookie-banner__actions .jtcs-cookie-btn {
    flex: 1 1 100%;
  }

  .jtcs-cookie-modal__footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .jtcs-cookie-modal__footer .jtcs-cookie-btn {
    width: 100%;
  }

  .jtcs-cookie-row {
    align-items: flex-start;
  }
}

/* Keep above float buttons / back-to-top on small screens */
@media (max-width: 1024px) {
  .jtcs-cookie-banner.is-visible {
    bottom: 88px;
  }
}
