/* Tela inicial (index.html): carrossel da Blocô à esquerda, login à direita. No celular, login em cima.
   Tokens da marca iguais aos do design system Blocô (os mesmos de assets/marca/vitrine.css). */
body.home {
  --tangerina: #ff7a2f;
  --tangerina-suave: #ffe3d1;
  --tangerina-texto: #b5440a;
  --piscina: #17a9a0;
  --piscina-suave: #d3f2ef;
  --piscina-texto: #0b6f69;
  --maracuja: #ffc83d;
  --maracuja-suave: #fff1c7;
  --chiclete: #f25c9a;
  --noite: #23194a;
  --surface: #fff8ee;
  --surface-raised: #ffffff;
  --surface-sunken: #fdeedb;
  --ink-b: #23194a;
  --ink-muted-b: #5e5478;
  --line-b: #efe1cc;
  --line-strong-b: #8f82a6;
  --erro: #c0321f;
  --radius-md-b: 14px;
  --sombra-bloco: 0 4px 0 #23194a;
  --lateral: 460px;
  --font-display: "Bricolage Grotesque", "Arial Rounded MT Bold", system-ui, sans-serif;
  --font-sans: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* o login (core.js) usa --brand: na tela inicial ele é a noite da Blocô */
  --brand: #23194a;
  --brand-ink: #fff8ee;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-b);
  background: var(--surface-sunken);
}
body.home :focus-visible { outline: 3px solid var(--noite); outline-offset: 2px; }

.home-grade {
  min-height: 100vh; min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--lateral);
  grid-template-areas: "carrossel entrada";
}

/* ---------- login ---------- */
.entrada {
  grid-area: entrada;
  background: var(--surface-raised);
  border-left: 1px solid var(--line-b);
  display: flex; flex-direction: column; gap: 8px;
  padding: 40px 48px 28px;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
}
.logo-heroi { display: inline-flex; align-self: flex-start; line-height: 0; border-radius: 12px; }
.logo-heroi svg { height: 64px; width: auto; overflow: visible; }

/* O logo monta o prédio bloco a bloco: base, meio, topo e o telhado caindo por último */
.logo-heroi .lh-b3, .logo-heroi .lh-b2, .logo-heroi .lh-b1, .logo-heroi .lh-porta,
.logo-heroi .lh-telhado, .logo-heroi .lh-nome { transform-box: fill-box; transform-origin: 50% 100%; }
.logo-heroi.monta .lh-b3 { animation: bloco-entra .5s cubic-bezier(.3, 1.4, .5, 1) both; }
.logo-heroi.monta .lh-porta { animation: some-entra .3s ease .35s both; }
.logo-heroi.monta .lh-b2 { animation: bloco-entra .5s cubic-bezier(.3, 1.4, .5, 1) .14s both; }
.logo-heroi.monta .lh-b1 { animation: bloco-entra .5s cubic-bezier(.3, 1.4, .5, 1) .28s both; }
.logo-heroi.monta .lh-telhado { animation: telhado-cai .6s cubic-bezier(.3, 1.5, .5, 1) .46s both; }
.logo-heroi.monta .lh-nome { animation: nome-entra .6s ease .2s both; }
@keyframes bloco-entra { from { opacity: 0; transform: translateY(-70px) scaleY(.6); } 70% { transform: translateY(0) scaleY(.88); } }
@keyframes telhado-cai { from { opacity: 0; transform: translateY(-60px) rotate(-12deg); } 60% { opacity: 1; } }
@keyframes some-entra { from { opacity: 0; } }
@keyframes nome-entra { from { opacity: 0; transform: translateX(-14px); } }
/* respira de leve enquanto a página está aberta: o logo nunca fica parado */
.logo-heroi .lh-telhado { animation: telhado-respira 3.6s ease-in-out 1.2s infinite; }
@keyframes telhado-respira { 50% { transform: translateY(-3px); } }
.logo-heroi:hover .lh-telhado { animation: telhado-pula .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes telhado-pula { 40% { transform: translateY(-9px) rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) {
  .logo-heroi * { animation: none !important; }
}

/* formulario de login do core.js, com a cara da Blocô */
.entrada-form { flex: 1; display: flex; flex-direction: column; justify-content: center; }
body.home .login { min-height: 0; display: block; padding: 28px 0; place-items: initial; }
body.home .login form { background: none; border: 0; padding: 0; max-width: none; gap: 18px; }
body.home .login .brandmark { display: none; }
body.home .login h1 {
  font-family: var(--font-display); font-weight: 800; font-size: 36px; letter-spacing: -.01em; line-height: 1.1; margin: 0 0 6px;
}
body.home .login .muted { color: var(--ink-muted-b); font-size: 16px; }
body.home .login label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink-b); }
body.home .login [data-step] { display: flex; flex-direction: column; gap: 16px; }
body.home .login [data-step][hidden] { display: none; }
body.home .login input {
  font: 400 16px var(--font-sans); color: var(--ink-b); background: var(--surface);
  border: 1.5px solid var(--line-b); border-radius: var(--radius-md-b); padding: 13px 14px; min-height: 0; width: 100%;
}
body.home .login input:hover { border-color: var(--line-strong-b); }
body.home .login input:focus { outline: none; border-color: var(--noite); box-shadow: 0 0 0 3px var(--maracuja-suave); }
body.home .login button[type="submit"] {
  font: 700 17px var(--font-sans); color: var(--noite); background: var(--tangerina);
  border: 2px solid var(--noite); border-radius: var(--radius-md-b); padding: 14px; min-height: 0;
  box-shadow: var(--sombra-bloco); cursor: pointer; transition: transform .08s, box-shadow .08s, background .15s;
}
body.home .login button[type="submit"]:hover { background: #ff8a47; }
body.home .login button[type="submit"]:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--noite); }
body.home .login button[type="submit"]:disabled { opacity: .7; cursor: progress; }
body.home .login a { color: var(--piscina-texto); font-weight: 600; text-decoration: none; }
body.home .login a:hover { text-decoration: underline; }
body.home .login a.button.secondary {
  color: var(--noite); background: var(--surface-raised); border: 1.5px solid var(--line-b); border-radius: var(--radius-md-b);
  padding: 10px 16px; font-weight: 600;
}
body.home .login .error { color: var(--erro); font-weight: 500; }
body.home .login .error:empty { display: none; }
body.home .login img { max-width: 180px; max-height: 56px; }
/* seletor de painel depois do login */
body.home .panel-choices button { border-radius: var(--radius-md-b); border-color: var(--line-b); background: var(--surface); }
body.home .panel-choices button:hover { border-color: var(--noite); }

