/* Shared public visual contract. Dashboard styles live in dashboard-*.css. */
:root {
  /* Same blue as the dashboard primary button (dashboard.css .btn.primary). */
  --ui-accent: #0a0081;
  --ui-accent-hover: #1d1499;
  --ui-accent-soft: #eaf2ff;
  --ui-page: #f6f7f8;
  --ui-surface: #ffffff;
  --ui-surface-muted: #f3f4f5;
  --ui-ink: #17191c;
  --ui-text-secondary: #535861;
  --ui-text-muted: #6a7079;
  --ui-border: #dfe3e8;
  --ui-border-subtle: #edeff1;
  --ui-focus: #155eef;
  --ui-control-height: 42px;
  --ui-control-radius: 10px;
  --ui-button-radius: 999px;
  color-scheme: light;
}

html[data-theme='dark'] {
  --ui-accent: #6b9aff;
  --ui-accent-hover: #8cb0ff;
  --ui-accent-soft: #1b2c4b;
  --ui-page: #15171b;
  --ui-surface: #1b1e23;
  --ui-surface-muted: #252930;
  --ui-ink: #f3f4f6;
  --ui-text-secondary: #c3c8d0;
  --ui-text-muted: #a0a6b0;
  --ui-border: #3b414b;
  --ui-border-subtle: #30343b;
  --ui-focus: #7ba5ff;
  color-scheme: dark;
  --page: #101114;
  --dark: #090a0c;
  --soft: #15171b;
  --nav: #1b1e23;
  --text: #f3f4f6;
  --text-2: #c3c8d0;
  --muted: #a0a6b0;
  --border: #30343b;
}

button,
a,
input,
select,
textarea { -webkit-tap-highlight-color: transparent; }

:is(button, a, input, select, textarea):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ui-focus) 62%, transparent);
  outline-offset: 2px;
}

.btn,
.pill-btn,
.auth-submit,
.registration-submit,
.membership-submit,
.explore-button {
  min-height: var(--ui-control-height);
  border-radius: var(--ui-button-radius);
  box-shadow: none;
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn,
.pill-btn,
.explore-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--ui-border);
}

.btn.primary,
.btn-primary,
.pill-btn,
.auth-submit,
.registration-submit,
.membership-submit,
.explore-button {
  border-color: var(--ui-accent);
  background: var(--ui-accent);
  color: #fff;
}

:is(.btn.primary, .btn-primary, .pill-btn, .auth-submit, .registration-submit, .membership-submit, .explore-button):hover {
  border-color: var(--ui-accent-hover);
  background: var(--ui-accent-hover);
  color: #fff;
}

:is(.btn, .pill-btn, .auth-submit, .registration-submit, .membership-submit, .explore-button):disabled,
[aria-busy='true'] { cursor: wait; opacity: .56; pointer-events: none; }

.btn svg,
.btn re-icon,
.pill-btn svg,
.pill-btn re-icon,
.explore-button svg,
.explore-button re-icon { width: 16px; height: 16px; flex: 0 0 auto; }

re-icon { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; color: currentColor; vertical-align: middle; }

/* Auth and editorial pages consume the same semantic public tokens. */
.auth-page,
.login-page,
.login-screen,
.login-form-panel,
.registration-body,
.registration-page,
.article-shell,
.editorial-detail,
.content-index { background: var(--ui-page); color: var(--ui-ink); }

.auth-card,
.login-card,
.login-form,
.form-panel,
.registration-section { border-color: var(--ui-border-subtle); background: var(--ui-surface); color: var(--ui-ink); box-shadow: none; }

.auth-card > p,
.auth-card form > p,
.auth-return,
.login-intro p,
.login-return,
.article-content,
.content-index header p,
.content-index-row p,
.content-index-empty p,
.editorial-detail__summary { color: var(--ui-text-secondary); }

.registration-intro > p,
.privacy-note,
.section-heading p,
.field small,
.photo-copy small,
.home-link { color: var(--ui-text-secondary); }

.auth-field input,
.login-field input,
.field input,
.field select,
.field textarea {
  border-color: var(--ui-border);
  background: var(--ui-surface);
  color: var(--ui-ink);
}

