/* Tela de entrada · abertura da marca e foto do time RGR (abertura.js).
   Sempre escura, nos dois temas: é a "vitrine" do sistema. */
.tela-abertura {
  --piso: #050f1b; --chapa: #0c2036; --chapa-2: #0a1b2e;
  --tinta: #edf2f7; --tinta-2: #c9d5e2; --tinta-3: #9cafc2; --tinta-4: #8296ab;
  --risco: rgba(190, 214, 240, 0.10); --risco-forte: rgba(190, 214, 240, 0.22);
  --campo: rgba(255, 255, 255, .04);
  --destaque-texto: var(--amarelo); --acao: var(--amarelo); --acao-texto: #0b1a2a;
  --perigo: #ff8a80;
  color-scheme: dark;
  --lado: clamp(420px, 33vw, 520px);
  margin: 0; min-height: 100vh; min-height: 100svh; background: var(--tinta-marca); color: var(--tinta);
  display: grid; grid-template-columns: minmax(0, 1fr) var(--lado); overflow-x: hidden;
}

/* ---------- cena (lado esquerdo) ---------- */
.cena { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; }
.cena-fundo { position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(55% 60% at 62% 48%, rgba(47, 127, 240, .17), transparent 70%),
    radial-gradient(35% 35% at 64% 62%, rgba(251, 186, 0, .08), transparent 70%),
    linear-gradient(180deg, #030b15 0%, #06172a 58%, var(--tinta-marca) 100%); }
.cena-fundo .grade { position: absolute; inset: 0; opacity: .55;
  background-image: linear-gradient(rgba(140, 180, 230, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(140, 180, 230, .07) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: radial-gradient(65% 70% at 62% 50%, #000 20%, transparent 78%); }
.cena-fundo .brilho { position: absolute; left: 62%; top: 50%; width: 46vmin; height: 46vmin; transform: translate(-50%, -50%);
  border-radius: 50%; border: 1px solid rgba(190, 214, 240, .07); box-shadow: 0 0 0 9vmin rgba(190, 214, 240, .015), 0 0 0 18vmin rgba(190, 214, 240, .01); }

/* ---------- foto do time ---------- */
/* o quadro tem a proporção da foto (4:3) e cobre a área: assim o foco fica sempre no rosto do Robersom */
.foto { position: absolute; top: 0; right: 0; bottom: 0; left: 30%; margin: 0; overflow: hidden; z-index: 0; container-type: size;
  mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, .35) 14%, #000 34%), linear-gradient(0deg, transparent 0, #000 22%);
  mask-composite: intersect; }
.foto::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 80% at 62% 55%, transparent 40%, rgba(5, 15, 27, .55) 100%),
    linear-gradient(180deg, rgba(5, 15, 27, .55) 0%, transparent 22%); }
.foto-quadro { --px: 0px; --py: 0px; --rx: 49.2%; --ry: 56%;
  position: absolute; left: 50%; top: 50%; width: max(100cqw, 133.34cqh); aspect-ratio: 4 / 3;
  translate: calc(-50% + var(--px)) calc(-50% + var(--py)); transform-origin: var(--rx) var(--ry);
  scale: 1.16; opacity: 0; transition: translate 1.2s var(--ease); }
.foto-quadro img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.foto-cor { filter: saturate(1.06) contrast(1.04); }
/* camada no azul da marca por cima da cor; as faixas passam e levam ela embora */
.foto-duo { position: absolute; inset: 0; clip-path: polygon(-12% 0, 172% 0, 144% 100%, -40% 100%); }
.foto-duo img { filter: grayscale(1) contrast(1.15) brightness(.82); }
.foto-duo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, #1d4f8f, #06213f); mix-blend-mode: multiply; }
.foto-faixa { position: absolute; inset: 0; pointer-events: none; clip-path: polygon(-12% 0, -9% 0, -37% 100%, -40% 100%); }
.foto-faixa.amarela { background: var(--amarelo); }
.foto-faixa.azul { background: var(--azul-logo); clip-path: polygon(-15% 0, -13.6% 0, -41.6% 100%, -43% 100%); }

/* foco: quatro cantos amarelos que travam no rosto, com o nome ao lado */
.foco { position: absolute; left: 45.6%; top: 49.6%; width: 7.4%; height: 12.6%; opacity: 0; }
.foco i { position: absolute; width: 22%; height: 18%; border: 0 solid var(--amarelo); }
.foco i:nth-child(1) { left: 0; top: 0; border-width: 2px 0 0 2px; }
.foco i:nth-child(2) { right: 0; top: 0; border-width: 2px 2px 0 0; }
.foco i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 2px 2px; }
.foco i:nth-child(4) { right: 0; bottom: 0; border-width: 0 2px 2px 0; }
.foco-rotulo { position: absolute; left: 54.2%; top: 50%; display: grid; gap: 3px; padding: 8px 12px 8px 11px; opacity: 0;
  border-left: 2px solid var(--amarelo); background: rgba(5, 15, 27, .62); backdrop-filter: blur(8px); white-space: nowrap; }
.foco-rotulo b { font: 700 15px/1.1 var(--f-titulo); color: #fff; letter-spacing: .01em; }
.foco-rotulo span { font: 600 10.5px/1.2 var(--f-rotulo); letter-spacing: .16em; text-transform: uppercase; color: var(--texto-escuro-2); }

/* a sequência só começa com a foto carregada e a abertura da marca já fora */
.pronta .cena.viva .foto-quadro { animation: kb-entra 2.8s var(--ease) both, kb-respira 26s ease-in-out 2.8s infinite alternate; }
/* as faixas passam uma vez e revelam a cor; depois o azul da marca vai e volta devagar, em ciclo de 18 s:
   cor ~10 s, esmaece para o azul em 3 s, fica 2 s, volta para a cor em 3 s */
.pronta .cena.viva .foto-duo { animation: revela 1.7s .35s both, respira-azul 18s ease-in-out 2.05s infinite forwards; }
.pronta .cena.viva .foto-faixa.amarela { animation: faixa-amarela 1.7s cubic-bezier(.65, 0, .3, 1) .35s both; }
.pronta .cena.viva .foto-faixa.azul { animation: faixa-azul 1.7s cubic-bezier(.65, 0, .3, 1) .45s both; }
.pronta .cena.viva .foco { animation: foco-trava .7s var(--ease) 2.1s both, foco-pulsa 3.2s ease-in-out 3.2s infinite; }
.pronta .cena.viva .foco-rotulo { animation: rotulo-entra .7s var(--ease) 2.5s both; }
@keyframes kb-entra { from { opacity: 0; scale: 1.16; } 20% { opacity: 1; } to { opacity: 1; scale: 1.04; } }
@keyframes kb-respira { from { opacity: 1; scale: 1.04; } to { opacity: 1; scale: 1.1; } }
/* no fim da passagem o azul volta a cobrir tudo, já transparente (o respira-azul começa em 0) */
@keyframes revela {
  0% { clip-path: polygon(-12% 0, 172% 0, 144% 100%, -40% 100%); animation-timing-function: cubic-bezier(.65, 0, .3, 1); }
  99.9% { clip-path: polygon(172% 0, 172% 0, 144% 100%, 144% 100%); }
  100% { clip-path: polygon(-12% 0, 172% 0, 144% 100%, -40% 100%); } }
@keyframes respira-azul { 0%, 55% { opacity: 0; } 72%, 83% { opacity: 1; } 100% { opacity: 0; } }
@keyframes faixa-amarela { to { clip-path: polygon(172% 0, 175% 0, 147% 100%, 144% 100%); } }
@keyframes faixa-azul { to { clip-path: polygon(169% 0, 170.4% 0, 142.4% 100%, 141% 100%); } }
@keyframes foco-trava { from { opacity: 0; scale: 1.9; } 60% { opacity: 1; } to { opacity: 1; scale: 1; } }
@keyframes foco-pulsa { 0%, 100% { opacity: 1; scale: 1; } 50% { opacity: .7; scale: 1.05; } }
@keyframes rotulo-entra { from { opacity: 0; translate: -12px 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; translate: 0 0; clip-path: inset(0 0 0 0); } }
.sem-foto .foto { display: none; }

.cena-topo { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; align-items: flex-start;
  padding: clamp(28px, 4.4vh, 48px) clamp(24px, 4vw, 56px) 0; }
.cena-logo { width: 196px; height: auto; display: block; }
.hud { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font: 500 11.5px/1.6 var(--f-rotulo); letter-spacing: .14em; text-transform: uppercase; color: var(--texto-escuro-3); text-align: right; font-variant-numeric: tabular-nums; }
.hud b { color: var(--amarelo); font-weight: 600; }
.hud-vivo { display: inline-flex; align-items: center; gap: 8px; color: var(--texto-escuro-2); }
.hud-vivo i { width: 7px; height: 7px; border-radius: 50%; background: #4cc38a; box-shadow: 0 0 0 0 rgba(76, 195, 138, .6); animation: pulso 2.2s infinite; }
.hud-vivo.alerta { color: #ffb547; }
.hud-vivo.alerta i { background: #ffb547; animation: none; }
@keyframes pulso { 70% { box-shadow: 0 0 0 8px rgba(76, 195, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(76, 195, 138, 0); } }

.cena-titulo { position: absolute; left: clamp(24px, 4vw, 56px); z-index: 3; transition: opacity .6s ease, transform .7s var(--ease); }
.cena-titulo { top: 50%; transform: translateY(-46%); max-width: min(560px, 52%); pointer-events: none; }
.cena-titulo .titulo-grande { display: block; margin-top: 1rem; font: 800 clamp(52px, 5.4vw, 96px)/.9 var(--f-titulo); font-stretch: 118%; color: #fff; letter-spacing: -.01em; }
.cena-titulo .titulo-grande b { color: var(--amarelo); font-weight: 800; }
.cena-titulo p { margin: 1.4rem 0 0; color: var(--texto-escuro-3); font-size: 1.06rem; max-width: 40ch; }

/* as 5 Atitudes RGR, embaixo */
.cena-atitude { position: absolute; left: clamp(24px, 4vw, 56px); bottom: clamp(26px, 4.4vh, 44px); z-index: 3; width: min(520px, calc(100% - 48px)); }
.cena-atitude .k { font: 600 11.5px/1 var(--f-rotulo); letter-spacing: .16em; text-transform: uppercase; color: var(--texto-escuro-3); }
.cena-atitude .k b { color: var(--amarelo); font-weight: 600; margin-left: 6px; font-variant-numeric: tabular-nums; }
.cena-atitude .k span { color: var(--tinta-4); }
.cena-atitude p { margin: 10px 0 12px; font: 600 clamp(16px, 1.35vw, 20px)/1.3 var(--f-texto); color: #fff; transition: opacity .35s ease, translate .35s var(--ease); }
.cena-atitude.troca p { opacity: 0; translate: 0 -8px; }
.cena-atitude i { display: block; height: 2px; background: var(--linha-escura); overflow: hidden; }
.cena-atitude u { display: block; height: 100%; background: var(--amarelo); transform: scaleX(0); transform-origin: left; }
.cena-atitude u.corre { animation: trilha 6.5s linear forwards; }
@keyframes trilha { to { transform: scaleX(1); } }

/* ---------- lado do formulário ---------- */
.tela-abertura .entrar-lado { position: relative; z-index: 4; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  padding: clamp(28px, 4.4vh, 48px) clamp(28px, 3.4vw, 56px);
  background: linear-gradient(180deg, rgba(12, 32, 54, .72), rgba(5, 15, 27, .9)); border-left: 1px solid var(--linha-escura);
  box-shadow: -40px 0 80px -40px rgba(0, 0, 0, .8); backdrop-filter: blur(18px) saturate(130%); }
.lado-topo { display: flex; justify-content: space-between; gap: 12px; font: 600 11.5px/1.6 var(--f-rotulo); letter-spacing: .16em; text-transform: uppercase; color: var(--tinta-4); }
.tela-abertura .entrar-form { width: 100%; max-width: 400px; margin: 0 auto; }
.tela-abertura .entrar-form .cartao { transition: opacity var(--t-medio) var(--ease), transform var(--t-longo) var(--ease); }
@starting-style { .tela-abertura .entrar-form .cartao { opacity: 0; transform: translateY(12px); } }
.tela-abertura .cartao { background: none; box-shadow: none; padding: 0; border-radius: 0; }
.tela-abertura .cartao h1 { font: 800 clamp(2.2rem, 2.8vw, 2.8rem)/1 var(--f-titulo); font-stretch: 116%; margin: .9rem 0 .5rem; color: #fff; }
.tela-abertura .cartao .dica { color: var(--tinta-3); margin: 0 0 1.4rem; }
.tela-abertura .cartao label { margin-top: 1.1rem; }
.tela-abertura .passos { margin: .6rem 0 .6rem; }
.tela-abertura .qr { width: 176px; margin: .2rem auto; }
.tela-abertura #fAtivar .bt-primario { margin-top: 1.2rem; }
.tela-abertura .cartao input { min-height: 52px; font-size: 1.02rem; background: rgba(255, 255, 255, .035); border-color: rgba(190, 214, 240, .16);
  transition: border-color var(--t-medio), background-color var(--t-medio), box-shadow var(--t-medio); }
.tela-abertura .cartao input:hover { border-color: rgba(190, 214, 240, .3); }
.tela-abertura .cartao input:focus { outline: none; border-color: var(--amarelo); background: rgba(251, 186, 0, .04); box-shadow: 0 0 0 4px rgba(251, 186, 0, .12); }
.tela-abertura .cartao .bt-primario { min-height: 54px; margin-top: 1.8rem; font-size: 1rem; font-weight: 700; letter-spacing: .04em; position: relative; overflow: hidden; }
.tela-abertura .cartao .bt-primario::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%); }
.tela-abertura .cartao .bt-primario:hover::after { transform: translateX(120%); transition: transform .8s var(--ease); }
.tela-abertura .cartao .bt-primario:hover svg { transform: translateX(3px); }
.tela-abertura .cartao input:-webkit-autofill { -webkit-text-fill-color: var(--tinta); -webkit-box-shadow: 0 0 0 1000px #0f2238 inset; caret-color: var(--amarelo); }
.tela-abertura .qr { background: #fff; }
.aviso-caps { margin: .5rem 0 0; font: 500 .82rem/1.4 var(--f-rotulo); letter-spacing: .04em; color: var(--aviso, #ffb547); }
.ajuda { margin: 1.1rem 0 0; font-size: .86rem; color: var(--tinta-4); text-align: center; }

.selos { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin: 0; padding: 0; list-style: none; font: 600 11.5px/1 var(--f-rotulo); letter-spacing: .12em; text-transform: uppercase; color: var(--tinta-3); }
.selos li { display: inline-flex; align-items: center; gap: 7px; }
.selos svg { width: 16px; height: 16px; fill: none; stroke: var(--amarelo); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.lado-rodape { margin: 0; text-align: center; font: 500 .8rem/1.6 var(--f-rotulo); letter-spacing: .04em; color: var(--tinta-4); }
.lado-rodape span { display: block; color: var(--tinta-3); letter-spacing: .14em; text-transform: uppercase; font-size: .72rem; }

/* entrada dos elementos depois da abertura */
.pronta .cena-topo, .pronta .cena-titulo .sobretitulo, .pronta .cena-titulo p, .pronta .cena-atitude { animation: sobe-ab .8s var(--ease) both .15s; }
.pronta .cena-titulo .titulo-grande { animation: revela-ab 1s var(--ease) both .05s; }
.pronta .entrar-lado > * { animation: sobe-ab .7s var(--ease) both; }
.pronta .entrar-lado > :nth-child(2) { animation-delay: .12s; }
.pronta .entrar-lado > :nth-child(3) { animation-delay: .22s; }
.pronta .entrar-lado > :nth-child(4) { animation-delay: .3s; }
@keyframes sobe-ab { from { opacity: 0; transform: translateY(16px); } }
@keyframes revela-ab { from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(24px); } to { clip-path: inset(0 0 -10% 0); } }

/* ---------- abertura da marca ---------- */
.abertura { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(50% 50% at 50% 50%, #0a2440 0%, var(--tinta-marca) 70%); }
.abertura.sai { animation: ab-sai .9s cubic-bezier(.7, 0, .2, 1) forwards; }
@keyframes ab-sai { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 100% 0); } }
.ab-centro { display: grid; justify-items: center; gap: 22px; }
.ab-marca { position: relative; width: min(440px, 72vw); aspect-ratio: 141.2 / 34.4; }
.ab-r { position: absolute; left: 0; top: -3%; height: 106%; width: auto; overflow: visible; }
.ab-r path { fill: transparent; stroke: var(--amarelo); stroke-width: .9; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: ab-traco 1.1s cubic-bezier(.6, 0, .3, 1) .15s forwards, ab-preenche .4s ease 1.1s forwards, ab-some .3s ease 1.5s forwards; }
.ab-logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: left center; opacity: 0; clip-path: inset(0 100% 0 0);
  animation: ab-limpa .7s cubic-bezier(.6, 0, .2, 1) 1.3s forwards; }
.ab-linha { width: min(440px, 72vw); height: 2px; background: var(--amarelo); transform: scaleX(0); transform-origin: left; opacity: .75;
  animation: ab-linha 1.9s cubic-bezier(.6, 0, .2, 1) .1s forwards; }
.ab-rotulo { font: 600 12px/1 var(--f-rotulo); letter-spacing: .32em; text-transform: uppercase; color: var(--texto-escuro-2); opacity: 0; animation: ab-rotulo .7s ease 1.6s forwards; }
.ab-rotulo b { color: var(--amarelo); }
@keyframes ab-traco { to { stroke-dashoffset: 0; } }
@keyframes ab-preenche { to { fill: var(--amarelo); stroke-width: 0; } }
@keyframes ab-some { to { opacity: 0; } }
@keyframes ab-limpa { to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes ab-linha { to { transform: scaleX(1); } }
@keyframes ab-rotulo { from { opacity: 0; letter-spacing: .5em; } to { opacity: 1; } }

/* ---------- saída depois do login: as faixas da marca cobrem a tela ---------- */
.cortina { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; visibility: hidden; }
.cortina i { position: absolute; display: block; left: -60%; width: 220%; height: 120vh; top: -10vh; transform: translateX(-120%) rotate(-20deg); }
.cortina i:nth-child(1) { background: var(--amarelo); }
.cortina i:nth-child(2) { background: var(--azul-logo); }
.cortina i:nth-child(3) { background: var(--tinta-marca); }
.saindo .cortina { visibility: visible; }
.saindo .cortina i { animation: cortina .85s cubic-bezier(.7, 0, .25, 1) forwards; }
.saindo .cortina i:nth-child(2) { animation-delay: .12s; }
.saindo .cortina i:nth-child(3) { animation-delay: .24s; }
@keyframes cortina { to { transform: translateX(0) rotate(-20deg); } }
.saindo .entrar-lado > * { transition: opacity .35s, transform .45s var(--ease-saida); opacity: 0; transform: translateX(30px); }
.saindo .cena-titulo, .saindo .cena-atitude, .saindo .foco, .saindo .foco-rotulo { transition: opacity .3s; opacity: 0; animation: none; }
.saindo .foto-quadro { animation: kb-sai 1.1s cubic-bezier(.7, 0, .25, 1) forwards; }
@keyframes kb-sai { from { opacity: 1; scale: 1.06; } to { opacity: 1; scale: 1.5; } }

/* ---------- celular e telas estreitas ---------- */
@media (max-width: 900px) {
  .tela-abertura { display: block; padding-bottom: 0; }
  .cena { position: relative; height: 62svh; min-height: 440px; }
  .foto { left: 0; mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .3) 22%, #000 52%), linear-gradient(0deg, transparent 0, #000 10%); }
  .foto::after { background: linear-gradient(0deg, rgba(5, 15, 27, .9) 0, rgba(5, 15, 27, .5) 20%, transparent 38%); }
  .foto-quadro { translate: -50% -46%; }
  /* no celular o nome vai embaixo do rosto, numa linha só, para não cobrir ninguém */
  .foco-rotulo { left: 45.6%; top: calc(62.2% + 6px); display: flex; align-items: baseline; gap: 6px; padding: 4px 8px; }
  .foco-rotulo b { font-size: 12px; }
  .foco-rotulo span { font-size: 8.5px; letter-spacing: .08em; }
  .cena-fundo .brilho { left: 50%; top: 62%; }
  .cena-logo { width: 150px; }
  .hud > span:not(.hud-vivo) { display: none; }
  .hud { letter-spacing: .1em; font-size: 10.5px; }
  .cena-titulo { top: 84px; transform: none; max-width: none; right: 24px; }
  .cena-titulo .titulo-grande { font-size: 44px; margin-top: .6rem; }
  .cena-titulo p { display: none; }
  .cena-atitude { bottom: 60px; }
  .cena-atitude p { font-size: 14px; margin: 6px 0 8px; }
  .tela-abertura .entrar-lado { margin-top: -40px; border-left: 0; border-top: 1px solid var(--linha-escura); padding: 28px 20px 32px; min-height: auto; gap: 24px;
    background: linear-gradient(180deg, rgba(12, 32, 54, .92), var(--tinta-marca) 70%); }
  .lado-topo { display: none; }
  .ab-r { stroke-width: 1.2; }
}
/* tablet e notebook pequeno: não cabem título e peça lado a lado → título em cima, peça embaixo */
@media (max-width: 1279px) and (min-width: 901px) {
  .cena-titulo { top: clamp(110px, 16vh, 150px); transform: none; max-width: none; right: clamp(24px, 4vw, 56px); }
  .cena-titulo .titulo-grande { font-size: clamp(44px, 5vw, 64px); }
  .cena-titulo p { display: none; }
  .foto { left: 0; mask-image: linear-gradient(180deg, transparent 0, #000 44%), linear-gradient(0deg, transparent 0, #000 22%); }
  .foto-quadro { translate: calc(-50% + var(--px)) calc(-40% + var(--py)); }
  .cena-fundo .brilho { left: 50%; top: 58%; }
}
@media (prefers-reduced-motion: reduce) {
  .pronta *, .abertura, .cortina i { animation: none !important; }
  .cena-titulo, .foto-quadro, .cena-atitude p { transition: none; }
  .foto-quadro { opacity: 1; scale: 1.04; }
  .foto-duo, .foto-faixa { display: none; }
  .foco, .foco-rotulo { opacity: 1; }
}
