:root {
  --bg: #f6f9fe;
  --surface: #ffffff;
  --surface-alt: #eef4fc;
  --text: #10233d;
  --text-muted: #4b5e78;
  --border: #d9e4f2;
  --primary: #1a66d4;
  --primary-dark: #10499e;
  --accent: #e59318;
  --accent-soft: #fff4df;
  --success: #0e8a5f;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(16, 35, 61, 0.07);
}

body.theme-congress {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-alt: #eef1f7;
  --text: #0f213a;
  --text-muted: #4a5970;
  --border: #d6dde8;
  --primary: #12315c;
  --primary-dark: #0a1f3d;
  --accent: #b88b2e;
  --accent-soft: #faf3e3;
}

body.theme-portal {
  --bg: #f5f9fa;
  --surface: #ffffff;
  --surface-alt: #eaf3f5;
  --text: #0e2836;
  --text-muted: #476170;
  --border: #d3e2e8;
  --primary: #0f5c7a;
  --primary-dark: #0a4157;
  --accent: #d97732;
  --accent-soft: #fdf0e5;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Ecosystem top bar */
.eco-bar {
  background: var(--text);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  padding: 8px 0;
}
.eco-bar .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.eco-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.eco-links a {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
}
.eco-links a.active, .eco-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  flex-wrap: wrap;
  padding: 10px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}
.brand-sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}
.main-nav a {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}
.main-nav a:hover { color: var(--primary); text-decoration: none; }

.social-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}
.social-pill:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
}

/* Hero */
.hero {
  padding: 64px 0 56px;
  background: linear-gradient(155deg, var(--surface) 0%, var(--surface-alt) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 36px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.hero-lead {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 0 26px;
  max-width: 640px;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-outline {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.hero-card h3 { margin: 0 0 14px; font-size: 18px; }
.fact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.fact-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.fact-list li:last-child { border-bottom: none; padding-bottom: 0; }
.fact-label { color: var(--text-muted); }
.fact-val { font-weight: 700; text-align: right; }

/* Sections */
.section {
  padding: 64px 0;
}
.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-head {
  margin-bottom: 32px;
  max-width: 760px;
}
.section-head h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.section-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 16px;
}

/* Grids & Cards */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 4px 16px rgba(16, 35, 61, 0.04);
}
.section-alt .card { background: var(--bg); }
.card h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.3; }
.card p { margin: 0; color: var(--text-muted); font-size: 15px; }
.card-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface-alt);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.stat-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 6px;
}

/* Polls & Voting */
.poll-card { display: flex; flex-direction: column; gap: 12px; }
.poll-options { display: grid; gap: 10px; }
.poll-btn {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease;
  font-size: 14px;
  color: var(--text);
}
.poll-btn:hover { border-color: var(--primary); }
.poll-btn.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26, 102, 212, 0.15); }
.poll-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(26, 102, 212, 0.12);
  transition: width 0.35s ease;
  z-index: 0;
}
.poll-btn-inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
}
.poll-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.tab-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 14px; font-weight: 600; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}
.form-field textarea { min-height: 110px; resize: vertical; }
.form-status {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  display: none;
}
.form-status.ok { display: block; background: #e6f6ef; color: #0b6645; border: 1px solid #b5e3cf; }
.form-status.err { display: block; background: #fdecec; color: #9b1c1c; border: 1px solid #f5bcbc; }

/* Search box */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-bar input {
  flex: 1;
  min-width: 240px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 15px;
  background: var(--surface);
}

/* Video placeholder */
.video-box {
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 24px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-bottom: 14px;
}
.video-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 999px;
  width: fit-content;
}

/* Accordion FAQ */
details.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 10px;
}
details.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
details.faq-item p {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 15px;
}

/* Footer */
.site-footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.85);
  padding: 48px 0 36px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}
.site-footer h4 { color: #fff; margin: 0 0 12px; font-size: 16px; }
.site-footer a { color: rgba(255, 255, 255, 0.85); }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 900px) {
  .hero-grid, .grid-3, .grid-4, .footer-grid { grid-template-columns: 1fr; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .header-inner { gap: 12px; }
}

/* === Visual Upgrade: Spring Sky Photo & Media Design (v2) === */
.brand-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(15, 76, 129, 0.18);
  flex-shrink: 0;
}

.hero-visual {
  position: relative;
  background-size: cover;
  background-position: center 30%;
  color: #ffffff;
  padding: 88px 0 80px;
  overflow: hidden;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(11, 46, 89, 0.84) 0%,
    rgba(18, 72, 130, 0.68) 52%,
    rgba(15, 58, 108, 0.48) 100%
  );
  z-index: 0;
}

body.theme-congress .hero-visual::before {
  background: linear-gradient(
    105deg,
    rgba(12, 31, 63, 0.88) 0%,
    rgba(21, 52, 98, 0.72) 55%,
    rgba(15, 39, 76, 0.56) 100%
  );
}

body.theme-portal .hero-visual::before {
  background: linear-gradient(
    105deg,
    rgba(14, 59, 92, 0.84) 0%,
    rgba(24, 96, 138, 0.64) 55%,
    rgba(20, 74, 112, 0.44) 100%
  );
}

.hero-visual .container {
  position: relative;
  z-index: 1;
}

.hero-visual .eyebrow {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(8px);
}

.hero-visual h1 {
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

.hero-visual .hero-lead {
  color: rgba(255, 255, 255, 0.93);
}

.hero-visual .btn-outline {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
}

.hero-visual .btn-outline:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: #ffffff;
}

.hero-visual .social-pill {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(6px);
}

.hero-visual .social-pill:hover {
  background: #ffffff;
  color: var(--primary);
}

.hero-visual .hero-card {
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 20px 50px rgba(8, 28, 56, 0.28);
}

.hero-visual .hero-card h3 {
  color: var(--primary-dark, #0f3d75);
}

/* Media cards */
.card-has-img {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card-has-img:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15, 61, 117, 0.13);
}

.card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e6f0fa;
}

.card-img-wrap.portrait {
  aspect-ratio: 4 / 3;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 12%;
  display: block;
  transition: transform 0.35s ease;
}

.card-img-wrap.portrait img {
  object-position: center 10%;
}

.card-has-img:hover .card-img-wrap img {
  transform: scale(1.04);
}

.card-img-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  margin-top: 2px;
}

.news-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.quiz-banner {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 14px;
  margin-bottom: 22px;
  display: block;
}

.section-alt {
  background: linear-gradient(180deg, #f2f8ff 0%, #f8fbff 100%);
}

@media (max-width: 768px) {
  .hero-visual {
    padding: 56px 0 52px;
  }
  .quiz-banner {
    height: 160px;
  }
}