.registration-body .field input,
.registration-body .field select,
.suggestions,
.suggestion-item,
.photo-dropzone { border-color: var(--ui-border); background-color: var(--ui-surface-muted); color: var(--ui-ink); }
.registration-body .field input::placeholder { color: var(--ui-text-muted); }
.registration-body .field input:focus,
.registration-body .field select:focus,
.suggestion-item:hover,
.suggestion-item:focus { background-color: var(--ui-surface); }
.lookup-status,
.consent-row { border-color: var(--ui-border); background: var(--ui-surface-muted); color: var(--ui-text-secondary); }
.section-heading,
.privacy-note { border-color: var(--ui-border-subtle); }
.field { color: var(--ui-ink); }

.auth-copy { color: var(--ui-text-secondary); font-size: 12px; line-height: 1.6; }
.auth-field-spaced { margin-top: 12px; }
.auth-wide-action { width: 100%; margin-top: 18px; }

.error-page { min-height: 100vh; display: grid; padding: 24px; place-items: center; background: var(--ui-page); color: var(--ui-ink); }
.error-card { width: min(100%,620px); padding: clamp(32px,6vw,72px); border: 1px solid var(--ui-border-subtle); border-radius: 24px; background: var(--ui-surface); }
.error-card span { color: var(--ui-accent); font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.error-card h1 { margin: 16px 0; font-size: clamp(54px,10vw,110px); line-height: .8; letter-spacing: -.09em; }
.error-card p { max-width: 360px; color: var(--ui-text-secondary); line-height: 1.6; }
.error-card a { display: inline-flex; min-height: var(--ui-control-height); margin-top: 22px; padding: 0 18px; align-items: center; border-radius: var(--ui-control-radius); background: var(--ui-accent); color: #fff; font-size: 12px; font-weight: 700; }

.auth-field input:focus,
.login-field input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--ui-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-focus) 16%, transparent);
}

html[data-theme='dark'] .nav-shell { background: var(--ui-surface); color: var(--ui-ink); }
html[data-theme='dark'] .nav-shell.nav-shell--scrolled { border-color: var(--ui-border); background: color-mix(in srgb, var(--ui-surface) 88%, transparent); box-shadow: 0 10px 28px rgba(0,0,0,.25); }
html[data-theme='dark'] .nav-shell .nav-menu { color: var(--ui-ink); }
html[data-theme='dark'] .pill-btn.alt { background: var(--ui-surface-muted); color: var(--ui-ink); }
html[data-theme='dark'] .content-index-list,
html[data-theme='dark'] .content-index-row,
html[data-theme='dark'] .event-box,
html[data-theme='dark'] .editorial-detail__aside { border-color: var(--ui-border-subtle); }
html[data-theme='dark'] .editorial-related-card strong,
html[data-theme='dark'] .editorial-aside__title { color: var(--ui-ink); }
html[data-theme='dark'] .nav-pill { border-color: var(--ui-border); background: color-mix(in srgb,var(--ui-surface) 92%,transparent); color: var(--ui-ink); }
html[data-theme='dark'] .nav-links,
html[data-theme='dark'] .hero-overline,
html[data-theme='dark'] .service-card p { color: var(--ui-text-secondary); }
html[data-theme='dark'] .btn-ghost { border-color: var(--ui-border); background: var(--ui-surface); color: var(--ui-ink); }
html[data-theme='dark'] .service-grid { border-color: var(--ui-border); }
/* Complete public dark theme. This layer loads last and replaces legacy light literals. */
html[data-theme='dark'] body,
html[data-theme='dark'] .registration-body,
html[data-theme='dark'] .membership-page {
  background: var(--ui-page);
  color: var(--ui-ink);
}

html[data-theme='dark'] .nav-pill,
html[data-theme='dark'] .nav-wrap.nav-wrap--scrolled .nav-pill {
  border: 1px solid var(--ui-border);
  background: color-mix(in srgb, var(--ui-surface) 92%, transparent);
  color: var(--ui-ink);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}

html[data-theme='dark'] :is(.nav-brand, .nav-links, .nav-tools, .language-toggle, .nav-menu),
html[data-theme='dark'] :is(.about, .services, .editorial, .faq) {
  color: var(--ui-ink);
}

html[data-theme='dark'] .faq-list,
html[data-theme='dark'] .faq-list details {
  border-color: var(--ui-border-subtle);
}

html[data-theme='dark'] .faq-list summary :is(svg, re-icon),
html[data-theme='dark'] .service-card :is(svg, re-icon),
html[data-theme='dark'] .about-head :is(svg, re-icon) {
  color: var(--ui-text-muted);
}

html[data-theme='dark'] .services .service-card--academic,
html[data-theme='dark'] .bureau-roles span {
  background: var(--ui-surface-muted);
  color: var(--ui-ink);
}

