/* Rapid — tela de entrada do motoboy (js/acesso.js): topo animado, campos com ícone,
   código em 6 quadradinhos e o 1º acesso numa etapa própria com o QR escondido. */

/* ---------- Topo ---------- */
#tela-login { background: #0B0F17; min-height: 100vh; }
.acesso-hero {
    position: relative; overflow: hidden; color: #fff; padding: 34px 26px 70px;
    background: radial-gradient(circle at 85% 10%, rgba(249,115,22,.55), transparent 55%),
                radial-gradient(circle at 0% 100%, rgba(234,88,12,.35), transparent 50%), #0B0F17;
}
.acesso-hero > :not(.acesso-estrada) { max-width: 440px; margin-left: auto; margin-right: auto; position: relative; z-index: 1; }
/* Foto da moto com a bag do Rapid, embaçada no fundo, com zoom bem lento. A imagem já vem
   embaçada/escurecida e leve (11 KB, img/fundo-acesso.webp); o degradê junta com o escuro. */
.acesso-hero::before { content: ''; position: absolute; inset: -20px; z-index: 0; background: url('../img/fundo-acesso.webp?v=2') center 62% / cover no-repeat;
    opacity: .6; filter: saturate(1.15); animation: acesso-zoom 22s ease-in-out infinite alternate; }
