/* Escala 5×2 + validador — animações didáticas */

@keyframes esc-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes esc-pop {
  0% { transform: scale(0.82); opacity: 0; }
  70% { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes esc-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes esc-pulse-soft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(130, 30, 60, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(130, 30, 60, 0); }
}
@keyframes esc-dash {
  to { stroke-dashoffset: 0; }
}
@keyframes esc-check-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes esc-glow-rest {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

.esc-story {
  margin: 1.75rem 0 0;
  display: grid;
  gap: 1.25rem;
}

.esc-story__card {
  background: linear-gradient(160deg, #fff8f9 0%, #ffffff 55%, #f7f3f5 100%);
  border: 1px solid #ead9df;
  border-radius: 18px;
  padding: 1.15rem 1.25rem 1.3rem;
  animation: esc-fade-up 0.55s ease both;
}

.esc-story__card:nth-child(2) { animation-delay: 0.08s; }
.esc-story__card:nth-child(3) { animation-delay: 0.16s; }
.esc-story__card:nth-child(4) { animation-delay: 0.24s; }

.esc-story__eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #821e3c;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.esc-story__card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  color: #2c1a22;
}

.esc-story__card p {
  margin: 0;
  color: #4a3540;
  line-height: 1.55;
  font-size: 0.95rem;
}

/* Semana animada 5×2 */
.esc-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 1rem;
}

.esc-day {
  border-radius: 12px;
  padding: 0.65rem 0.2rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: scale(0.85);
  border: 1px solid transparent;
}

.esc-day.is-on {
  animation: esc-pop 0.45s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

.esc-day--work {
  background: #821e3c;
  color: #fff;
}

.esc-day--rest {
  background: #e8f6ee;
  color: #1f6b3a;
  border-color: #b7e0c5;
  animation-name: esc-pop, esc-glow-rest;
  animation-duration: 0.45s, 2.4s;
  animation-timing-function: cubic-bezier(0.2, 0.9, 0.2, 1), ease-in-out;
  animation-iteration-count: 1, infinite;
  animation-fill-mode: forwards, none;
}

.esc-day__label { display: block; opacity: 0.85; font-weight: 600; }
.esc-day__tag { display: block; margin-top: 0.25rem; font-size: 0.68rem; }

.esc-week__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: #5a4450;
}

.esc-week__legend span::before {
  content: "";
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 3px;
  margin-right: 0.35rem;
  vertical-align: -1px;
}
.esc-week__legend .lg-work::before { background: #821e3c; }
.esc-week__legend .lg-rest::before { background: #7bc49a; }

/* Timeline fases */
.esc-timeline {
  position: relative;
  margin-top: 1.1rem;
  padding-left: 0.25rem;
}

.esc-timeline__track {
  position: absolute;
  left: 0.85rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 3px;
  background: #ead9df;
  border-radius: 2px;
  overflow: hidden;
}

.esc-timeline__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #821e3c, #c45a78);
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.esc-timeline.is-live .esc-timeline__fill { transform: scaleY(1); }

.esc-timeline__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.esc-step {
  position: relative;
  padding: 0.75rem 0.85rem 0.75rem 2.4rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #f0e4e8;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s ease;
}

.esc-timeline.is-live .esc-step {
  opacity: 1;
  transform: translateX(0);
}
.esc-timeline.is-live .esc-step:nth-child(1) { transition-delay: 0.1s; }
.esc-timeline.is-live .esc-step:nth-child(2) { transition-delay: 0.28s; }
.esc-timeline.is-live .esc-step:nth-child(3) { transition-delay: 0.46s; }

.esc-step::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 1rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #c9a3b0;
  z-index: 1;
}

.esc-step.is-active {
  border-color: #821e3c;
  box-shadow: 0 8px 24px rgba(130, 30, 60, 0.08);
  animation: esc-pulse-soft 2.2s ease-in-out infinite;
}
.esc-step.is-active::before {
  border-color: #821e3c;
  background: #821e3c;
}

.esc-step__when {
  font-size: 0.75rem;
  font-weight: 700;
  color: #821e3c;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.esc-step__title {
  margin: 0.15rem 0 0.2rem;
  font-size: 1rem;
  color: #2c1a22;
}
.esc-step__desc {
  margin: 0;
  font-size: 0.88rem;
  color: #5a4450;
  line-height: 1.45;
}

/* Barras de carga */
.esc-bars {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.esc-bar {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.85rem;
}

.esc-bar__track {
  height: 0.7rem;
  border-radius: 999px;
  background: #f0e4e8;
  overflow: hidden;
}

.esc-bar__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: #821e3c;
}

.esc-bar--44 .esc-bar__fill { background: #9a3d57; }
.esc-bar--42 .esc-bar__fill { background: #c45a78; }
.esc-bar--40 .esc-bar__fill { background: #1f6b3a; }

.esc-bars.is-live .esc-bar__fill { transform: scaleX(1); }
.esc-bars.is-live .esc-bar:nth-child(1) .esc-bar__fill { transition-delay: 0.05s; }
.esc-bars.is-live .esc-bar:nth-child(2) .esc-bar__fill { transition-delay: 0.18s; }
.esc-bars.is-live .esc-bar:nth-child(3) .esc-bar__fill { transition-delay: 0.32s; }

.esc-bar__val { font-weight: 700; color: #3d2f35; min-width: 2.5rem; text-align: right; }

/* Exceções */
.esc-except {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.esc-except__item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #f0e4e8;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.esc-except.is-live .esc-except__item {
  opacity: 1;
  transform: translateY(0);
}
.esc-except.is-live .esc-except__item:nth-child(1) { transition-delay: 0.05s; }
.esc-except.is-live .esc-except__item:nth-child(2) { transition-delay: 0.12s; }
.esc-except.is-live .esc-except__item:nth-child(3) { transition-delay: 0.19s; }
.esc-except.is-live .esc-except__item:nth-child(4) { transition-delay: 0.26s; }
.esc-except.is-live .esc-except__item:nth-child(5) { transition-delay: 0.33s; }

.esc-except__ico {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: #fdecee;
  color: #821e3c;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.esc-except__item strong {
  display: block;
  font-size: 0.9rem;
  color: #2c1a22;
}
.esc-except__item span {
  font-size: 0.82rem;
  color: #5a4450;
  line-height: 1.4;
}

/* Checklist RH */
.esc-check {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.esc-check__item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid #ead9df;
  background: #fff;
  animation: esc-check-in 0.35s ease both;
}

.esc-check__item:nth-child(1) { animation-delay: 0.04s; }
.esc-check__item:nth-child(2) { animation-delay: 0.08s; }
.esc-check__item:nth-child(3) { animation-delay: 0.12s; }
.esc-check__item:nth-child(4) { animation-delay: 0.16s; }
.esc-check__item:nth-child(5) { animation-delay: 0.2s; }
.esc-check__item:nth-child(6) { animation-delay: 0.24s; }
.esc-check__item:nth-child(7) { animation-delay: 0.28s; }

.esc-check__dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex: 0 0 auto;
}
.esc-check__item--verde { border-color: #b7e0c5; background: #f3faf6; }
.esc-check__item--verde .esc-check__dot { background: #1f6b3a; }
.esc-check__item--amarelo { border-color: #f0d9a8; background: #fffbf2; }
.esc-check__item--amarelo .esc-check__dot { background: #b45309; }
.esc-check__item--vermelho { border-color: #f0b8c0; background: #fdf4f5; }
.esc-check__item--vermelho .esc-check__dot { background: #9b1c2e; }

.esc-check__txt { margin: 0; font-size: 0.9rem; color: #2c1a22; line-height: 1.4; }
.esc-check__art { margin: 0.25rem 0 0; font-size: 0.78rem; color: #821e3c; font-weight: 600; }

.esc-fase-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #fdecee;
  color: #821e3c;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.esc-days-pick {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.esc-days-pick label {
  display: block;
  text-align: center;
  padding: 0.55rem 0.15rem;
  border-radius: 10px;
  border: 1px solid #ead9df;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.esc-days-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.esc-days-pick label:has(input:checked) {
  background: #821e3c;
  color: #fff;
  border-color: #821e3c;
  transform: translateY(-1px);
}

.esc-notice {
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: #faf6f7;
  border: 1px solid #f0e4e8;
  font-size: 0.86rem;
  color: #5a4450;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .esc-week { gap: 0.3rem; }
  .esc-day { padding: 0.5rem 0.1rem; font-size: 0.65rem; }
  .esc-bar { grid-template-columns: 3.2rem 1fr auto; }
  .esc-days-pick { gap: 0.25rem; }
}