.conhecer {
  border-top: 1px solid var(--line-b); padding-top: 18px; margin: 0;
  font-size: 15px; line-height: 1.5; color: var(--ink-muted-b);
}
.conhecer a { color: var(--piscina-texto); font-weight: 600; text-decoration: none; }
.conhecer a:hover { text-decoration: underline; }
.entrada-pe { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-muted-b); }

/* ---------- carrossel ---------- */
.carrossel {
  grid-area: carrossel; position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; min-width: 0; outline: none;
}
.palco-area { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.palco-area .palco { border-radius: 20px; }
.palco-area .vitrine-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.palco-area .slide img:not([src]) { visibility: hidden; }
.palco-area .palco { cursor: pointer; }

.carrossel-controles {
  display: flex; align-items: center; gap: 14px; padding: 0 32px 26px;
  font-family: var(--font-sans);
}
.seta-nav {
  flex: none; width: 44px; height: 44px; border-radius: 50%; padding: 0; min-height: 0;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface-raised); color: var(--noite); border: 2px solid var(--noite); box-shadow: 0 3px 0 var(--noite);
  transition: transform .08s, box-shadow .08s, background .15s;
}
.seta-nav:hover { background: var(--maracuja-suave); }
.seta-nav:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--noite); }
.seta-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* trilha: um segmento por slide; o atual enche no ritmo do carrossel, nas cores do logo */
.trilha { flex: 1; display: flex; gap: 5px; align-items: center; min-width: 0; }
.trilha button {
  flex: 1; min-width: 0; height: 20px; padding: 0; min-height: 0; border: 0; background: none; cursor: pointer;
  position: relative; border-radius: 99px;
}
.trilha button::before, .trilha button::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 99px;
}
.trilha button::before { background: var(--line-b); transition: background .2s; }
.trilha button:hover::before { background: var(--line-strong-b); }
.trilha button::after { right: auto; width: 0; background: var(--cor, var(--tangerina)); }
.trilha button.visto::after { width: 100%; }
.trilha button.atual::after { animation: trilha-enche var(--tempo, 7s) linear both; }
.carrossel.parado .trilha button.atual::after { animation-play-state: paused; }
@keyframes trilha-enche { from { width: 0; } to { width: 100%; } }
.carrossel-contador {
  flex: none; min-width: 52px; text-align: right;
  font: 600 14px var(--font-sans); font-variant-numeric: tabular-nums; color: var(--ink-muted-b);
}

/* ---------- telas estreitas: login em cima, carrossel embaixo ---------- */
@media (max-width: 1100px) { body.home { --lateral: 400px; } .entrada { padding: 32px 32px 24px; } }
@media (max-width: 860px) {
  .home-grade { grid-template-columns: 1fr; grid-template-areas: "entrada" "carrossel"; }
  .entrada { position: static; height: auto; border-left: 0; border-bottom: 1px solid var(--line-b); padding: 28px 16px 24px; }
  .logo-heroi svg { height: 52px; }
  body.home .login { padding: 20px 0; }
  .carrossel { position: static; height: auto; }
  .palco-area { flex: none; height: calc((100vw - 32px) * 9 / 16 + 32px); }
  .palco-area .palco { border-radius: 12px; }
  .carrossel-controles { padding: 0 16px 24px; gap: 10px; }
  .seta-nav { width: 40px; height: 40px; }
  .trilha { gap: 3px; }
}
