/* Terra Firme SIPB — protótipo Binisoft */

:root {
  --bg: #f3f6f4;
  --bg-elevated: #ffffff;
  --bg-soft: #e8efe9;
  --ink: #15241c;
  --ink-soft: #3d5248;
  --muted: #6b7f74;
  --line: #d5e0d8;
  --brand: #2f6b4f;
  --brand-deep: #1e4634;
  --brand-soft: #d8ebe0;
  --accent: #c45c26;
  --accent-soft: #f8e6dc;
  --ai: #1a6b8a;
  --ai-soft: #d9eef6;
  --ok: #2a7a4b;
  --warn: #b7791f;
  --danger: #a33b3b;
  --shadow: 0 12px 40px rgba(21, 36, 28, 0.08);
  --radius: 16px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(47, 107, 79, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(196, 92, 38, 0.08), transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.tf-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

/* Top bar */
.tf-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1.1rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.tf-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.tf-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.tf-brand-text strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.tf-brand-text span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

.tf-nav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tf-nav a,
.tf-nav .chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1px solid transparent;
  transition: 0.18s ease;
}

.tf-nav a:hover,
.tf-nav .chip:hover {
  background: var(--bg-soft);
}

.tf-nav a.active,
.tf-nav .chip.active {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-color: #b7d4c4;
}

.badge-proto {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

/* Pitch page */
.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 2rem;
}

.hero-company .hero-copy {
  background:
    linear-gradient(145deg, rgba(30, 70, 52, 0.06), transparent 55%),
    var(--bg-elevated);
}

.hero-company h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
}

.founder-blurb {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.founder-blurb strong {
  color: var(--brand-deep);
}

.hero-compact {
  margin-bottom: 0;
}

.hero-compact .h-project {
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
}

.card-sub {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 0.15rem;
}

.note-company {
  margin-top: 1.15rem;
}

.hero-copy,
.hero-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 2.4rem);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 0.85rem;
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--brand-deep);
}

.hero-lead {
  margin: 0 0 1.4rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 36rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.75rem 1.15rem;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn-primary {
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(30, 70, 52, 0.25);
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  border-color: #b7c9bc;
  background: var(--bg-soft);
}

.btn-ai {
  background: var(--ai-soft);
  color: var(--ai);
  border-color: #b7dcea;
}

.btn-ai:hover {
  background: #c8e8f3;
}

.btn-sm {
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  border-radius: 9px;
}

.hero-card h2 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--brand-deep);
}

.hero-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.hero-card li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.75rem;
  border-radius: 12px;
  background: var(--bg-soft);
}

