/* Cookie consent for the static pages. Same modal as components/consent/, styles from app/globals.css. */
.consent-modal {
  --blue: #0A5ADB;
  --blue-hover: #1A6BE5;
  --v2-mono: 'Barlow', 'Helvetica Neue', sans-serif;
  margin: 0;
  border: none;
  color: #0D0D0D;
}
.consent-modal::backdrop { background: rgba(7, 24, 48, 0.65); }

.consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--v2-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
  min-height: 40px;
  padding: 0 18px;
  text-decoration: none;
}
.consent-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* Accept — filled blue */
.consent-btn-accept { background: var(--blue); color: #fff; }
.consent-btn-accept:hover { background: var(--blue-hover); }

/* Reject — filled dark navy, equal visual weight to Accept */
.consent-btn-reject { background: #071830; color: #fff; }
.consent-btn-reject:hover { background: #0e2845; }

/* Save preferences — outlined, secondary weight (used in preferences panel) */
.consent-btn-save { background: transparent; color: #1A1A1A; border: 1.5px solid #D1D5DB; }
.consent-btn-save:hover { border-color: #1A1A1A; }

/* Text link — Manage preferences */
.consent-btn-text {
  background: transparent;
  color: #5C5A57;
  padding: 0 10px;
  border: none;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 40px;
}
.consent-btn-text:hover { color: #0D0D0D; }

/* Footer trigger */

/* Overlay — shared between first-visit modal and preferences panel */
.consent-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(7, 24, 48, 0.65);
  animation: consent-fade-in 0.2s ease;
}

@keyframes consent-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Modal shell — shared */
.consent-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 401;
  width: min(480px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(7, 24, 48, 0.28), 0 4px 16px rgba(7, 24, 48, 0.12);
  padding: 32px;
  animation: consent-modal-in 0.22s ease;
}

@keyframes consent-modal-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* First-visit modal — slightly wider, larger title */
.consent-modal--first {
  width: min(520px, calc(100vw - 40px));
}
.consent-modal--first .consent-modal-title { font-size: 20px; }

/* Shared modal header */
.consent-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.consent-modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0D0D0D;
  margin: 0;
  line-height: 1.25;
}

.consent-modal-close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #5C5A57;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 32px;
  min-height: 32px;
  transition: background 0.15s ease, color 0.15s ease;
}
.consent-modal-close:hover { background: #F5F5F3; color: #0D0D0D; }
.consent-modal-close:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* First-visit modal body copy */
.consent-first-body {
  font-size: 15px;
  line-height: 1.65;
  color: #3D3A37;
  margin: 0 0 28px;
}

/* First-visit modal action row */
.consent-first-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Preferences modal description */
.consent-modal-desc {
  font-size: 14px;
  line-height: 1.6;
  color: #5C5A57;
  margin: 0 0 20px;
}

/* Category rows */
.consent-categories {
  display: flex;
  flex-direction: column;
  border: 1px solid #E8E3D6;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}

.consent-category {
  padding: 16px 18px;
  border-bottom: 1px solid #E8E3D6;
}
.consent-category:last-child { border-bottom: none; }

.consent-category-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.consent-category-info { flex: 1; }

.consent-category-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #0D0D0D;
  margin-bottom: 4px;
  cursor: default;
}
label.consent-category-label { cursor: pointer; }

.consent-category-desc {
  font-size: 13px;
  line-height: 1.55;
  color: #5C5A57;
  margin: 0;
}

.consent-always-active {
  font-family: var(--v2-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2A7A2A;
  white-space: nowrap;
  padding-top: 2px;
  flex-shrink: 0;
}

/* Switch */
.consent-switch-root {
  position: relative;
  width: 44px;
  height: 24px;
  background: #D1D5DB;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
  outline: none;
}
.consent-switch-root[data-state="checked"] { background: var(--blue); }
.consent-switch-root:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.consent-switch-thumb {
  display: block;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
}
.consent-switch-root[data-state="checked"] .consent-switch-thumb { transform: translateX(20px); }

/* Preferences panel actions */
.consent-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.consent-modal-note {
  font-size: 12px;
  color: #8A8780;
  margin: 16px 0 0;
  line-height: 1.55;
}

/* Responsive */
@media (max-width: 640px) {
  .consent-modal { padding: 24px 20px; width: calc(100vw - 24px); }
  .consent-modal--first { width: calc(100vw - 24px); }
  .consent-first-actions { flex-direction: column; align-items: stretch; }
  .consent-first-actions .consent-btn { width: 100%; justify-content: center; }
  .consent-modal-actions { flex-direction: column; align-items: stretch; }
  .consent-modal-actions .consent-btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .consent-modal-overlay,
  .consent-modal,
  .consent-switch-root,
  .consent-switch-thumb,
  .consent-btn { animation: none; transition: none; }
}
