/* ============================================================
   ProLedger Accounting — Cookie consent
   Consent popup · preference centre · reopen button
   Uses the design-system tokens from styles.css
   (navy #00007C, gold #E0CD67, Sora + Plus Jakarta Sans).
   ============================================================ */

.cc-root, .cc-root * { box-sizing: border-box; }
.cc-root {
  font-family: var(--font-body, "Plus Jakarta Sans", "Segoe UI", sans-serif);
  color: var(--ink, #101034);
  letter-spacing: normal;
}
.cc-root [hidden] { display: none !important; }

/* ---------- Consent popup (bottom-left card, above the cookie button) ---------- */
.cc-banner {
  position: fixed; left: 18px; bottom: 80px;
  width: 436px; max-width: calc(100vw - 36px);
  max-height: calc(100vh - 100px); overflow-y: auto;
  z-index: 2147483002;
  background: var(--white, #fff);
  border: 1px solid var(--line, rgba(16, 16, 82, 0.10));
  border-radius: var(--radius-md, 1.1rem);
  padding: 1.5rem 1.6rem 1.6rem;
  box-shadow: var(--shadow-float, 0 40px 90px -40px rgba(10,10,80,.28), 0 12px 28px -14px rgba(10,10,80,.10));
  animation: cc-rise 0.45s var(--ease-out, cubic-bezier(0.32,0.72,0,1)) both;
}
@keyframes cc-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.cc-banner .cc-title { padding-right: 2rem; }
.cc-popup-close { position: absolute; top: 1.15rem; right: 1.15rem; }

.cc-title {
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 1.15rem; line-height: 1.3; font-weight: 600;
  letter-spacing: -0.02em; color: var(--ink, #101034);
  margin: 0 0 0.6rem;
}
.cc-text { font-size: 0.9rem; line-height: 1.65; color: var(--ink-soft, #4b4b6b); margin: 0 0 1.1rem; }
.cc-text a { color: var(--navy, #00007C); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cc-text a:hover { color: var(--gold-ink, #6f5d15); }

/* ---------- Buttons ---------- */
.cc-actions { display: flex; gap: 0.5rem; }
.cc-btn {
  flex: 1 1 auto;
  font-family: inherit; font-size: 0.875rem; font-weight: 600; line-height: 1.4;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--navy, #00007C); border-radius: 999px;
  background: transparent; color: var(--navy, #00007C);
  cursor: pointer; text-align: center;
  transition: background 0.3s var(--ease-out, ease), color 0.3s var(--ease-out, ease),
              transform 0.4s var(--ease-spring, ease), box-shadow 0.3s var(--ease-out, ease);
}
.cc-btn:hover { background: var(--gold-soft, #f7f0d2); }
.cc-btn:active { transform: scale(0.97); }
.cc-btn-primary { background: var(--navy, #00007C); color: var(--white, #fff); }
.cc-btn-primary:hover { background: var(--navy-deep, #000059); border-color: var(--navy-deep, #000059); color: var(--white, #fff); box-shadow: 0 10px 24px -12px rgba(0,0,124,.6); }
.cc-btn-save { background: var(--gold, #E0CD67); border-color: var(--gold, #E0CD67); color: var(--navy, #00007C); }
.cc-btn-save:hover { background: var(--gold-deep, #b89f35); border-color: var(--gold-deep, #b89f35); color: var(--navy, #00007C); }

.cc-btn:focus-visible, .cc-close:focus-visible, .cc-acc-btn:focus-visible,
.cc-more:focus-visible, .cc-switch input:focus-visible + span, .cc-revisit:focus-visible {
  outline: 2px solid var(--navy, #00007C); outline-offset: 2px;
}

.cc-close {
  width: 1.65rem; height: 1.65rem; border: 0; padding: 0; border-radius: 50%;
  background: none; color: var(--ink-mute, #636385);
  cursor: pointer; display: grid; place-items: center;
  transition: background 0.25s var(--ease-out, ease), color 0.25s var(--ease-out, ease);
}
.cc-close:hover { background: var(--cream, #f4f2ea); color: var(--ink, #101034); }
.cc-close svg { width: 0.8rem; height: 0.8rem; }

/* ---------- Preference centre ---------- */
.cc-overlay {
  position: fixed; inset: 0; z-index: 2147483001;
  background: rgba(16, 16, 52, 0.52);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: cc-fade 0.3s var(--ease-out, ease) both;
}
@keyframes cc-fade { from { opacity: 0; } to { opacity: 1; } }

.cc-modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 2147483002;
  width: 820px; max-width: calc(100vw - 2.5rem); max-height: 82vh;
  display: flex; flex-direction: column;
  background: var(--white, #fff);
  border-radius: var(--radius-lg, 1.5rem);
  box-shadow: var(--shadow-float, 0 40px 90px -40px rgba(10,10,80,.28));
  overflow: hidden;
  animation: cc-pop 0.4s var(--ease-spring, cubic-bezier(0.34,1.4,0.44,1)) both;
}
@keyframes cc-pop { from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.cc-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.35rem 1.6rem;
  border-bottom: 1px solid var(--line-soft, rgba(16,16,82,.06));
  background: var(--paper, #fbfaf6);
}
.cc-modal-head .cc-title { margin: 0; padding: 0; }
.cc-modal-body { overflow-y: auto; padding: 1.1rem 1.6rem 0.4rem; }
.cc-modal-body > .cc-text { margin: 0 0 0.9rem; }

.cc-more {
  border: 0; background: none; padding: 0;
  color: var(--navy, #00007C); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.cc-more:hover { color: var(--gold-ink, #6f5d15); }

/* ---------- Category accordions ---------- */
.cc-acc { border-top: 1px solid var(--line-soft, rgba(16,16,82,.06)); padding: 1rem 0; }
.cc-acc-head { display: flex; align-items: center; gap: 0.75rem; }
.cc-acc-btn {
  flex: 1; display: flex; align-items: center; gap: 0.7rem;
  border: 0; background: none; padding: 0; cursor: pointer; text-align: left;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 0.98rem; font-weight: 600; line-height: 1.4;
  color: var(--ink, #101034);
}
.cc-acc-btn:hover { color: var(--navy, #00007C); }
.cc-chev { width: 0.6rem; height: 0.6rem; flex: none; color: var(--gold-deep, #b89f35); transition: transform 0.25s var(--ease-out, ease); }
.cc-acc.open .cc-chev { transform: rotate(90deg); }
.cc-always {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold-ink, #6f5d15); background: var(--gold-soft, #f7f0d2);
  padding: 0.3rem 0.7rem; border-radius: 999px; white-space: nowrap;
}
.cc-acc-des { font-size: 0.875rem; line-height: 1.65; color: var(--ink-soft, #4b4b6b); margin: 0.5rem 0 0 1.3rem; }
.cc-acc-detail {
  margin: 0.65rem 0 0 1.3rem; padding: 0.7rem 0.95rem;
  background: var(--cream, #f4f2ea); border-radius: 0.7rem;
  font-size: 0.825rem; line-height: 1.55; color: var(--ink-soft, #4b4b6b);
}

/* ---------- Toggle switch ---------- */
.cc-switch { position: relative; width: 44px; height: 24px; flex: none; }
.cc-switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.cc-switch span { position: absolute; inset: 0; border-radius: 999px; background: #cfcfdd; transition: background 0.25s var(--ease-out, ease); }
.cc-switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(10,10,80,.3);
  transition: transform 0.25s var(--ease-spring, ease);
}
.cc-switch input:checked + span { background: var(--navy, #00007C); }
.cc-switch input:checked + span::after { transform: translateX(20px); }

.cc-modal-foot {
  display: flex; gap: 0.5rem; padding: 1.2rem 1.6rem;
  border-top: 1px solid var(--line-soft, rgba(16,16,82,.06));
  background: var(--paper, #fbfaf6);
}
.cc-modal-foot .cc-btn { flex: 1; }
.cc-modal-foot .cc-btn-save { flex: 1.3; }

/* ---------- Reopen (cookie) button ---------- */
.cc-revisit {
  position: fixed; left: 18px; bottom: 18px;
  width: 46px; height: 46px; border-radius: 50%; border: 0; padding: 0;
  background: var(--navy, #00007C); color: var(--gold, #E0CD67);
  cursor: pointer; z-index: 2147483003;
  display: grid; place-items: center;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 124, 0.7), 0 3px 10px rgba(10, 10, 80, 0.18);
  transition: transform 0.45s var(--ease-spring, ease), background 0.3s var(--ease-out, ease);
}
.cc-revisit:hover { background: var(--navy-deep, #000059); transform: translateY(-2px) scale(1.05); }
.cc-revisit svg { width: 25px; height: 25px; }

body.cc-modal-open { overflow: hidden; }

/* ---------- Mobile ---------- */
@media (max-width: 575px) {
  .cc-banner { left: 12px; right: 12px; width: auto; bottom: 74px; padding: 1.25rem 1.1rem 1.3rem; }
  .cc-popup-close { top: 0.85rem; right: 0.85rem; }
  .cc-actions { flex-wrap: wrap; }
  .cc-actions .cc-btn { flex: 1 1 calc(50% - 0.25rem); }
  .cc-actions .cc-btn-primary { flex-basis: 100%; order: -1; }
  .cc-modal { width: 100%; max-width: 100vw; height: 100%; max-height: 100%; border-radius: 0; }
  .cc-modal-head, .cc-modal-foot { padding: 1rem 1.1rem; }
  .cc-modal-body { padding: 1rem 1.1rem 0.4rem; }
  .cc-modal-foot { flex-direction: column; }
  .cc-acc-des, .cc-acc-detail { margin-left: 0; }
  .cc-pref-open .cc-revisit { display: none; }
  .cc-revisit { width: 42px; height: 42px; left: 12px; bottom: 12px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-modal, .cc-overlay { animation: none; }
  .cc-btn, .cc-revisit, .cc-chev, .cc-switch span, .cc-switch span::after, .cc-close { transition: none; }
  .cc-revisit:hover { transform: none; }
}