.hero-card .n {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.section {
  margin: 2rem 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.55rem;
  color: var(--brand-deep);
}

.section-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: 0 6px 20px rgba(21, 36, 28, 0.04);
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.icon-dot {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 0.85rem;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 1.1rem;
}

.roadmap {
  display: grid;
  gap: 0.75rem;
}

.roadmap-item {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.roadmap-item.cost-item {
  display: block;
  padding: 1.1rem 1.2rem;
}

.roadmap-item strong {
  color: var(--brand);
  font-size: 0.85rem;
}

.price-tag {
  display: inline-block;
  margin: 0 0.45rem 0.35rem 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.price-tag-quote {
  background: var(--accent-soft);
  color: var(--accent);
}

.cost-item {
  display: block;
}

.cost-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.cost-head strong {
  color: var(--brand-deep);
  font-size: 0.95rem;
}

.cost-desc {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.price-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(30, 70, 52, 0.22);
  white-space: nowrap;
}

.price-badge-quote {
  background: linear-gradient(145deg, #d97845, var(--accent));
  box-shadow: 0 6px 16px rgba(196, 92, 38, 0.22);
  font-size: 0.8rem;
}

.price-summary {
  margin-top: 0.85rem;
  padding: 0.95rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(120deg, var(--brand-soft), #eef7f1);
  border: 1px solid #b7d4c4;
  color: var(--brand-deep);
  font-size: 0.95rem;
}

.maint-box {
  margin-top: 0.85rem;
  padding: 1.05rem 1.15rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
}

.maint-box h3 {
  margin: 0 0 0.65rem;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--brand-deep);
}

.maint-box ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.maint-box li + li {
  margin-top: 0.35rem;
}

.note {
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: linear-gradient(120deg, var(--ai-soft), #eef7f1);
  border: 1px solid #c5dde8;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.foot {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.glossary {
  margin-top: 2rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.45);
}

.glossary-title {
  margin: 0 0 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.glossary-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.35rem 1.25rem;
}

.glossary-list > div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.4rem;
  align-items: baseline;
}

.glossary-list dt {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--brand-deep);
}

.glossary-list dd {
  margin: 0;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Cascata PEI */
.pei-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
  position: sticky;
  top: 0.5rem;
  z-index: 20;
  padding: 0.45rem 0;
  background: linear-gradient(180deg, var(--bg) 70%, transparent);
}

.pei-jump a {
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-deep);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  box-shadow: 0 4px 12px rgba(30, 70, 52, 0.06);
}

.pei-jump a:hover {
  border-color: #a8cbb8;
  background: #f4faf6;
}

.cascade-hero {
  border-color: #b7d4c4;
  background:
    linear-gradient(165deg, rgba(47, 107, 79, 0.07), transparent 42%),
    #fff;
  box-shadow: 0 14px 36px rgba(47, 107, 79, 0.1);
}

.cascade-steps {
  display: grid;
  gap: 0.75rem;
}

.c-step {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fbfdfc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.c-step:focus-within {
  border-color: #a8cbb8;
  box-shadow: 0 8px 22px rgba(47, 107, 79, 0.08);
}

.c-step-num {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 6px 14px rgba(30, 70, 52, 0.2);
}

.c-step-body {
  min-width: 0;
}

.c-step-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.c-step-title .btn {
  margin-left: auto;
}

.c-step-title strong {
  font-size: 1rem;
  color: var(--brand-deep);
}

.c-step-title span {
  font-size: 0.75rem;
  color: var(--muted);
}

.c-obs-label {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.c-obs {
  width: 100%;
  min-height: 6.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  resize: vertical;
}

.c-obs:focus {
  outline: none;
  border-color: #a8cbb8;
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.12);
}

.ai-box-inline {
  margin-top: 0.75rem;
}

.goals-compact {
  gap: 0.5rem;
}

.goal-compact {
  padding: 0.65rem 0.75rem;
}

.goal-compact h4 {
  font-size: 0.86rem;
  margin: 0 0 0.15rem;
}

.goal-compact p {
  font-size: 0.75rem;
}

.goal-compact .progress-steps {
  margin-top: 0.45rem;
}

.goal-compact .progress-steps button {
  padding: 0.2rem 0.45rem;
  font-size: 0.68rem;
}

.goals-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.ficha-preview {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 1rem;
  background: #fbfdfc;
  font-size: 0.88rem;
}

.ficha-meta {
  margin: 0.5rem 0;
  color: var(--muted);
}

.ficha-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-deep);
  margin: 0.75rem 0 0.35rem;
}

.ficha-preview ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.84rem;
}

.ficha-preview ul em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
}

.ficha-checks {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.ficha-muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.ficha-foot {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.c-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: #fff;
  color: var(--ink);
  font-size: 0.92rem;
  cursor: pointer;
}

.c-select:focus {
  outline: none;
  border-color: #a8cbb8;
  box-shadow: 0 0 0 3px rgba(47, 107, 79, 0.12);
}

.c-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
  min-height: 2.2rem;
}

.c-empty {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.c-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 100%;
  padding: 0.65rem 0.75rem 0.65rem 0.55rem;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
  animation: fadeIn 0.2s ease;
}

.c-badge em {
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.55);
}

.c-badge span {
  flex: 1;
  min-width: 0;
}

