/* =========================================================================
   DISCLAIMER FÜR FACHKREISE
   Nur auf Seiten mit Disclaimer geladen (includes/disclaimer.php). Aufbau wie
   das Fenster auf ckm-guidelines.org, Farben aus den Theme-Tokens.

   Ob das Fenster erscheint, entscheidet ein Skript im <head>:
   html.sciarc-dc-ok   → bestätigt, Fenster aus
   html.sciarc-dc-open → offen, Seite dahinter gesperrt
   Ohne JavaScript bleibt das Fenster stehen.
   ========================================================================= */

html.sciarc-dc-open,
html.sciarc-dc-open body { overflow: hidden; }

html.sciarc-dc-ok .sciarc-dc { display: none; }

.sciarc-dc {
  position: fixed;
  inset: 0;
  z-index: 100000;
  /* minmax(0,1fr): sonst wächst die Spalte auf die Breite der Karte und das
     Fenster läuft auf schmalen Bildschirmen über. */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, var(--az-ink) 58%, transparent);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  overscroll-behavior: contain;
  animation: sciarc-dc-fade .22s ease both;
}

.sciarc-dc__card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  max-height: min(92vh, 900px);
  background: var(--az-surface);
  border-radius: var(--az-r-xl);
  box-shadow: var(--az-shadow-panel);
  overflow: hidden;
  animation: sciarc-dc-rise .28s cubic-bezier(.2, .8, .2, 1) both;
}
.sciarc-dc__card:focus { outline: none; }

/* Zwei Ansichten (Disclaimer / abgelehnt) — die sichtbare ist die Spalte aus
   Kopf, scrollbarem Text und Buttons. */
.sciarc-dc__view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sciarc-dc__view[hidden] { display: none; }

/* ---------- Kopf ---------- */
.sciarc-dc__head {
  flex-shrink: 0;
  padding: 30px 36px 24px;
  text-align: center;
  background: var(--az-tint);
  border-bottom: 1px solid var(--az-line-soft);
}
.sciarc-dc__logo {
  display: block;
  height: 52px;
  width: auto;
  margin: 0 auto 20px;
}
.sciarc-dc__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  font-family: var(--az-font-display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--az-primary);
}
.sciarc-dc__eyebrow::before,
.sciarc-dc__eyebrow::after {
  content: "";
  flex-shrink: 0;
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--az-primary);
  opacity: .55;
}
.sciarc-dc__title {
  margin: 0;
  font-family: var(--az-font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--az-ink);
}

/* ---------- Text ---------- */
.sciarc-dc__body {
  flex: 1 1 auto;
  /* Ohne min-height:0 schrumpft der Text nicht unter seine Höhe und schiebt
     Kopf und Buttons aus dem Fenster. */
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 26px 36px 4px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--az-ink-2);
}
.sciarc-dc__body:focus-visible { outline: 2px solid var(--az-primary); outline-offset: -4px; }
.sciarc-dc__body p { margin: 0 0 16px; }
.sciarc-dc__body strong { font-weight: 700; color: var(--az-ink); }
/* Hervorgehobener Hinweis (UK) — an der Stelle der früheren Länderliste,
   in der Markenfarbe getönt wie damals die Box in Teal. */
.sciarc-dc__notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 16px;
  padding: 16px 20px;
  background: var(--az-brand-50);
  border: 1px solid var(--az-brand-100);
  border-radius: var(--az-r-md);
  font-weight: 600;
  color: var(--az-ink);
}
.sciarc-dc__notice svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--az-primary);
}
.sciarc-dc__body .sciarc-dc__notice p { margin: 0; }

.sciarc-dc__confirm { color: var(--az-ink); }

/* ---------- Buttons ---------- */
.sciarc-dc__actions {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px 36px 28px;
  background: var(--az-surface);
  border-top: 1px solid var(--az-line-soft);
  /* Deutet an, dass der Text darüber weiterläuft. */
  box-shadow: 0 -12px 18px -16px color-mix(in srgb, var(--az-ink) 45%, transparent);
}
.sciarc-dc__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 15px 18px;
  font-family: var(--az-font-body);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.sciarc-dc__btn svg { flex-shrink: 0; }
.sciarc-dc__btn:active { transform: translateY(1px); }
.sciarc-dc__btn:focus-visible { outline: 2px solid var(--az-ink); outline-offset: 2px; }

/* Der Link zu sciarc.de ist ein <a> — Kadence färbt a:focus/a:hover um,
   deshalb die Zustände ausdrücklich. */
.sciarc-dc .sciarc-dc__btn--yes,
.sciarc-dc .sciarc-dc__btn--yes:visited,
.sciarc-dc .sciarc-dc__btn--yes:focus {
  background: var(--az-primary);
  color: var(--az-surface);
}
.sciarc-dc .sciarc-dc__btn--yes:hover {
  background: var(--az-primary-hover);
  color: var(--az-surface);
}

.sciarc-dc__btn--no {
  background: var(--az-surface);
  border-color: var(--az-line-strong);
  color: var(--az-ink-2);
}
.sciarc-dc__btn--no:hover {
  background: var(--az-tint);
  border-color: var(--az-muted-2);
  color: var(--az-ink);
}

.sciarc-dc__noscript {
  margin: 0;
  padding: 0 36px 24px;
  font-size: 13px;
  color: var(--az-ink-2);
}

/* ---------- Abgelehnt ---------- */
.sciarc-dc__view--declined {
  display: block;
  overflow-y: auto;
  padding: 44px 40px 40px;
  text-align: center;
}
.sciarc-dc__declined-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--az-gold-50);
  color: var(--az-ink);
}
.sciarc-dc__declined-title {
  margin: 0 0 12px;
  font-family: var(--az-font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.015em;
  color: var(--az-ink);
}
.sciarc-dc__declined-text {
  max-width: 44ch;
  margin: 0 auto 26px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--az-muted);
}
.sciarc-dc__back {
  display: block;
  margin: 18px auto 0;
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--az-font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--az-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.sciarc-dc__back:hover { color: var(--az-primary-hover); }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 620px) {
  .sciarc-dc { padding: 12px; }
  .sciarc-dc__card { max-height: 94vh; border-radius: var(--az-r-lg); }
  .sciarc-dc__head { padding: 24px 22px 20px; }
  .sciarc-dc__logo { height: 42px; margin-bottom: 14px; }
  /* Ohne die Striche passt die Zeile auf eine Breite von 390px. */
  .sciarc-dc__eyebrow { letter-spacing: .12em; }
  .sciarc-dc__eyebrow::before,
  .sciarc-dc__eyebrow::after { display: none; }
  .sciarc-dc__title { font-size: 21px; }
  .sciarc-dc__body { padding: 20px 22px 4px; font-size: 13px; }
  .sciarc-dc__actions { grid-template-columns: 1fr; padding: 16px 22px 22px; }
  .sciarc-dc__noscript { padding: 0 22px 20px; }
  .sciarc-dc__view--declined { padding: 34px 24px 30px; }
}

@keyframes sciarc-dc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sciarc-dc-rise {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sciarc-dc,
  .sciarc-dc__card { animation: none; }
}

@media print {
  .sciarc-dc { display: none !important; }
  html.sciarc-dc-open,
  html.sciarc-dc-open body { overflow: visible; }
}
