/* ============================================================
   Healthcare-professional disclaimer gate (app/partials/disclaimer_popup.php)
   Self-contained: uses only the shared design tokens, so it looks identical
   on the landing page (app.css) and on the subpages (subpages.css).
   ============================================================ */

body.dc-lock { overflow: hidden; }

.dc-back {
  position: fixed; inset: 0; z-index: 200;
  /* minmax(0,1fr): without it the auto track grows to the card's max-content
     width and the dialog overflows narrow viewports. */
  display: grid; grid-template-columns: minmax(0, 1fr); place-items: center;
  padding: 20px;
  background: rgba(20, 35, 60, .58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  overscroll-behavior: contain;
  animation: dcFade .22s ease both;
}

.dc-card {
  display: flex; flex-direction: column;
  width: 100%; max-width: 680px;
  max-height: min(92vh, 900px);
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  animation: dcRise .28s cubic-bezier(.2, .8, .2, 1) both;
}
.dc-card:focus { outline: none; }   /* focus is moved here on open, silently */

/* The card holds two views (main / declined); the visible one is the flex
   column that head + scrollable body + actions live in. */
.dc-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dc-view[hidden] { display: none; }

/* ---------- head ---------- */
.dc-head {
  flex-shrink: 0;
  padding: 30px 36px 24px;
  text-align: center;
  background: var(--soft);
  border-bottom: 1px solid var(--hairline);
}
.dc-logo { height: 38px; width: auto; margin: 0 auto 18px; }
.dc-eyebrow {
  font-family: var(--font-display);
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--teal);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 12px;
}
.dc-eyebrow::before,
.dc-eyebrow::after {
  content: ""; width: 26px; height: 3px; border-radius: 2px;
  background: var(--teal); opacity: .55; flex-shrink: 0;
}
.dc-h {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; color: var(--navy);
  margin: 0;
}

/* ---------- scrollable text ---------- */
.dc-body {
  flex: 1 1 auto;
  /* min-height:0 is what actually lets this shrink — without it a flex item
     never goes below its content height and head/actions get pushed out. */
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 26px 36px 4px;
  font-size: 13.5px; line-height: 1.65; color: var(--ink-2);
}
.dc-body:focus-visible { outline: 2px solid var(--teal); outline-offset: -4px; }
.dc-body p { margin: 0 0 16px; }
.dc-body strong { font-weight: 700; color: var(--ink); }

.dc-countries {
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: var(--r-md);
  padding: 18px 20px 16px;
  margin: 0 0 16px;
}
.dc-countries-t {
  margin: 0 0 12px !important;
  font-weight: 600; font-size: 13px; color: var(--ink);
}
.dc-country-list {
  columns: 3; column-gap: 18px;
  font-size: 12.5px; line-height: 1.85; color: var(--ink-2);
}
.dc-country-list li {
  break-inside: avoid;
  padding-left: 12px; position: relative;
}
.dc-country-list li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--teal); opacity: .6;
}
.dc-confirm { color: var(--ink); }

/* ---------- actions ---------- */
.dc-actions {
  flex-shrink: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 20px 36px 28px;
  background: #fff;
  border-top: 1px solid var(--line-soft);
  /* hints that the text above keeps scrolling */
  box-shadow: 0 -12px 18px -16px rgba(20, 35, 60, .45);
}
.dc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 600; line-height: 1.35;
  padding: 15px 18px;
  border-radius: 10px; border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.dc-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.dc-btn:active { transform: translateY(1px); }
.dc-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.dc-btn-yes { background: var(--teal); color: #fff; }
.dc-btn-yes:hover { background: var(--teal-2); }

.dc-btn-no {
  background: #fff; color: var(--ink-2);
  border-color: var(--hairline-2);
}
.dc-btn-no:hover { background: var(--soft); border-color: var(--muted-2); color: var(--ink); }

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

/* ---------- "not a healthcare professional" view ---------- */
.dc-view-declined {
  display: block;          /* short, centered content — no column layout needed */
  overflow-y: auto;
  padding: 44px 40px 40px;
  text-align: center;
}
.dc-declined-ic {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--orange-50); color: var(--orange-2);
  display: grid; place-items: center; margin: 0 auto 20px;
}
.dc-declined-ic svg { width: 27px; height: 27px; }
.dc-declined-h {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700; letter-spacing: -.015em;
  color: var(--navy); margin: 0 0 12px;
}
.dc-declined-b {
  font-size: 14px; line-height: 1.65; color: var(--muted);
  margin: 0 auto 26px; max-width: 44ch;
}
.dc-btn-center { display: inline-flex; }
.dc-back-link {
  display: block; margin: 18px auto 0;
  font-size: 13px; font-weight: 600; color: var(--teal);
  text-decoration: underline; text-underline-offset: 3px;
}
.dc-back-link:hover { color: var(--teal-2); }

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .dc-back { padding: 12px; }
  .dc-card { max-height: 94vh; border-radius: var(--r-lg); }
  .dc-head { padding: 24px 22px 20px; }
  .dc-logo { height: 32px; margin-bottom: 14px; }
  .dc-h { font-size: 21px; }
  .dc-body { padding: 20px 22px 4px; font-size: 13px; }
  .dc-country-list { columns: 2; }
  .dc-actions { grid-template-columns: 1fr; padding: 16px 22px 22px; }
  .dc-noscript { padding: 0 22px 20px; }
  .dc-view-declined { padding: 34px 24px 30px; }
}

@keyframes dcFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dcRise {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dc-back, .dc-card { animation: none; }
}

@media print { .dc-back { display: none !important; } }
