:root {
  color-scheme: light;
  --content-width: 760px;
  --fixed-hero-height: 158px;
  --fixed-form-height: 62px;
  --bg: #f5f3ed;
  --surface: #ffffff;
  --surface-soft: #edf5ef;
  --text: #17211c;
  --muted: #66736c;
  --line: #d9ded7;
  --green: #176c43;
  --green-dark: #0e442c;
  --gold: #c4922f;
  --blue: #244b6f;
  --shadow: 0 18px 45px rgba(25, 38, 30, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-top: calc(var(--fixed-hero-height) + var(--fixed-form-height) + 14px);
  background:
    linear-gradient(180deg, rgba(23, 108, 67, 0.1), transparent 260px),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.orientation-lock {
  display: none;
}

.footer {
  width: min(var(--content-width), calc(100% - 32px));
  margin: 0 auto;
}

.fixed-hero {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: var(--fixed-hero-height);
  border-bottom: 1px solid rgba(217, 222, 215, 0.92);
  background: rgba(245, 243, 237, 0.96);
  box-shadow: 0 10px 28px rgba(25, 38, 30, 0.12);
}

.fixed-hero-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: min(var(--content-width), calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  padding: 12px 0;
}

.hero-banner-image {
  width: min(48vw, 360px);
  aspect-ratio: 740 / 240;
  border-radius: 8px;
  background: url("imagens/Banner-1.png") center/100% 100% no-repeat;
  box-shadow: 0 8px 20px rgba(25, 38, 30, 0.14);
  flex: 0 0 auto;
}

.hero-heading {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  color: var(--green-dark);
  font-size: clamp(1.35rem, 2.1vw, 1.95rem);
  line-height: 1;
  white-space: nowrap;
}

.hero-heading p {
  margin: 0;
  color: var(--green);
  font-size: clamp(0.98rem, 1.55vw, 1.22rem);
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.shell {
  width: min(var(--content-width), calc(100% - 32px));
  margin: 12px auto 0;
}

.calculator {
  min-width: 0;
}

.form {
  position: fixed;
  z-index: 25;
  top: var(--fixed-hero-height);
  left: 50%;
  width: min(var(--content-width), calc(100% - 32px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(108px, 0.58fr) minmax(260px, 1.72fr) auto;
  gap: 6px;
  align-items: end;
  margin: 0 0 12px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 25px rgba(25, 38, 30, 0.08);
}

label {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 32px;
  border: 1px solid #c8d1ca;
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  padding: 0 9px;
}

#index-input {
  font-weight: 800;
}

#index-input::placeholder {
  font-weight: 700;
}

.combo-field {
  position: relative;
  display: block;
  max-width: 100%;
  min-width: 0;
}

.combo-field input {
  padding-right: 34px;
}

.combo-toggle {
  content: "";
  position: absolute;
  right: 1px;
  top: 1px;
  width: 34px;
  min-height: 30px;
  border: 0;
  border-left: 1px solid #c8d1ca;
  border-radius: 0 6px 6px 0;
  background: #fff;
  padding: 0;
}

.combo-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--green-dark);
  border-bottom: 2px solid var(--green-dark);
  transform: translate(-50%, -65%) rotate(45deg);
}

.combo-toggle:hover {
  background: var(--surface-soft);
}

.course-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-width: 100%;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #c8d1ca;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(25, 38, 30, 0.16);
}

.course-option {
  display: block;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 10px 13px;
  text-align: left;
  white-space: normal;
}

.course-option:hover,
.course-option:focus {
  background: var(--surface-soft);
  outline: none;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 108, 67, 0.16);
  outline: none;
}

.form-actions {
  display: flex;
  gap: 6px;
  min-width: 196px;
}

button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 0 12px;
  white-space: nowrap;
}

button:hover {
  background: var(--green-dark);
}

.secondary-button {
  border: 1px solid var(--green);
  background: #fff;
  color: var(--green-dark);
}

.secondary-button:hover {
  background: var(--surface-soft);
}

.message {
  grid-column: 1 / -1;
  min-height: 0;
  margin: 0;
  color: #9b2c2c;
  font-size: 0.82rem;
  line-height: 1.2;
}