html[data-theme='dark'] .services .service-card--academic h3 { color: var(--ui-ink); }
html[data-theme='dark'] .services .service-card--academic p,
html[data-theme='dark'] .bureau-roles span { color: var(--ui-text-secondary); }

html[data-theme='dark'] .footer {
  background: #0d0f12;
  color: var(--ui-ink);
}

html[data-theme='dark'] .footer :is(p, .footer-links a, .footer-bottom) { color: var(--ui-text-muted); }
html[data-theme='dark'] .footer-bottom { border-top-color: var(--ui-border-subtle); }
html[data-theme='dark'] .footer-social-icon { border-color: var(--ui-border); color: var(--ui-ink); }
html[data-theme='dark'] .footer .mega { color: #15181d; }

html[data-theme='dark'] :is(.editorial-event-box, .address-found, .lookup-status, .consent-row, .photo-dropzone) {
  border-color: var(--ui-border);
  background: var(--ui-surface-muted);
  color: var(--ui-text-secondary);
}

html[data-theme='dark'] :is(.photo-preview, .registration-steps li > span) {
  border-color: var(--ui-border);
  background: var(--ui-surface-muted);
  color: var(--ui-ink);
}

html[data-theme='dark'] .field select {
  background-color: var(--ui-surface-muted);
  background-image: linear-gradient(45deg, transparent 50%, var(--ui-text-muted) 50%), linear-gradient(135deg, var(--ui-text-muted) 50%, transparent 50%);
}
html[data-theme='dark'] .suggestion-empty,
html[data-theme='dark'] .photo-copy small,
html[data-theme='dark'] .editorial-event-box small { color: var(--ui-text-muted); }

html[data-theme='dark'] .bureau-carousel-card .bureau-profile:not(:empty) {
  border: 1px solid var(--ui-border);
  background: var(--ui-surface-muted);
  color: var(--ui-ink);
}
html[data-theme='dark'] .bureau-carousel-card .bureau-profile :is(p, a) { color: var(--ui-text-secondary); }

html[data-theme='dark'] .login-message { background: color-mix(in srgb, var(--danger, #e74c75) 12%, var(--ui-surface)); }

/* Footer media mirrors the hero crop, contrast and restrained overlay. */
.home-join .join-inner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: clamp(18px, 2vw, 28px);
  background: #101010;
  color: #fff;
}

.home-join .join-inner::before,
.home-join .footer-visual {
  position: absolute;
  z-index: -2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
  filter: saturate(.86) contrast(1.05);
}

.home-join .join-inner::before { content: ''; background: url("../images/footer.db75ec635460.jpg") center 52% / cover no-repeat; }
.home-join .join-inner::after { position: absolute; z-index: -1; inset: 0; content: ''; background: linear-gradient(90deg, rgba(5,5,5,.86), rgba(5,5,5,.66) 46%, rgba(5,5,5,.22)); }
.home-join .join-inner h2,
.home-join .join-inner p { position: relative; color: #fff; }
.home-join .join-inner p { color: rgba(255,255,255,.84); font-weight: 400; }
.home-join .join-actions .btn-ghost { border-color: rgba(255,255,255,.72); background: transparent; color: #fff; }
.home-join .join-actions .btn-ghost:hover { border-color: #fff; background: #fff; color: #111; }

@media (max-width: 620px) {
  :root { --ui-control-height: 40px; }
  .home-join .join-inner { min-height: 400px; }
  .home-join .footer-visual { object-position: 58% center; }
  .home-join .join-inner::before { background-position: 58% center; }
  .home-join .join-inner::after { background: linear-gradient(180deg, rgba(5,5,5,.24), rgba(5,5,5,.82) 70%, rgba(5,5,5,.9)); }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .pill-btn,
  .auth-submit,
  .registration-submit,
  .membership-submit,
  .explore-button { transition: none; }
}

/* Ghost buttons outline the shared accent; primary buttons already use it above. */
.btn-ghost { border-color: var(--ui-accent); color: var(--ui-accent); background: #fff; }
.btn-ghost:hover { border-color: var(--ui-accent); background: var(--ui-accent); color: #fff; }
/* Content pages paint the whole viewport with one surface, not just the centred column. */
body:has(.content-index),
body:has(.article-shell),
body:has(.editorial-detail) { background: var(--ui-page); }
.election-strip { border-radius: var(--ui-button-radius); }
