/* ============================================================
   Morley Management Group — Cookie consent

   Banner + preferences dialog. Nothing here is decorative for its
   own sake: the banner has to be noticeable without hijacking the
   page, and "Reject" has to be exactly as easy to reach as
   "Accept", which is a legal requirement, not a style choice.
   ============================================================ */

.consent {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-toast);
  padding: var(--gutter-x);
  pointer-events: none;
}
.consent[hidden] { display: none; }

.consent__panel {
  pointer-events: auto;
  max-width: var(--shell);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 0.6rem + 2.4vw, 2.5rem);
  flex-wrap: wrap;
  background: rgba(10, 28, 54, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(241, 157, 106, 0.3);
  border-top: 3px solid var(--copper-500);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(4, 12, 26, 0.55);
  padding: clamp(1.25rem, 0.8rem + 1.6vw, 1.75rem);
  color: rgba(255, 255, 255, 0.82);
}

.js .consent__panel {
  transform: translateY(16px);
  opacity: 0;
  transition:
    transform var(--duration-slow) var(--ease-out),
    opacity var(--duration-slow) var(--ease-out);
}
.js .consent.is-in .consent__panel { transform: none; opacity: 1; }

.consent__copy { flex: 1 1 380px; min-width: 0; }
.consent__title {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--copper-300);
  margin: 0 0 var(--space-2);
}
.consent__copy p {
  font-size: var(--step--1);
  line-height: 1.55;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}
.consent__copy a { color: var(--copper-300); border-bottom: 1px solid rgba(241, 157, 106, 0.45); }
.consent__copy a:hover { color: #fff; border-bottom-color: #fff; }

.consent__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  flex: 0 0 auto;
}
/* Reject is a peer of Accept, not a hidden link */
.consent__actions .btn { flex: 1 1 auto; min-width: 132px; }

/* ---- Preferences dialog ------------------------------------ */
.consent-dialog {
  width: min(560px, calc(100vw - 2 * var(--gutter-x)));
  max-height: min(86vh, 720px);
  padding: 0;
  border: 1px solid rgba(241, 157, 106, 0.28);
  border-radius: var(--radius-lg);
  background: var(--navy-950);
  color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 30px 80px rgba(4, 12, 26, 0.6);
  overflow: hidden;
}
.consent-dialog::backdrop {
  background: rgba(6, 16, 32, 0.72);
  backdrop-filter: blur(3px);
}
.consent-dialog__inner {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}
.consent-dialog__head {
  padding: var(--space-6) var(--space-6) var(--space-5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.consent-dialog__head h2 {
  font-size: var(--step-2);
  font-weight: var(--weight-extra);
  color: #fff;
  margin: 0 0 var(--space-2);
}
.consent-dialog__head p {
  font-size: var(--step--1);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}
.consent-dialog__body {
  padding: var(--space-5) var(--space-6);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.consent-dialog__foot {
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.consent-dialog__foot .btn { flex: 1 1 auto; }

/* ---- One category ------------------------------------------ */
.consent-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-5);
  align-items: start;
}
.consent-group h3 {
  font-size: var(--step-0);
  font-weight: var(--weight-bold);
  color: #fff;
  margin: 0;
}
.consent-group p {
  grid-column: 1 / -1;
  font-size: var(--step--1);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.66);
  margin: 0;
}
.consent-group__locked {
  font-family: var(--font-display);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--copper-300);
  white-space: nowrap;
  padding-top: 4px;
}

/* ---- Switch ------------------------------------------------- */
.switch { position: relative; display: inline-flex; flex: none; }
.switch input {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch span {
  display: block;
  width: 46px; height: 26px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition:
    background-color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard);
}
.switch span::after {
  content: "";
  position: absolute;
  top: 4px; left: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--duration-base) var(--ease-standard);
}
.switch input:checked + span {
  background: var(--copper-500);
  border-color: var(--copper-400);
}
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span {
  outline: 2px solid var(--copper-300);
  outline-offset: 3px;
}

/* ---- Footer entry point ------------------------------------- */
.consent-open {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  position: relative;
  transition: color var(--duration-fast) var(--ease-standard);
}
.consent-open::before {
  content: "";
  display: inline-block;
  width: 4px; height: 4px;
  margin: 0 12px 2px 0;
  transform: rotate(45deg);
  background: var(--copper-400);
}
.consent-open:hover { color: var(--copper-300); }

/* Inline button inside the privacy policy prose */
.consent-open--inline {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 22px;
  margin-top: var(--space-2);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy-800);
  transition:
    border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard),
    background-color var(--duration-fast) var(--ease-standard);
}
.consent-open--inline::before { display: none; }
.consent-open--inline:hover {
  border-color: var(--copper-500);
  color: var(--copper-700);
  background: rgba(177, 83, 38, 0.05);
}

/* Current state, shown next to the inline button */
.consent-state {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-3);
}
.consent-state:empty { display: none; }

@media (max-width: 720px) {
  .consent__panel { align-items: stretch; }
  .consent__actions { width: 100%; }
  .consent__actions .btn { flex: 1 1 100%; }
  .consent-dialog__foot { flex-direction: column-reverse; }
}