.c-badge-x {
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.c-badge-x:hover {
  background: rgba(0, 0, 0, 0.14);
}

.c-badge-skill {
  background: #dcefe4;
  border-color: #b7d4c4;
  color: var(--brand-deep);
}

.c-badge-objective {
  background: #e4f0ea;
  border-color: #c1d9cb;
  color: #1e4634;
}

.c-badge-behavior {
  background: #e8f3f8;
  border-color: #b7dcea;
  color: var(--ai);
}

.c-badge-barrier {
  background: var(--accent-soft);
  border-color: #efc9b3;
  color: #9a4a1f;
}

.c-badge-adaptation {
  background: #edf6e8;
  border-color: #c5dfb8;
  color: #2a5f38;
}

.cascade-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

/* Year skills */
.year-block-head {
  margin: 0 0 0.85rem;
}

.year-block-head h3 {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  color: var(--brand-deep);
}

.year-block-head .hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.year-skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.skill-chip {
  padding: 0.85rem;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.skill-chip strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  color: var(--brand-deep);
}

.skill-chip ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

/* Coordination map */
.coord-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

.coord-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.coord-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #fff;
}

.coord-map {
  display: grid;
  gap: 0.85rem;
}

.map-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.map-card > header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.map-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.map-children {
  display: grid;
  gap: 0.65rem;
}

.map-barrier {
  padding: 0.75rem;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.map-barrier-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.map-barrier-head strong {
  flex: 1;
  font-size: 0.88rem;
}

.map-adapts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

@media (max-width: 920px) {
  .coord-form {
    grid-template-columns: 1fr;
  }

  .c-step {
    grid-template-columns: 2.4rem 1fr;
  }
}

/* App screens */
.view {
  display: none;
  animation: fadeIn 0.28s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-title {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--brand-deep);
}

.page-sub {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.years-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}

.year-card {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  border-radius: 16px;
  padding: 1.1rem 1rem;
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
  box-shadow: 0 6px 18px rgba(21, 36, 28, 0.04);
}

.year-card:hover {
  transform: translateY(-2px);
  border-color: #b7d4c4;
  box-shadow: var(--shadow);
}

.year-card .seg {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.year-card .name {
  display: block;
  margin: 0.35rem 0 0.55rem;
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--brand-deep);
}

.year-card .meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.students {
  display: grid;
  gap: 0.65rem;
}

.student-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.9rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: 0.15s ease;
}

.student-row:hover {
  border-color: #b7d4c4;
  background: #fbfdfc;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #4d8f6c, #2f6b4f);
}

.student-row h3 {
  margin: 0;
  font-size: 1rem;
}

.student-row p {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-soft);
}

