/* ==========================================================================
   IYS — GDPR / ePrivacy consent banner, preference panel and legal modals
   ========================================================================== */

/* ==========================================================================
   CONSENT BANNER
   ========================================================================== */
.consent{
  position:fixed; inset:auto 0 0 0; z-index:300;
  display:none;
  padding:20px var(--gutter) calc(20px + env(safe-area-inset-bottom));
  background:var(--navy-deep);
  color:var(--secondary-fixed-dim);
  border-top:2px solid var(--gold);
  box-shadow:0 -8px 40px rgba(8,26,51,0.35);
}
.consent.is-open{ display:block; }

.consent__inner{
  display:flex; flex-wrap:wrap; align-items:center; gap:24px;
  max-width:var(--max-width); margin:0 auto;
}
.consent__copy{ flex:1 1 420px; }
.consent__copy h2{
  color:var(--white);
  font-size:var(--text-card-title);
  margin-bottom:8px;
}
.consent__copy p{ font-size:var(--text-body-sm); line-height:1.6; }
.consent__copy a{ color:var(--gold-light); text-decoration:underline; text-underline-offset:2px; }

/* A button that has to read as a link inside running text. */
.linkish{
  background:none; border:none; padding:0;
  font:inherit; color:var(--gold-light);
  text-decoration:underline; text-underline-offset:2px;
  cursor:pointer;
}
.linkish:hover{ color:var(--white); }

.consent__actions{
  display:flex; flex-wrap:wrap; gap:10px; align-items:center;
  flex:0 1 auto;
}
/* Accept and reject must carry equal visual weight — an "accept" that is
   easier to click than "reject" is not valid consent under the GDPR, and an
   outlined reject next to a filled accept is the exact pattern the EDPB
   calls out. Both are solid, same size, same contrast; only "Preferences"
   is allowed to recede. */
.consent__actions .btn{ min-width:168px; }

.btn--silver{
  background:var(--white);
  color:var(--navy-deep);
  border-color:var(--white);
}
.btn--silver:hover{ background:var(--surface-container-highest); border-color:var(--surface-container-highest); }

@media (max-width:720px){
  .consent__actions{ width:100%; }
  .consent__actions .btn{ flex:1 1 100%; }
}

/* ==========================================================================
   MODALS (preferences, privacy notice, legal notice)
   ========================================================================== */
.modal{
  position:fixed; inset:0; z-index:400;
  display:none;
  align-items:center; justify-content:center;
  padding:24px;
  background:rgba(8,26,51,0.72);
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
}
.modal.is-open{ display:flex; }

.modal__panel{
  position:relative;
  display:flex; flex-direction:column;
  width:100%; max-width:760px; max-height:88vh;
  background:var(--white);
  border-radius:var(--radius-panel);
  box-shadow:0 24px 70px rgba(8,26,51,0.4);
  overflow:hidden;
}

.modal__head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:20px;
  padding:28px 32px 20px;
  border-bottom:1px solid var(--border);
}
.modal__head h2{ font-size:var(--text-headline-md); }
.modal__head .eyebrow{ margin-bottom:8px; }

.modal__close{
  display:flex; align-items:center; justify-content:center;
  width:40px; height:40px; flex-shrink:0;
  background:var(--surface-container);
  border:none; border-radius:var(--radius-full);
  color:var(--navy); cursor:pointer;
  transition:background var(--dur) var(--ease);
}
.modal__close:hover{ background:var(--surface-container-highest); }

.modal__body{
  padding:26px 32px;
  overflow-y:auto;
  font-size:var(--text-body-sm);
  line-height:1.7;
  color:var(--on-surface-variant);
}
.modal__body h3{
  font-size:16px;
  margin:26px 0 8px;
  color:var(--navy);
}
.modal__body h3:first-child{ margin-top:0; }
.modal__body p{ margin-bottom:12px; }
.modal__body ul{ margin:0 0 14px 20px; list-style:disc; }
.modal__body li{ margin-bottom:6px; }
.modal__body a{ color:var(--navy); text-decoration:underline; text-underline-offset:2px; }
.modal__body dl{ margin:0 0 14px; }
.modal__body dt{ font-weight:700; color:var(--navy); margin-top:10px; }
.modal__body dd{ margin:0 0 6px; }