.acesso-hero::after { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: linear-gradient(180deg, rgba(11,15,23,.35) 0%, rgba(11,15,23,.15) 40%, rgba(11,15,23,.85) 88%, #0B0F17 100%); }
.acesso-estrada { z-index: 1; }
.acesso-hero { text-align: center; }
.acesso-logo { display: inline-flex; align-items: center; gap: 8px; font-family: 'Outfit', sans-serif; font-weight: 800; letter-spacing: 2px; font-size: .95rem;
    padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); animation: acesso-cai .6s ease both; }
.acesso-logo i { color: var(--rapid-primaria); font-size: 1.2rem; }
.acesso-hero h1 { font-family: 'Outfit', sans-serif; font-size: 2.1rem; line-height: 1.05; margin-top: 22px; animation: acesso-sobe .6s .1s ease both; }
.acesso-hero p { color: #C3C8D1; margin-top: 8px; font-size: .95rem; animation: acesso-sobe .6s .2s ease both; }
.acesso-estrada { position: absolute; left: 0; right: 0; bottom: 26px; height: 2px;
    background: repeating-linear-gradient(90deg, rgba(255,255,255,.25) 0 18px, transparent 18px 34px); animation: acesso-faixa 1.2s linear infinite; }
.acesso-moto { position: absolute; bottom: -2px; left: -40px; font-size: 1.9rem; color: var(--rapid-primaria);
    filter: drop-shadow(0 0 10px rgba(249,115,22,.7)); animation: acesso-corre 5.5s ease-in-out infinite; }

/* ---------- Cartão ---------- */
.acesso-corpo { margin-top: -46px; position: relative; z-index: 1; padding-bottom: 30px; }
.acesso-card { border-radius: 22px; padding: 24px 20px; box-shadow: 0 20px 50px rgba(0,0,0,.35); animation: acesso-sobe .55s .15s ease both; overflow: hidden; }
.acesso-passo { display: none; }
.acesso-passo.ativo { display: block; animation: acesso-entra .38s ease both; }
.acesso-passo.ativo.voltando { animation-name: acesso-entra-volta; }

.campo-icone { position: relative; display: block; margin-bottom: 14px; }
.campo-icone > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; color: var(--rapid-cinza); transition: color .2s; }
.campo-icone input { width: 100%; padding: 15px 46px 15px 46px; border-radius: 14px; border: 1.5px solid var(--rapid-borda); background: var(--rapid-cinza-claro);
    font-size: 1rem; outline: none; transition: border-color .2s, background .2s, box-shadow .2s; }
.campo-icone input:focus { border-color: var(--rapid-primaria); background: #fff; box-shadow: 0 0 0 4px rgba(249,115,22,.14); }
.campo-icone:focus-within > i { color: var(--rapid-primaria); }
.olho { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 1.2rem; color: var(--rapid-cinza); padding: 8px; cursor: pointer; }

.acesso-rotulo { display: block; font-weight: 600; font-size: .82rem; color: var(--rapid-cinza); margin: 4px 0 8px; }
.acesso-codigo-bloco { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .4s ease, opacity .3s ease; }
.acesso-codigo-bloco.aberto { max-height: 120px; opacity: 1; margin-bottom: 14px; }

/* Código em 6 quadradinhos */
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { width: 100%; aspect-ratio: 1 / 1.15; text-align: center; font-size: 1.45rem; font-weight: 800; font-family: 'Outfit', sans-serif;
    border-radius: 12px; border: 1.5px solid var(--rapid-borda); background: var(--rapid-cinza-claro); outline: none; transition: transform .15s, border-color .15s, background .15s; }
.otp input:focus { border-color: var(--rapid-primaria); background: #fff; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(249,115,22,.18); }
.otp input.cheio { border-color: var(--rapid-primaria); background: #FFF7ED; }

/* Botão com carregando */
.btn-acesso { position: relative; width: 100%; padding: 15px; border-radius: 14px; font-size: 1rem; margin-top: 6px;
    box-shadow: 0 10px 24px rgba(249,115,22,.35); transition: transform .15s, box-shadow .15s; }
.btn-acesso:active { transform: scale(.98); }
.btn-giro { display: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; animation: acesso-gira .7s linear infinite; }
.btn-acesso.carregando .btn-texto { display: none; }
.btn-acesso.carregando .btn-giro { display: inline-block; }
.link-acesso { display: block; margin: 16px auto 0; background: none; border: 0; color: var(--rapid-primaria-escura); font-weight: 600; font-size: .92rem; cursor: pointer; }
.link-acesso.pequeno { font-size: .82rem; margin: 10px auto 4px; color: var(--rapid-cinza); text-decoration: underline; }
.treme { animation: acesso-treme .4s ease; }

/* ---------- 1º acesso ---------- */
.voltar-acesso { background: none; border: 0; color: var(--rapid-cinza); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 0; margin-bottom: 8px; }
.selo-escudo { width: 64px; height: 64px; margin: 4px auto 12px; border-radius: 20px; display: grid; place-items: center; font-size: 2rem; color: #fff;
    background: linear-gradient(135deg, var(--rapid-primaria), var(--rapid-primaria-escura)); box-shadow: 0 12px 26px rgba(249,115,22,.4); animation: acesso-pulsa 2.4s ease-in-out infinite; }
.acesso-h2 { font-family: 'Outfit', sans-serif; text-align: center; font-size: 1.45rem; }
.acesso-texto { text-align: center; color: var(--rapid-cinza); font-size: .9rem; line-height: 1.45; margin: 6px 0 16px; }
.acesso-etapas { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.acesso-etapas li { display: flex; gap: 12px; align-items: center; font-size: .88rem; animation: acesso-sobe .4s ease both; }
.acesso-etapas li:nth-child(2) { animation-delay: .08s; }
.acesso-etapas li:nth-child(3) { animation-delay: .16s; }
.acesso-etapas li > b { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #FFF7ED; color: var(--rapid-primaria-escura); font-size: .85rem; }
/* "Seja um Rapid" (cadastro público, só com o marketplace ligado) */
.seja-rapid { display: none; width: 100%; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; text-align: left; cursor: pointer;
    border: 1.5px dashed rgba(249,115,22,.55); border-radius: 16px; background: linear-gradient(135deg, #FFF7ED, #fff); transition: transform .15s, border-color .15s; }
.seja-rapid.visivel { display: flex; animation: acesso-sobe .45s ease both; }
.seja-rapid:active { transform: scale(.98); }
.seja-rapid:hover { border-color: var(--rapid-primaria); }
.seja-icone { flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; color: #fff;
    background: linear-gradient(135deg, var(--rapid-primaria), var(--rapid-primaria-escura)); }
.seja-texto { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.seja-texto b { font-family: 'Outfit', sans-serif; font-size: 1rem; color: var(--rapid-preto); }
.seja-texto small { font-size: .76rem; color: var(--rapid-cinza); line-height: 1.3; }
.seja-rapid > .ph-caret-right { color: var(--rapid-primaria); }

/* Baixar o APK: discreto, só um link pequeno no rodapé do cartão */
.baixar-apk { text-align: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rapid-borda); }
.baixar-apk a { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--rapid-cinza); text-decoration: none; font-weight: 500; }
.baixar-apk a i { font-size: 1rem; color: #3ddc84; }
.baixar-apk a:hover, .baixar-apk a:active { color: var(--rapid-preto); }
/* Já está dentro do app Android: o link não faz sentido */
.no-apk .baixar-apk { display: none; }
/* No 1º acesso o link de baixar o APK some (só atrapalha o passo) */
.acesso-card:has(#passo-ativar.ativo) .baixar-apk { display: none !important; }
.btn-mostrar-qr { width: 100%; padding: 14px; border-radius: 14px; }

.qr-revelar { max-height: 0; overflow: hidden; opacity: 0; transform: translateY(8px); transition: max-height .55s ease, opacity .4s ease, transform .4s ease; }
.qr-revelar.aberto { max-height: 900px; opacity: 1; transform: none; }
.qr-rapid { display: flex; justify-content: center; padding: 16px; margin: 4px 0 2px; border: 1px solid var(--rapid-borda); border-radius: 18px; background: #fff; }
.qr-rapid img { width: 210px; height: 210px; image-rendering: pixelated; animation: acesso-qr .5s ease both; }
.chave-manual { display: none; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: var(--rapid-cinza-claro); }
.chave-manual.aberto { display: flex; animation: acesso-sobe .3s ease both; }
.chave-manual code { flex: 1; font-size: .82rem; font-weight: 700; letter-spacing: 1px; word-break: break-all; }
.chave-manual button { border: 0; background: #fff; border-radius: 10px; padding: 8px 10px; font-weight: 600; cursor: pointer; color: var(--rapid-primaria-escura); }

/* ---------- Caber em qualquer tela ---------- */
/* O topo cresce e ocupa o espaço que sobrar: o cartão fica embaixo, perto do polegar,
   sem faixa escura vazia. Logo no alto, título logo acima do cartão. */
#tela-login { min-height: 100dvh; }
#tela-login .acesso-hero { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: flex-end; min-height: 210px; padding-bottom: 112px; }
/* A estrada da motinha fica entre o título e o cartão (o cartão sobe 46 px sobre o topo) */
#tela-login .acesso-estrada { bottom: 66px; }
#tela-login .acesso-logo { margin-top: 0; margin-bottom: auto; align-self: center; }
#tela-login .acesso-corpo { flex: 0 0 auto; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
/* QR aberto: o escudo e os 3 passos recolhem para o QR e o código caberem juntos */
#passo-ativar .selo-escudo, #passo-ativar .acesso-texto, #passo-ativar .acesso-etapas { transition: opacity .3s ease, max-height .4s ease, margin .4s ease; max-height: 400px; }
#passo-ativar.qr-aberto .selo-escudo, #passo-ativar.qr-aberto .acesso-texto { opacity: 0; max-height: 0; margin: 0; overflow: hidden; }
#passo-ativar.qr-aberto .acesso-etapas { gap: 4px; margin-bottom: 10px; }
#passo-ativar.qr-aberto .acesso-etapas li { font-size: .8rem; }
#passo-ativar.qr-aberto .acesso-etapas li > b { width: 22px; height: 22px; font-size: .72rem; }
#passo-ativar.qr-aberto .acesso-h2 { font-size: 1.2rem; margin-bottom: 8px; }

/* Celular baixo (iPhone SE, Android pequeno) */
@media (max-height: 760px) {
    #tela-login .acesso-hero { padding: 18px 20px 100px; min-height: 170px; }
    #tela-login .acesso-estrada { bottom: 56px; }
    .acesso-hero h1 { font-size: 1.6rem; margin-top: 12px; }
    .acesso-hero p { font-size: .85rem; margin-top: 4px; }
    .acesso-estrada { bottom: 20px; }
    .acesso-corpo { margin-top: -38px; padding: 0 12px 16px; }
    .acesso-card { padding: 18px 16px; }
    .selo-escudo { width: 50px; height: 50px; font-size: 1.6rem; border-radius: 16px; margin-bottom: 8px; }
    .acesso-h2 { font-size: 1.25rem; }
    .acesso-texto { font-size: .82rem; margin: 4px 0 12px; }
    .acesso-etapas { gap: 7px; margin-bottom: 12px; }
    .acesso-etapas li { font-size: .82rem; }
    .qr-rapid { padding: 10px; }
    .qr-rapid img { width: 170px; height: 170px; }
    .campo-icone input { padding-top: 13px; padding-bottom: 13px; }
    .btn-acesso { padding: 13px; }
}
/* Celular estreito */
@media (max-width: 380px) {
    .acesso-hero h1 { font-size: 1.5rem; }
    .acesso-corpo { padding-left: 10px; padding-right: 10px; }
    .acesso-card { padding-left: 14px; padding-right: 14px; border-radius: 18px; }
    .otp { gap: 6px; }
    .otp input { font-size: 1.25rem; border-radius: 10px; }
}

/* ---------- Animações ---------- */
@keyframes acesso-sobe { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes acesso-cai { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes acesso-entra { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes acesso-entra-volta { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes acesso-faixa { to { background-position: -34px 0; } }
@keyframes acesso-corre { 0% { left: -40px; } 55% { left: calc(100% + 10px); } 100% { left: calc(100% + 10px); } }
@keyframes acesso-zoom { from { transform: scale(1); } to { transform: scale(1.08) translateY(-6px); } }
@keyframes acesso-gira { to { transform: rotate(360deg); } }
@keyframes acesso-treme { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes acesso-pulsa { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes acesso-qr { from { opacity: 0; transform: scale(.85); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { #tela-login *, #tela-login *::before { animation: none !important; transition: none !important; } }
