/* Two deliberate palettes using the existing Kepler blue and light green. */
:root {
  --theme-control-bg: #101010;
  --theme-control-border: #3b3b3b;
  --theme-control-ink: #eeeeee;
  --theme-focus: #2372fd;
}
html[data-theme="light"] {
  color-scheme: light;
  --black: #ffffff;
  --panel: #f7f7f7;
  --blue: #2372fd;
  --bright: #2372fd;
  --green: #40e848;
  --white: #000000;
  --text: #333333;
  --muted: #606060;
  --line: #e2e2e2;
  --theme-control-bg: #f7f7f7;
  --theme-control-border: #dddddd;
  --theme-control-ink: #000;
  --theme-focus: #2372fd;
}
/* Both choices remain visible; the selected segment is lit in Kepler blue. */
.theme-selector {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 2px;
  padding: 4px;
  color: var(--theme-control-ink);
  background: var(--theme-control-bg);
  border: 1px solid var(--theme-control-border);
  border-radius: 28px;
  white-space: nowrap;
}
.theme-selector .theme-choice {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  min-width: 70px;
  padding: 8px 10px;
  margin: 0;
  color: var(--theme-control-ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 22px;
  font: 600 11px/1.2 Montserrat, Arial, sans-serif;
  cursor: pointer;
  transition: background-color .18s, box-shadow .18s;
}
.theme-choice svg { display: block; width: 16px; height: 16px; flex-shrink: 0; }
.theme-selector .theme-choice:hover { background: #2372fd24; }
html[data-theme="light"] .theme-choice[data-theme-choice="light"],
html[data-theme="dark"] .theme-choice[data-theme-choice="dark"] {
  color: #fff;
  background: #2372fd;
  border-color: #2372fd;
  box-shadow: 0 0 14px #2372fd55;
}
.theme-selector .theme-choice:focus-visible { outline: 3px solid var(--theme-focus); outline-offset: 3px; }
.theme-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.standalone-themebar { display: flex; justify-content: flex-end; padding: 18px 5%; }

/* White header, black lettering and the original blue planet. */
html[data-theme="light"] body[data-kepler-page="institutional"] { background: #fff; }
html[data-theme="light"] body[data-kepler-page="institutional"] ::selection { background: #2372fd; color: #fff; }
html[data-theme="light"] body[data-kepler-page="institutional"] > header { background: #ffffffef; border-bottom-color: #e2e2e2; backdrop-filter: blur(16px); }
html[data-theme="light"] img.logo[src="/assets/2027/logo-sem-subtitulo.svg"] { content: url('/assets/2027/logo-tema-claro.svg?v=20'); }
html[data-theme="light"] .header nav a:hover { color: #2372fd; text-decoration-color: #40e848; text-decoration-thickness: 3px; }
html[data-theme="light"] .button { background: #000; border-color: #000; color: #fff; }
html[data-theme="light"] .button:hover { background: #111111; border-color: #111111; }
html[data-theme="light"] .button.outline,
html[data-theme="light"] .button.secondary { background: #ffffffcc; color: #2372fd; border-color: #9db6df; }
html[data-theme="light"] .button.outline:hover,
html[data-theme="light"] .button.secondary:hover { background: #eaf1fd; border-color: #2372fd; }
html[data-theme="light"] .button.green { background: #40e848; border-color: #40e848; color: #000000; box-shadow: 0 3px 12px #2372fd0d; }
html[data-theme="light"] .button.green:hover { background: #40e848; border-color: #2372fd; box-shadow: 0 0 0 3px #40e84830; }

/* A luminous opening, with the same starfield quietly visible beneath it. */
html[data-theme="light"] .hero { background: #f2f6ff; }
html[data-theme="light"] .hero::before { background: linear-gradient(100deg,#fffffff5 5%,#edf4fff0 55%,#e7f0ffe8 100%),var(--site-starfield,url('/assets/2027/orion-original-horizontal.svg')) center/cover no-repeat; }
html[data-theme="light"] .hero h1 strong { color: #2372fd; }
html[data-theme="light"] .hero-location { color: #606060; }
html[data-theme="light"] .hero-details b { color: #000; }
html[data-theme="light"] .results-chart { background: #ffffff91; border: 1px solid #cbdcf3; border-top: 3px solid #2372fd; border-radius: 10px; box-shadow: 0 12px 40px #2372fd0b; }
html[data-theme="light"] .results-chart figcaption { color: #000; }
html[data-theme="light"] .chart-guide { border-bottom-color: #9bb3d4; background: repeating-linear-gradient(to top,transparent 0,transparent calc(40% - 1px),#2372fd15 calc(40% - 1px),#2372fd15 40%); }
html[data-theme="light"] .column-bar { background: #2372fd; }
html[data-theme="light"] .column-bar strong { color: #2372fd; }
html[data-theme="light"] .column-year { color: #606060; }
html[data-theme="light"] .approval-column:hover .column-bar,
html[data-theme="light"] .approval-column:focus-visible .column-bar { background: #40e848; box-shadow: 0 0 0 1px #2372fd20; }
html[data-theme="light"] .approval-column:hover .column-year { color: #2372fd; text-decoration: underline; text-decoration-color: #40e848; text-decoration-thickness: 3px; text-underline-offset: 5px; }
html[data-theme="light"] :is(.results-chart .instagram-link,.section-more .text-link,.breadcrumbs a,.footer-links a[aria-current="page"]) { color: #2372fd; text-decoration-line: underline; text-decoration-color: #40e848; text-decoration-thickness: 2px; text-underline-offset: 5px; }
html[data-theme="light"] .results-chart .instagram-link { font-size: 13px; }
html[data-theme="light"] :is(button,.approval-column):focus-visible { outline-color: #2372fd; }


/* Results, class cards and learning features each retain a clear hierarchy. */
html[data-theme="light"] .first-places { background: linear-gradient(110deg,#fafafa,#f3f3f3); border: 1px solid #dddddd; border-left: 4px solid #40e848; box-shadow: 0 8px 28px #2372fd07; }
html[data-theme="light"] .first-places-heading .eyebrow { color: #333; }
html[data-theme="light"] .first-place + .first-place { border-color: #dddddd; }
html[data-theme="light"] .place-number { color: #40e848; background: #000; padding: 13px 15px; border-radius: 9px; font-size: 46px; }
html[data-theme="light"] .place-school { color: #000; }
html[data-theme="light"] #turmas { background: #f7f7f7; }
html[data-theme="light"] #turmas .eyebrow { color: #2372fd; }
html[data-theme="light"] .class-card { background: #fff; border-color: #dddddd; border-top-color: #2372fd; border-radius: 8px; box-shadow: 0 8px 25px #2372fd05; }
html[data-theme="light"] .class-top { background: #fafafa; }
html[data-theme="light"] .class-start time { color: #000; }
html[data-theme="light"] .feature { background: #fff; border-color: #e2e2e2; border-top-color: #2372fd; box-shadow: 0 7px 24px #2372fd06; }
html[data-theme="light"] .feature-icon { color: #2372fd; background: #eaf2ff; border-color: #c9dcfa; }
html[data-theme="light"] #professores { background: #f8f8f8; }
html[data-theme="light"] .professor-photo img { border-radius: 8px; box-shadow: 0 12px 35px #2372fd12; }

/* Separate book photos follow the selected theme from the first paint. */
.material-photo .books-crop { aspect-ratio: 1672 / 640; overflow: hidden; }
.material-photo .books-crop img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.books-theme-light { display: none !important; }
html[data-theme="light"] .books-theme-dark { display: none !important; }
html[data-theme="light"] .books-theme-light { display: block !important; }
html[data-theme="light"] .material-section { background: #fff; }
html[data-theme="light"] .material-photo { margin: 24px 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
html[data-theme="light"] .location-map iframe { border: 1px solid #cbdaf0; box-shadow: 0 10px 30px #2372fd09; border-radius: 8px; }
html[data-theme="light"] body[data-kepler-page="institutional"] > footer { background: #f5f5f5; border-top: 1px solid #e2e2e2; }
html[data-theme="light"] .page-heading { background: linear-gradient(100deg,#fffffff5,#eaf2ffed),var(--site-starfield,url('/assets/2027/orion-original-horizontal.svg')) center/cover; }
html[data-theme="light"] .page-heading h1 { color: #000; }
html[data-theme="light"] .approval-dialog { color: #333333; background: #fff; border-color: #bfd3f1; border-top-color: #2372fd; box-shadow: 0 20px 100px #00000055; }
html[data-theme="light"] .approval-dialog::backdrop { background: #00000088; }
html[data-theme="light"] .dialog-close { background: #f3f3f3; border-color: #dddddd; color: #2372fd; }
html[data-theme="light"] .dialog-names .names-list li:nth-child(4n+1),
html[data-theme="light"] .dialog-names .names-list li:nth-child(4n+2) { background: #f8faff; }
html[data-theme="light"] .mobile summary { border-color: #cccccc; }
html[data-theme="light"] .mobile nav { background: #fff; border-color: #dddddd; box-shadow: 0 12px 32px #2372fd1c; }
html[data-theme="light"] .whatsapp-float { box-shadow: 0 5px 24px #2372fd26; }

/* Give the new control room without squeezing the navigation. */
body[data-kepler-page="institutional"] .header { gap: 20px; }
@media (max-width: 1100px) {
  body[data-kepler-page="institutional"] .header { gap: 12px; }
}
@media (min-width: 861px) and (max-width: 1160px) {
  .header > nav { display: none; }
  .header > .button { margin-left: auto; }
  .mobile { display: block; position: relative; color: var(--white); }
  .mobile summary { font-size: 13px; list-style: none; border: 1px solid var(--line); padding: 7px 12px; cursor: pointer; border-radius: 3px; }
  .mobile summary::-webkit-details-marker { display: none; }
  .mobile nav { position: absolute; right: 0; top: 42px; width: 230px; padding: 20px; background: var(--panel); border: 1px solid var(--bright); display: flex; flex-direction: column; gap: 16px; box-shadow: 0 8px 25px #0003; }
  .mobile nav a { font-size: 14px; }
}
@media (max-width: 650px) {
  body[data-kepler-page="institutional"] .header { gap: 8px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .header .logo { width: 108px; }
  .header > .button { margin-left: auto; }
  .theme-selector { padding: 3px; }
  .theme-selector .theme-choice { min-width: 63px; padding: 8px 7px; gap: 4px; }
  .header .mobile { margin-left: 0; }
  html[data-theme="light"] .place-number { font-size: 40px; padding: 11px 13px; }
  html[data-theme="light"] .material-photo { margin: 25px 0; }
  html[data-theme="light"] .dialog-names .names-list li:nth-child(n) { background: transparent; }
  html[data-theme="light"] .dialog-names .names-list li:nth-child(odd) { background: #f8faff; }
}
@media (max-width: 550px) {
  body[data-kepler-page="institutional"] .header { display: grid; grid-template-columns: 1fr auto; row-gap: 8px; }
  .header > a:first-child { grid-column: 1; grid-row: 1; }
  .header > .theme-selector { grid-column: 2; grid-row: 1; justify-self: end; }
  .header > .button { grid-column: 1; grid-row: 2; margin: 0; justify-self: start; min-height: 36px; }
  .header > .mobile { grid-column: 2; grid-row: 2; justify-self: end; }
  .header .mobile summary { min-height: 36px; text-align: center; padding: 7px 12px; }
  .enrollment-themebar { padding-inline: 16px; gap: 10px; }
}

/* The operational form shares the preference, without modifying its form logic. */
.enrollment-themebar { padding: 10px max(24px,calc((100% - 888px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--theme-control-bg); border-bottom: 1px solid var(--theme-control-border); }
.enrollment-themebar .back-to-site { color: var(--theme-control-ink); font: 500 12px/1.5 Arial,sans-serif; text-decoration: none; }
.enrollment-themebar .back-to-site:hover { text-decoration: underline; }
html[data-theme="light"] body[data-kepler-page="enrollment"] { --background: #f7f7f7; --foreground: #000000; --card: #fff; --card-foreground: #000000; --popover: #fff; --popover-foreground: #000000; --primary: #2372fd; --primary-foreground: #fff; --secondary: #f3f3f3; --secondary-foreground: #000000; --muted: #f3f3f3; --muted-foreground: #606060; --accent: #eaf2ff; --accent-foreground: #2372fd; --border: #e2e2e2; --input: #c8d3e1; --ring: #2372fd; background: #f7f7f7; color: #000000; color-scheme: light; }
html[data-theme="light"] .enrollment-themebar { background: #fff; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] { --background: #000; --foreground: #e6edf8; --card: #101010; --card-foreground: #e6edf8; --popover: #161616; --popover-foreground: #e6edf8; --primary: #2372fd; --primary-foreground: #fff; --secondary: #222222; --secondary-foreground: #e6edf8; --muted: #1d1d1d; --muted-foreground: #b5b5b5; --accent: #222222; --accent-foreground: #ededed; --border: #363636; --input: #505050; --ring: #2372fd; background: #000; color: #e6edf8; color-scheme: dark; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] :is(.main-card,.summary-card,.status-card,.tab-bar) { background: #101010; color: #e6edf8; border-color: #363636; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] :is(input,select,textarea,.intake-card select) { background: #090909; color: #e6edf8; border-color: #505050; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] input::placeholder { color: #a4a4a4; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] input[type="checkbox"] { accent-color: #40e848; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] :is(button:not(.primary):not(.theme-choice),.choices label) { background: #1a1a1a; color: #e6edf8; border-color: #505050; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] .primary { background: #2372fd; color: #fff; border-color: #2372fd; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] :is(.title p,.muted,.eyebrow,.intake-privacy,.intake-class-value small,.registry-details dt,.summary-card>p,.summary-card h2 small,footer) { color: #b5b5b5; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] :is(.intake-check,.intake-class-value,.app-access,.delivery) { background: #1c1c1c; border-color: #505050; color: #e6edf8; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] :is(.intake-progress>div,.intake-buttons,.review-person,details,footer) { border-color: #363636; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] .intake-progress>div { color: #b5b5b5; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] .intake-progress b { color: #d4d4d4; background: #242424; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] .intake-progress .active { color: #92baff; border-color: #2372fd; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] .intake-progress :is(.active,.complete) b { background: #2372fd; color: #fff; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] :is(summary,.intake-success>svg) { color: #92baff; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] a:not(.whatsapp-float):not(.back-to-site) { color: #92baff; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] .error { background: #351c22; color: #ffc4c4; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] .success { background: #122f22; color: #a9efbd; }
html[data-theme="dark"] body[data-kepler-page="enrollment"] .notice { background: #2b2519; color: #ead5a8; }
@media (prefers-reduced-motion: reduce) { .theme-choice { transition: none; } }
@media print {
  .theme-selector,.enrollment-themebar,.standalone-themebar,.theme-announcement { display: none !important; }
}

/* Shared section titles: original planet, aligned icon, one typographic pattern. */
body[data-kepler-page="institutional"] main h2,
body[data-kepler-page="institutional"] .page-heading h1 {
  position: relative;
  padding-inline-start: calc(1.3em + 12px);
  min-height: 1.3em;
}
body[data-kepler-page="institutional"] main h2::before,
body[data-kepler-page="institutional"] .page-heading h1::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: -.015em;
  width: 1.3em;
  height: 1.3em;
  background: url('/assets/2027/kepler-icon-192.png') center/contain no-repeat;
  pointer-events: none;
}
body[data-kepler-page="institutional"] .material-title { display: block; padding: 0; border: 0; }
body[data-kepler-page="institutional"] .material-title h2 { font-size: clamp(28px,3.2vw,42px); }
body[data-kepler-page="institutional"] #turmas .section-heading-enrollment {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 14px 26px;
  margin-bottom: 35px;
}
body[data-kepler-page="institutional"] #turmas .section-heading-enrollment h2 { margin: 0; color: var(--white); }
body[data-kepler-page="institutional"] #turmas .section-heading-enrollment > .eyebrow {
  flex: 0 0 auto;
  max-width: none;
  margin: 0;
  padding: 8px 13px;
  color: #000;
  background: #40e848;
  border: 1px solid #40e848;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .08em;
}
html[data-theme="light"] body[data-kepler-page="institutional"] main h2,
html[data-theme="light"] body[data-kepler-page="institutional"] .page-heading h1 { color: #000; }
html[data-theme="light"] body[data-kepler-page="institutional"] a:not(.button):not(.whatsapp-float):not(.approval-column) {
  color: #000;
  text-decoration-color: #2372fd;
  text-underline-offset: 5px;
}
html[data-theme="light"] .button.outline,
html[data-theme="light"] .button.secondary { color: #000; border-color: #2372fd; }
html[data-theme="light"] .header nav a:hover { color: #000; text-decoration-color: #2372fd; }
body[data-kepler-page="enrollment"] #root header { background: #000; }
html[data-theme="light"] body[data-kepler-page="enrollment"] :is(input,select,textarea,.intake-card select) { color: #000; }
html[data-theme="light"] body[data-kepler-page="enrollment"] .primary { background: #000; border-color: #000; color: #fff; }
html[data-theme="light"] body[data-kepler-page="institutional"] .eyebrow { color: #333; }
@media (max-width: 650px) {
  body[data-kepler-page="institutional"] #turmas .section-heading-enrollment { column-gap: 18px; row-gap: 12px; }
  body[data-kepler-page="institutional"] #turmas .section-heading-enrollment > .eyebrow { margin-inline-start: 51px; }
  body[data-kepler-page="institutional"] .material-title h2 { font-size: 30px; }
}