.modal__foot{
  display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end;
  padding:20px 32px;
  border-top:1px solid var(--border);
  background:var(--surface-container-low);
}

@media (max-width:620px){
  .modal{ padding:0; }
  .modal__panel{ max-width:none; max-height:100vh; height:100%; border-radius:0; }
  .modal__head,.modal__body,.modal__foot{ padding-left:20px; padding-right:20px; }
  .modal__foot .btn{ flex:1 1 100%; }
}

/* ==========================================================================
   CONSENT CATEGORY TOGGLES
   ========================================================================== */
.consent-cat{
  display:flex; align-items:flex-start; gap:16px;
  padding:18px 0;
  border-bottom:1px solid var(--border);
}
.consent-cat:last-child{ border-bottom:none; }
.consent-cat__text{ flex:1; }
.consent-cat__text h3{ margin:0 0 4px; font-size:15px; }
.consent-cat__text p{ margin:0; font-size:var(--text-body-sm); color:var(--mute); }

/* Switch */
.switch{ position:relative; flex-shrink:0; width:48px; height:28px; }
.switch input{
  position:absolute; inset:0; margin:0; padding:0;
  width:100%; height:100%; opacity:0; cursor:pointer;
}
.switch__track{
  position:absolute; inset:0;
  background:var(--outline-variant);
  border-radius:var(--radius-full);
  transition:background var(--dur) var(--ease);
  pointer-events:none;
}
.switch__track::after{
  content:''; position:absolute; top:3px; left:3px;
  width:22px; height:22px;
  background:var(--white);
  border-radius:50%;
  box-shadow:0 1px 3px rgba(0,0,0,0.25);
  transition:transform var(--dur) var(--ease);
}
.switch input:checked + .switch__track{ background:var(--success); }
.switch input:checked + .switch__track::after{ transform:translateX(20px); }
.switch input:disabled + .switch__track{ background:var(--secondary); opacity:.55; }
.switch input:disabled{ cursor:not-allowed; }
.switch input:focus-visible + .switch__track{ outline:2px solid var(--gold); outline-offset:2px; }

/* ==========================================================================
   FORM CONSENT CHECKBOX
   ========================================================================== */
.consent-check{
  display:flex; align-items:flex-start; gap:12px;
  margin:4px 0 20px;
}
.consent-check input[type="checkbox"]{
  width:20px; height:20px; flex-shrink:0;
  margin:1px 0 0;
  padding:0;
  accent-color:var(--navy);
  cursor:pointer;
}
.consent-check label{
  margin:0;
  font-size:var(--text-body-sm);
  font-weight:400;
  line-height:1.6;
  letter-spacing:0;
  text-transform:none;
  color:var(--mute);
  cursor:pointer;
}
.consent-check a{
  color:var(--navy); font-weight:600;
  text-decoration:underline; text-underline-offset:2px;
}
.consent-check input[aria-invalid="true"]{ outline:2px solid var(--error); outline-offset:2px; }

/* ==========================================================================
   FOOTER LEGAL ROW
   ========================================================================== */
.footer-legal{
  display:flex; flex-wrap:wrap; gap:18px;
  padding-top:20px;
}
.footer-legal button{
  background:none; border:none; padding:0; cursor:pointer;
  font-size:12px;
  color:var(--secondary-fixed-dim);
  text-decoration:underline; text-underline-offset:3px;
  transition:color var(--dur) var(--ease);
}
.footer-legal button:hover{ color:var(--gold-light); }

/* Stop the page scrolling behind an open modal. */
body.has-modal{ overflow:hidden; }