.tag.filled {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.tag.warn {
  background: var(--accent-soft);
  color: var(--accent);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.back-link:hover {
  color: var(--brand);
}

/* Student PEI layout */
.pei-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: start;
}

.pei-side {
  position: sticky;
  top: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}

.pei-side .avatar.lg {
  width: 56px;
  height: 56px;
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.pei-side h2 {
  margin: 0 0 0.2rem;
  font-family: var(--display);
  font-size: 1.35rem;
}

.pei-side .meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.side-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
}

.side-list span {
  color: var(--muted);
}

.pei-main {
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: 0 6px 18px rgba(21, 36, 28, 0.04);
}

.panel.highlight {
  border-color: #b7d4c4;
  box-shadow: 0 10px 28px rgba(47, 107, 79, 0.1);
  background: linear-gradient(180deg, #f7fbf8, #fff 40%);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.panel-head h3 {
  margin: 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.panel-head .hint {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.goals {
  display: grid;
  gap: 0.75rem;
}

.goal {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  background: #fff;
}

.goal-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
}

.goal h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.goal p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.progress-steps {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.progress-steps button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.progress-steps button.on {
  background: var(--brand-soft);
  border-color: #a8cbb8;
  color: var(--brand-deep);
}

.progress-steps button.done {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.sheet-wrap {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table.sheet {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.8rem;
}

table.sheet th,
table.sheet td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.5rem;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

table.sheet th:nth-child(1),
table.sheet td:nth-child(1) {
  width: 7.5rem;
}

table.sheet th {
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

table.sheet tr:hover td {
  background: #fbfdfc;
}

table.sheet input,
table.sheet select {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 0.35rem 0.4rem;
  color: var(--ink);
  font: inherit;
  box-sizing: border-box;
}

table.sheet textarea {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 0.35rem 0.4rem;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.45;
  resize: none;
  overflow: hidden;
  min-height: 0;
  height: auto;
  box-sizing: border-box;
  white-space: pre-wrap;
  field-sizing: content;
}

table.sheet.sheet-grow td {
  vertical-align: top;
  height: auto;
}

table.sheet input:focus,
table.sheet select:focus,
table.sheet textarea:focus {
  outline: none;
  border-color: #b7d4c4;
  background: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field-row {
  display: flex;
  align-items: end;
  gap: 0.5rem;
}

.field-row .field {
  flex: 1;
}

.ai-box {
  display: none;
  margin-top: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ai-soft), #eef8f3);
  border: 1px solid #b7dcea;
  animation: fadeIn 0.25s ease;
}

.ai-box.show {
  display: block;
}

.ai-box .ai-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ai);
  margin-bottom: 0.4rem;
}

.ai-box p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

.ai-box .ai-actions {
  margin-top: 0.7rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.steps {
  display: grid;
  gap: 0.65rem;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.step .num {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 0.75rem;
  font-weight: 800;
}

.step h4 {
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
}

.step p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--brand-deep);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: none;
}

@media (max-width: 920px) {
  .hero,
  .pei-layout,
  .grid-3,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .pei-side {
    position: static;
  }

  .roadmap-item {
    grid-template-columns: 1fr;
  }

  .tf-top {
    border-radius: 18px;
    flex-direction: column;
    align-items: stretch;
  }

  .tf-nav {
    justify-content: flex-start;
  }
}

/* ===========================================================
   PEI Terra Firme — sistema (extensões além do protótipo)
   =========================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg-soft);
}

.user-chip {
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.badge-version {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: middle;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
}

/* Flash messages */
.flash-stack {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.flash-ok {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-color: #b7d4c4;
}

.flash-error {
  background: #f6dede;
  color: var(--danger);
  border-color: #e3b8b8;
}

.flash-warn {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #efc9b3;
}

/* Auth pages */
.auth-wrap {
  min-height: 60vh;
  display: grid;
  place-items: center;
  padding: 2rem 0;
}

.auth-box {
  width: min(100%, 380px);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
}

.auth-mark {
  margin: 0 auto 1rem;
}

.auth-box .field {
  text-align: left;
}

/* Forms genéricos */
.field select {
  cursor: pointer;
}

/* Acompanhamento — cards com <details> nativo (sem JS) */
.history-list {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.history-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: #fff;
}

.history-card summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  list-style: none;
}

.history-card summary::-webkit-details-marker {
  display: none;
}

.history-card summary::before {
  content: "▸";
  color: var(--muted);
  transition: transform 0.15s ease;
}

.history-card[open] summary::before {
  transform: rotate(90deg);
}

.hist-sum {
  color: var(--muted);
  font-size: 0.82rem;
  flex: 1;
  min-width: 0;
}

.history-new {
  border-style: dashed;
  border-color: #b7d4c4;
  background: #fbfdfc;
}

/* Ficha de impressão */
.ficha-print label {
  display: block;
  font-size: 0.86rem;
  margin: 0.2rem 0;
}

.ficha-print input[type="checkbox"] {
  margin-right: 0.4rem;
}

@media print {
  .no-print,
  .tf-top,
  .pei-jump,
  .flash-stack {
    display: none !important;
  }

  .tf-shell {
    max-width: none;
    padding: 0;
  }

  body {
    background: #fff;
  }

  .ficha-preview {
    border: 1px solid #000;
  }
}

/* Mapeamento de habilidades */
/* Mapeamento de habilidades — board drag & drop (pais à esquerda, pool à direita) */
.skills-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.skills-board {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}

.skills-parents {
  display: grid;
  gap: 0.85rem;
}

.parent-box {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.parent-box-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.parent-box-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.parent-box-title strong.parent-name {
  font-family: var(--display);
  font-size: 1rem;
}

.parent-box-title .hint {
  font-size: 0.76rem;
  color: var(--muted);
  width: 100%;
}

.parent-box-children {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 3rem;
  padding: 0.35rem;
  border-radius: 10px;
}

.child-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  font-size: 0.86rem;
}

.child-chip-text em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
}

.pool-chip {
  background: var(--bg-elevated);
}

.pool-chip .pick-group {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.skills-empty-hint {
  margin: 0;
  padding: 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 10px;
  text-align: center;
}

.skills-pool {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  position: sticky;
  top: 1rem;
  max-height: 82vh;
  overflow-y: auto;
}

.skills-pool h4 {
  margin: 0 0 0.15rem;
  font-family: var(--display);
  font-size: 0.98rem;
}

.skills-pool-list {
  display: grid;
  gap: 0.4rem;
}

@media (max-width: 920px) {
  .skills-board {
    grid-template-columns: 1fr;
  }

  .skills-pool {
    position: static;
    max-height: none;
  }
}

/* Coordenação — dashboard cards com links */
.skill-chip a {
  color: var(--brand-deep);
  text-decoration: underline;
}

/* Botões dentro de badges/tags sem herdar estilo de link */
.c-badge form {
  display: inline-flex;
}

/* ===========================================================
   Infra AJAX — indicador de salvo inline, modal, drag & drop
   =========================================================== */

.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ok);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  white-space: nowrap;
}

.save-indicator.show {
  opacity: 1;
  transform: none;
}

.save-indicator.is-error {
  color: var(--danger);
}

.field-row .save-indicator,
.c-obs-label .save-indicator,
.panel-head .save-indicator {
  display: inline-flex;
}

/* Modal genérico */
body.modal-open {
  overflow: hidden;
}

.tf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 36, 28, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 1rem;
  z-index: 100;
  overflow-y: auto;
  animation: fadeIn 0.15s ease;
}

.tf-modal {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tf-modal-wide {
  max-width: 880px;
}

.tf-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.tf-modal-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
}

.tf-modal-close {
  border: none;
  background: var(--bg-soft);
  color: var(--ink-soft);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.tf-modal-close:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.tf-modal-body {
  padding: 1.1rem 1.25rem 1.25rem;
  overflow-y: auto;
}

.tf-modal-foot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.9rem;
  margin-top: 0.9rem;
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: var(--bg-elevated);
}

/* Tabela de seleção múltipla dentro do modal (cascata) */
.tf-pick-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
}

.tf-pick-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tf-pick-table tr {
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.tf-pick-table tr:hover {
  background: var(--bg-soft);
}

.tf-pick-table td {
  padding: 0.55rem 0.5rem;
  vertical-align: top;
}

.tf-pick-table td.pick-check {
  width: 2rem;
}

.tf-pick-table td.pick-check input {
  width: 1.05rem;
  height: 1.05rem;
}

.tf-pick-table .pick-group {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.tf-pick-empty {
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Ícones de ação (copiar/editar/excluir) reutilizáveis */
.icon-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.icon-btn {
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink-soft);
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-color: var(--brand-soft);
}

.icon-btn.danger:hover {
  background: #f6e4e4;
  color: var(--danger);
  border-color: #f0caca;
}

/* Planejamento de ensino da turma */
.planning-objectives {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.5rem;
}

.planning-objective-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elevated);
  font-size: 0.86rem;
  cursor: pointer;
}

.planning-objective-check input {
  margin-top: 0.2rem;
}

.planning-objective-check em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
}

