:root {
  --ink: #17333a;
  --muted: #5e7074;
  --primary: #0b5d5b;
  --primary-dark: #084846;
  --accent: #d6771e;
  --surface: #ffffff;
  --soft: #eef6f5;
  --line: #cfdddc;
  --danger: #b3261e;
  --carne: #fff1e7;
  --carne-ink: #8b4513;
  --leche: #e7f6ef;
  --leche-ink: #176844;
  --indefinido: #fff8d9;
  --indefinido-ink: #765d00;
  --shadow: 0 12px 32px rgba(18, 56, 61, 0.10);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  min-width: 280px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 5%, rgba(214, 119, 30, 0.10), transparent 25rem),
    linear-gradient(180deg, #eaf5f4 0, #f7faf9 22rem);
  line-height: 1.5;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.35rem 1rem 1rem;
}

.brand { display: flex; align-items: center; gap: 1rem; }
.brand__logo {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(11, 93, 91, 0.18);
}

.eyebrow {
  margin: 0 0 .15rem;
  color: var(--primary);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .15rem; font-size: clamp(1.65rem, 4vw, 2.35rem); line-height: 1.05; }
h2 { margin-bottom: .2rem; font-size: 1.2rem; }
.subtitle, .section-heading p, .intro-card p { margin-bottom: 0; color: var(--muted); }

.zoom-controls {
  display: flex;
  flex: 0 0 auto;
  gap: .35rem;
  padding: .3rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.85);
}

.icon-button {
  min-width: 44px;
  min-height: 44px;
  padding: .4rem .55rem;
  border: 0;
  border-radius: 8px;
  color: var(--primary);
  background: transparent;
  font-weight: 750;
  cursor: pointer;
}
.icon-button:hover, .icon-button:focus-visible { background: var(--soft); outline: 2px solid transparent; }

.shell { max-width: 920px; margin: 0 auto; padding: .5rem 1rem 2rem; }
.intro-card, .form-card, .results-card, .method-card {
  margin-bottom: 1rem;
  border: 1px solid rgba(207, 221, 220, .9);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.intro-card, .form-card, .results-card { padding: clamp(1rem, 4vw, 1.6rem); }
.intro-card > div:first-child, .section-heading { display: flex; align-items: flex-start; gap: .75rem; }

.step-badge {
  display: inline-grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
}

.progress-wrap { margin-top: 1rem; }
.progress-label { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; font-size: .88rem; color: var(--muted); }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #dfe9e8; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #2f9991); transition: width .25s ease; }

.fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.field label { display: block; margin-bottom: .35rem; font-weight: 720; }
.field label span { color: var(--primary); font-size: .78rem; }
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%;
  min-height: 48px;
  padding: .7rem 3rem .7rem .8rem;
  border: 1px solid #aebfbd;
  border-radius: 10px;
  color: var(--ink);
  background: #fbfdfd;
  outline: none;
}
.input-wrap > span {
  position: absolute;
  top: 50%;
  right: .8rem;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}
.input-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11, 93, 91, .14); }
.field.is-invalid input { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(179, 38, 30, .08); }
.field-error { display: block; min-height: 1.1rem; margin-top: .2rem; color: var(--danger); font-size: .78rem; }

.message { margin-top: 1rem; padding: .75rem 1rem; border-left: 4px solid var(--danger); border-radius: 8px; color: #6f211b; background: #fff1f0; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }
.button {
  min-height: 48px;
  padding: .72rem 1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 780;
  cursor: pointer;
}
.button:focus-visible { outline: 3px solid rgba(11, 93, 91, .22); outline-offset: 2px; }
.button--primary { flex: 1 1 230px; color: #fff; background: var(--primary); }
.button--primary:hover { background: var(--primary-dark); }
.button--secondary { color: #fff; background: #286d83; }
.button--secondary:hover { background: #1e5668; }
.button--quiet { color: var(--ink); border-color: var(--line); background: #f7faf9; }
.button--quiet:hover { background: #edf3f2; }

.summary-band {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem 1.5rem;
  align-items: center;
  margin: 1.2rem 0;
  padding: 1rem;
  border-radius: 14px;
}
.summary-band.carne { color: var(--carne-ink); background: var(--carne); }
.summary-band.leche { color: var(--leche-ink); background: var(--leche); }
.summary-band.indefinido { color: var(--indefinido-ink); background: var(--indefinido); }
.summary-label { margin: 0; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.summary-result { margin: .1rem 0 0; font-size: 1.55rem; font-weight: 850; }
.scores { display: flex; gap: .5rem; }
.score { min-width: 82px; padding: .5rem .65rem; border-radius: 10px; text-align: center; background: rgba(255,255,255,.66); }
.score span { display: block; font-size: .72rem; }
.score strong { font-size: 1.15rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #36555a; background: var(--soft); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.index-name strong { display: block; }
.index-name span, .criterion { color: var(--muted); font-size: .8rem; }
.aptitude { display: inline-block; padding: .25rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 800; }
.aptitude.carne { color: var(--carne-ink); background: var(--carne); }
.aptitude.leche { color: var(--leche-ink); background: var(--leche); }
.aptitude.indefinido { color: var(--indefinido-ink); background: var(--indefinido); }

.method-card { overflow: hidden; }
.method-card summary { padding: 1rem 1.2rem; color: var(--primary); font-weight: 800; cursor: pointer; }
.method-content { padding: 0 1.2rem 1.1rem; color: var(--muted); }
.method-content p:last-child { margin-bottom: 0; }
.notice { padding: .8rem; border-radius: 10px; color: #644b00; background: #fff8dd; }
footer { padding: 0 1rem 1.5rem; color: var(--muted); text-align: center; font-size: .82rem; }

[hidden] { display: none !important; }

@media (max-width: 650px) {
  .app-header { align-items: flex-start; }
  .brand__logo { width: 72px; height: 72px; border-radius: 18px; }
  .subtitle { display: none; }
  .zoom-controls { position: fixed; right: .6rem; bottom: .6rem; z-index: 10; box-shadow: var(--shadow); }
  .fields-grid { grid-template-columns: 1fr; gap: .6rem; }
  .summary-band { grid-template-columns: 1fr; }
  .actions .button { flex: 1 1 100%; }
}

@media (max-width: 390px) {
  .brand { align-items: flex-start; }
  .brand__logo { width: 58px; height: 58px; }
  .app-header { padding-inline: .7rem; }
  .shell { padding-inline: .7rem; }
}

@media print {
  body { background: #fff; }
  .app-header, .intro-card, .form-card, .method-card, footer, .results-card .actions { display: none !important; }
  .shell { max-width: none; padding: 0; }
  .results-card { border: 0; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
.suite-home-link {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.66rem 1rem;
  border: 1px solid rgba(41, 216, 255, 0.55);
  border-radius: 999px;
  background: rgba(3, 16, 29, 0.95);
  color: #f5f9fc;
  font: 700 0.84rem/1 Arial, sans-serif;
  text-decoration: none;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  -webkit-tap-highlight-color: transparent;
}

.suite-home-link:hover {
  border-color: #29d8ff;
  color: #73e8ff;
}

.suite-home-link:focus-visible {
  outline: 3px solid #9eea43;
  outline-offset: 3px;
}
