/* Cookie banner and settings dialog. Mirrors the calculators' cookie-consent
   component (Tailwind) so the two look the same. */

.consent-off .cookie-settings-link { display: none; }
.cc-locked { overflow: hidden; }

.cc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 12px; border-radius: 10px;
  font: 700 15px/1 'Rethink Sans', sans-serif; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.cc-btn:active { transform: scale(.98); }
.cc-btn:focus-visible, .cc-link:focus-visible, .cc-close:focus-visible, .cc-switch:focus-visible, .cc-policy:focus-visible {
  outline: 2px solid #186faf; outline-offset: 2px;
}
.cc-btn-primary { background: #0a558c; color: #fff; border: 0; }
.cc-btn-primary:hover { background: #003e6b; }
.cc-btn-secondary { background: #fff; color: #0a558c; border: 1.5px solid #0a558c; }
.cc-btn-secondary:hover { background: #f0f4f8; }
.cc-link {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  color: #186faf; font: 600 15px/1.2 'Rethink Sans', sans-serif; text-underline-offset: 2px;
}
.cc-link:hover { text-decoration: underline; }
.cc-policy { color: #186faf; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
@media (min-width: 640px) { .cc-btn { padding: 0 20px; } }

/* ---- banner ---- */
.cc-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px; }
.cc-banner-card {
  margin: 0 auto; max-width: 1040px; max-height: calc(100dvh - 1.5rem); overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 16px;
  box-shadow: 0 24px 70px rgba(0,62,107,.22), 0 8px 24px rgba(0,62,107,.10);
}
.cc-banner-text { min-width: 0; flex: 1; }
.cc-banner-title { margin: 0 0 4px; color: #003e6b; font: 800 16px/1.3 'Rethink Sans', sans-serif; }
.cc-banner-text p { margin: 0; color: #667085; font-size: 13.5px; line-height: 1.5; }
/* Phones: Reject and Accept side by side, Customize as a link under them. */
.cc-banner-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cc-banner-actions .cc-link { grid-column: span 2; order: 3; }
@media (min-width: 480px) {
  .cc-banner-actions { display: flex; align-items: center; gap: 12px; }
  .cc-banner-actions .cc-link { order: 0; margin-right: auto; }
}
@media (min-width: 640px) {
  .cc-banner { padding: 20px; }
  .cc-banner-card { gap: 16px; padding: 20px 28px; }
  .cc-banner-title { font-size: 17px; }
  .cc-banner-text p { font-size: 14px; line-height: 1.55; }
}
@media (min-width: 1024px) {
  .cc-banner-card { flex-direction: row; align-items: center; gap: 32px; }
  .cc-banner-actions { flex-shrink: 0; }
  .cc-banner-actions .cc-link { margin-right: 8px; }
}
/* A phone on its side: drop the title so some of the page stays visible. */
@media (max-height: 480px) { .cc-banner-title { display: none; } }

/* ---- settings dialog ---- */
.cc-overlay { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 12px; }
.cc-backdrop { position: absolute; inset: 0; background: rgba(0,62,107,.8); backdrop-filter: blur(3px); }
.cc-panel {
  position: relative; width: 100%; max-width: 560px; max-height: calc(100dvh - 1.5rem);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 16px; text-align: left;
  box-shadow: 0 24px 70px rgba(0,62,107,.28), 0 8px 24px rgba(0,62,107,.12);
}
.cc-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: none; color: #667085; cursor: pointer;
}
.cc-close:hover { background: #f0f4f8; color: #003e6b; }
.cc-panel-body { min-height: 0; flex: 1; overflow-y: auto; padding: 24px 20px 16px; }
.cc-panel-title { margin: 0 0 8px; padding-right: 32px; color: #003e6b; font: 800 19px/1.3 'Rethink Sans', sans-serif; }
.cc-panel-intro { margin: 0 0 16px; color: #667085; font-size: 14px; line-height: 1.55; }
.cc-list { margin: 0; padding: 0; list-style: none; border: 1px solid #e5e7eb; border-radius: 12px; }
.cc-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px; }
.cc-item + .cc-item { border-top: 1px solid #e5e7eb; }
.cc-item-text { min-width: 0; flex: 1; }
.cc-item-title { margin: 0; color: #003e6b; font-size: 15px; font-weight: 700; }
.cc-always { margin-left: 8px; color: #667085; font-size: 12.5px; font-weight: 600; }
.cc-item-desc { margin: 4px 0 0; color: #667085; font-size: 13px; line-height: 1.5; }
.cc-switch {
  position: relative; flex-shrink: 0; width: 44px; height: 24px; padding: 0; cursor: pointer;
  border: 2px solid transparent; border-radius: 999px; background: #d1d5db; transition: background-color .2s ease;
}
.cc-switch[aria-checked="true"] { background: #186faf; }
.cc-switch:disabled { cursor: not-allowed; opacity: .6; }
.cc-switch-knob {
  position: absolute; top: 0; left: 0; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s ease;
}
.cc-switch[aria-checked="true"] .cc-switch-knob { transform: translateX(20px); }
/* Narrow phones: Save on its own row, Reject and Accept side by side below.
   From 480px (a phone on its side too), one row. */
.cc-panel-actions {
  flex-shrink: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  border-top: 1px solid #e5e7eb; padding: 16px 20px;
}
.cc-panel-actions .cc-save { order: -1; grid-column: span 2; }
@media (min-width: 480px) {
  .cc-panel-actions { display: flex; justify-content: flex-end; gap: 12px; }
  .cc-panel-actions .cc-save { order: 0; }
}
@media (min-width: 640px) {
  .cc-overlay { padding: 20px; }
  .cc-panel { max-height: calc(100dvh - 2.5rem); border-radius: 18px; }
  .cc-panel-body { padding: 32px 32px 20px; }
  .cc-panel-title { font-size: 22px; }
  .cc-panel-intro { margin-bottom: 20px; font-size: 14.5px; }
  .cc-item { gap: 16px; padding: 16px; }
  .cc-item-desc { font-size: 13.5px; }
  .cc-panel-actions { padding: 20px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .cc-btn, .cc-switch, .cc-switch-knob { transition: none; }
}

/* Floating Cookie settings button, bottom-left like the calculators' one.
   Below the banner (30) and the dialog (40). */
.cc-fab {
  position: fixed; left: 16px; bottom: 16px; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 9999px;
  background: var(--navy, #003e6b); color: #fff; cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
  transition: background-color .15s;
}
.cc-fab[hidden] { display: none; }
.cc-fab:hover { background: var(--yale, #0a558c); }
.cc-fab:focus-visible { outline: 2px solid var(--accent, #186faf); outline-offset: 2px; }
.cc-fab svg { width: 24px; height: 24px; }
@media print { .cc-fab { display: none; } }