.message:empty {
  display: none;
}

.results {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 25px rgba(25, 38, 30, 0.08);
}

.results {
  overflow: hidden;
}

.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  background: var(--surface-soft);
}

.result-heading h3 {
  margin-bottom: 0;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
}

.index-pill {
  border: 1px solid rgba(23, 108, 67, 0.35);
  border-radius: 6px;
  background: #fff;
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 5px 8px;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 5px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  line-height: 1.08;
}

th {
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
}

td:last-child,
th:last-child {
  text-align: right;
}

td.hcp {
  color: var(--blue);
  font-size: 0.95rem;
  font-weight: 900;
}

.ad {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 260px;
  border: 1px dashed #aeb9b0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  text-align: center;
}

.ad-inline {
  min-height: 120px;
  margin: 18px 0;
}

.banner-slot {
  width: min(100%, 728px);
  min-height: 0;
  margin-left: auto;
  margin-right: auto;
  background-color: rgba(255, 255, 255, 0.66);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.sponsor-link,
.banner-slot img {
  display: block;
}

.sponsor-link {
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.banner-slot img {
  width: 100%;
  height: auto;
}

.banner-1 {
  width: min(100%, 740px);
  aspect-ratio: 740 / 240;
  background-image: url("imagens/Banner-1.png");
}

.banner-2 {
  aspect-ratio: auto;
  background-image: none;
}

.banner-3 {
  display: block;
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: auto;
  background-image: none;
}

.ad strong {
  color: var(--green-dark);
}

.ad-wide {
  margin: 22px 0 12px;
}

.ad-wide.banner-3 {
  margin: 22px auto 12px;
}

.footer {
  padding-bottom: 24px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 980px) {
  :root {
    --fixed-form-height: 112px;
  }

  .form {
    grid-template-columns: minmax(96px, 0.52fr) minmax(0, 1.48fr);
  }

  .form-actions,
  .message {
    grid-column: 1 / -1;
  }

  .form-actions {
    min-width: 0;
  }

}

@media (max-width: 680px) {
  :root {
    --content-width: 100%;
    --fixed-hero-height: 190px;
    --fixed-form-height: 130px;
  }

  body {
    padding-top: calc(var(--fixed-hero-height) + var(--fixed-form-height) + 8px);
  }

  .fixed-hero {
    position: fixed;
    top: 0;
  }

  .fixed-hero-inner {
    flex-direction: column;
    gap: 6px;
    width: 100%;
    padding: 8px 0 10px;
  }

  .hero-banner-image {
    width: min(100%, 310px);
  }

  .hero-heading {
    text-align: center;
  }

  h1 {
    font-size: clamp(1.2rem, 5.8vw, 1.55rem);
  }

  .hero-heading p {
    font-size: 0.92rem;
  }

  .shell,
  .footer {
    width: 100%;
    padding-left: 8px;
    padding-right: 8px;
  }

  .form {
    position: fixed;
    top: var(--fixed-hero-height);
    left: 8px;
    right: 8px;
    width: auto;
    transform: none;
    grid-template-columns: minmax(76px, 0.52fr) minmax(0, 1.48fr);
    margin: 0 0 12px;
  }

  .form-actions,
  .message {
    grid-column: 1 / -1;
  }

  input {
    font-size: 16px;
  }

  .course-menu {
    max-height: 42vh;
  }

  .banner-slot {
    width: 100%;
  }

  .banner-2 {
    margin-top: 28px;
  }

  .banner-3 {
    min-height: 0;
    background-image: none;
  }

  .result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  th,
  td {
    padding: 4px 8px;
  }

  .form-actions {
    flex-direction: row;
    gap: 8px;
  }

  .form-actions button {
    flex: 1 1 0;
    padding: 0 12px;
  }

}

@media (max-width: 900px) and (orientation: landscape) {
  body > :not(.orientation-lock) {
    display: none !important;
  }

  .orientation-lock {
    position: fixed;
    z-index: 999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--bg);
    color: var(--green-dark);
    text-align: center;
  }

  .orientation-lock p {
    max-width: 360px;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.25;
  }
}