.planning-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.activities-list {
  display: grid;
  gap: 0.75rem;
}

.activity-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
}

.activity-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

.activity-card p {
  margin: 0.4rem 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.planning-chat {
  display: flex;
  flex-direction: column;
  max-height: 34rem;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  padding-right: 0.25rem;
}

.chat-msg {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
}

.chat-msg-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.chat-msg p {
  margin: 0;
  font-size: 0.88rem;
}

.chat-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  resize: vertical;
  margin-bottom: 0.5rem;
}

@media (max-width: 920px) {
  .planning-grid {
    grid-template-columns: 1fr;
  }
}

/* Drag & drop nativo */
.tf-draggable {
  cursor: grab;
}

.tf-draggable.dragging {
  opacity: 0.45;
}

.tf-dropzone {
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.tf-dropzone.drag-over {
  background: var(--brand-soft) !important;
  box-shadow: inset 0 0 0 2px var(--brand);
}

/* Acompanhamento — os 8 passos do SIPB */
.hist-steps-mini {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
}

.history-context {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px dashed var(--line);
}

/* Barra de progresso "X/8 passos" — cor e mensagem mudam com o avanço */
.steps-progress {
  margin-bottom: 0.9rem;
}

.steps-progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
}

.steps-progress-count {
  font-weight: 800;
  color: var(--brand-deep);
}

.steps-progress-msg {
  font-weight: 700;
  color: var(--ok);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.steps-progress-msg.show {
  opacity: 1;
  transform: none;
}

.steps-progress-track {
  height: 0.55rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}

.steps-progress-fill {
  height: 100%;
  width: 12.5%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--warn), #d9a441);
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.35s ease;
}

.steps-progress-fill.lvl-mid {
  background: linear-gradient(90deg, var(--brand), #4d8f6c);
}

.steps-progress-fill.lvl-done {
  background: linear-gradient(90deg, var(--ok), #3ea866);
}

.history-steps {
  display: grid;
  gap: 0.75rem;
}

.history-step {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: var(--bg-soft);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.history-step:has(.step-check:checked) {
  background: var(--brand-soft);
  border-color: #a8cbb8;
  box-shadow: 0 2px 10px rgba(47, 107, 79, 0.08);
}

.history-step-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  margin-bottom: 0.55rem;
}

.step-badge {
  position: relative;
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  margin-top: 0.05rem;
}

.step-check {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.step-badge-num,
.step-badge-check {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--bg-elevated);
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--ink-soft);
  transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease, border-color 0.25s ease;
}

.step-badge-check {
  opacity: 0;
  transform: scale(0.4);
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
  font-size: 0.95rem;
}

.step-check:checked ~ .step-badge-num {
  opacity: 0;
  transform: scale(0.4);
}

.step-check:checked ~ .step-badge-check {
  opacity: 1;
  transform: scale(1);
}

.step-check:focus-visible ~ .step-badge-num,
.step-check:focus-visible ~ .step-badge-check {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.step-check:disabled {
  cursor: default;
}

.history-step-head strong {
  display: block;
  font-size: 0.88rem;
}

.history-step-head em {
  display: block;
  font-style: normal;
  font-size: 0.76rem;
  color: var(--muted);
}

.history-step textarea,
.history-step select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  background: var(--bg-elevated);
}

.history-step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

@media (max-width: 920px) {
  .history-context,
  .history-step-grid {
    grid-template-columns: 1fr;
  }
}

/* Relatório para a família */
.report-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.report-textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: var(--bg-elevated);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
}

.report-sections {
  display: grid;
  gap: 0.85rem;
}

.report-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: var(--bg-soft);
}

.report-section-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.report-section-title {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--bg-elevated);
}

.report-section-body {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  background: var(--bg-elevated);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
}

/* Preview/impressão do relatório */
.report-body {
  margin: 0.75rem 0;
}

.report-body p {
  white-space: pre-wrap;
  margin: 0 0 0.75rem;
  line-height: 1.55;
}

.report-signatures {
  margin-top: 2.25rem;
  display: grid;
  gap: 1.75rem;
}

.report-sign-line {
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.report-sign-rule {
  border-top: 1px solid #000;
  width: 60%;
  min-width: 14rem;
}

@media print {
  .report-signatures {
    break-inside: avoid;
  }
}

