/* ==========================================================================
   CLUBE DO KF — PÁGINA PÚBLICA, AUTENTICAÇÃO E ERROS
   ========================================================================== */

/* ---------- Logo oficial animada, sem brilho ----------
   1. o anel é redesenhado em vetor (mesma geometria e degradê da logo) e traçado como uma linha
   2. o "KF" surge no centro do anel
   3. o texto "CLUBE DO KF" é revelado da esquerda para a direita
   Geometria medida no PNG oficial (420×208): centro (97; 105,5), raio 66,5, espessura 10. */
.alogo { --w: 300px; position: relative; width: var(--w); aspect-ratio: 420 / 208; transform: translateX(3.3%); }
.alogo > img, .alogo > svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.alogo__ring { stroke-dasharray: 100; stroke-dashoffset: 100; }
.alogo__kf { clip-path: inset(35.6% 65.7% 34.1% 13.8%); opacity: 0; transform: scale(.86); transform-origin: 23.1% 50.7%; }
.alogo__text { clip-path: inset(0 100% 0 46%); }
.is-ready .alogo__ring, .alogo--auto .alogo__ring { animation: kf-ring 1.3s cubic-bezier(.65, 0, .35, 1) .15s forwards; }
.is-ready .alogo__kf, .alogo--auto .alogo__kf { animation: kf-in .7s cubic-bezier(.2, .9, .25, 1) .85s forwards; }
.is-ready .alogo__text, .alogo--auto .alogo__text { animation: kf-wipe .9s cubic-bezier(.65, 0, .35, 1) 1.1s forwards; }
@keyframes kf-ring { to { stroke-dashoffset: 0; } }
@keyframes kf-in { to { opacity: 1; transform: none; } }
@keyframes kf-wipe { to { clip-path: inset(0 0 0 46%); } }
.alogo--xl { --w: clamp(260px, 44vw, 560px); }
@media (prefers-reduced-motion: reduce) { .alogo__ring { stroke-dashoffset: 0; } .alogo__kf { opacity: 1; transform: none; } .alogo__text { clip-path: inset(0 0 0 46%); } }

/* ---------- Página pública ---------- */
.pub { position: relative; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; background: var(--bg); isolation: isolate; }
.pub__bg { position: absolute; inset: 0; opacity: .32; z-index: -2; }
.pub__bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 60% at 50% 42%, transparent, var(--bg) 78%); }
.pub__in { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 40px 20px 120px; pointer-events: none; }
.pub__in a, .pub__in button { pointer-events: auto; }
.pub__tag { font-size: clamp(18px, 1.8vw, 24px); color: var(--text-2); margin-top: 18px; }
.pub__tag b { color: #fff; font-weight: 650; }
.pub__sub { font-size: clamp(20px, 2vw, 28px); color: var(--muted); margin-top: 18px; }
.pub__acts { margin-top: 18px; }
.pub__link { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); margin-top: 6px; transition: color var(--t-fast); }
.pub__link:hover { color: var(--rosa); }
.pub__tag, .pub__sub, .pub__acts, .pub__link, .pub__foot { opacity: 0; transform: translateY(18px); }
.pub.is-ready .pub__tag { animation: fade-up var(--tempo) var(--env-ataque) calc(var(--tempo) * 2) forwards; }
.pub.is-ready .pub__sub { animation: fade-up .8s var(--env-ataque) 1.75s forwards; }
.pub.is-ready .pub__acts { animation: fade-up .8s var(--env-ataque) 1.95s forwards; }
.pub.is-ready .pub__link, .pub.is-ready .pub__foot { animation: fade-up .8s var(--env-ataque) 2.2s forwards; }
/* Botão da página pública: só visual (sem clique e sem brilho) */
.pub__acts .btn.is-static { cursor: default; pointer-events: none; box-shadow: 0 5px 0 var(--acao-borda); user-select: none; }
.pub__acts .btn.is-static::before { box-shadow: none; }
@keyframes fade-up { to { opacity: 1; transform: none; } }
.pub.is-intro .alogo { visibility: hidden; }
.pub__count { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--bg); cursor: pointer; transition: opacity var(--colcheia) var(--env-release); }
.pub.is-ready .pub__count { opacity: 0; pointer-events: none; }
.pub__count b { font-size: clamp(140px, 22vw, 260px); line-height: .8; background: var(--grad-v); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pub__count b.hit { animation: count-hit var(--tempo) var(--env-ataque); }
.pub__count small { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
@keyframes count-hit { from { transform: scale(1.35); opacity: .3; filter: blur(6px); } 30% { opacity: 1; filter: none; } }
.pub__foot { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px max(24px, var(--gutter)); font-size: 12.5px; color: var(--dim); }
.pub__soc { display: flex; gap: 6px; }
.pub__soc a { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: var(--t-fast); }
.pub__soc a:hover { color: #fff; background: var(--glass-2); }
@media (max-width: 640px) { .pub__foot { flex-direction: column; gap: 8px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); } }

/* ---------- Autenticação ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(440px, .95fr); min-height: 100dvh; background: var(--bg); }
.auth__art { position: relative; overflow: hidden; }
.auth__art > .art svg.pat { opacity: .55; }
.auth__art::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(0deg, rgba(15,12,14,.92), rgba(15,12,14,.2) 55%, rgba(15,12,14,.5)); pointer-events: none; }
.auth__art-in { position: absolute; z-index: 3; left: clamp(28px, 4vw, 56px); right: clamp(28px, 4vw, 56px); bottom: clamp(28px, 5vh, 56px); display: flex; flex-direction: column; gap: 22px; pointer-events: none; }
.auth__logo { height: 64px; width: auto; align-self: flex-start; }
.auth__art .motto { max-width: 12ch; }
.auth__main { display: flex; flex-direction: column; padding: 24px clamp(20px, 5vw, 64px); min-width: 0; }
.auth__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth__back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-radius: 10px; transition: var(--t-fast); }
.auth__back:hover { color: #fff; background: var(--glass); }
.auth__mlogo { display: none; height: 38px; }
.auth__card { width: min(420px, 100%); margin: auto; padding: 28px 0; display: flex; flex-direction: column; gap: 12px; }
.auth__card > h1, .auth__done h1 { font-size: clamp(34px, 3.4vw, 46px); font-weight: 800; letter-spacing: -.045em; line-height: 1.02; }
.auth__card > p.muted { font-size: 15.5px; margin-bottom: 6px; }
.auth__form { gap: 14px; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.auth__forgot { font-size: 13px; }
.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw__eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); transition: var(--t-fast); }
.pw__eye:hover { color: #fff; background: var(--glass); }
.ferr { color: var(--err-txt); font-size: 12.5px; }
.ferr:empty { display: none; }
.input.is-err { box-shadow: 0 0 0 2px var(--err) inset; }
.caps { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warn); }
.auth__remember { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.auth__remember .switch { transform: scale(.85); transform-origin: left center; margin-right: -6px; }
.auth__alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.auth__alert svg { flex: none; margin-top: 2px; }
.auth__alert--err { background: rgba(229,66,72,.12); color: var(--err-txt); box-shadow: inset 0 0 0 1px rgba(229,66,72,.3); }
.auth__alert--warn { background: rgba(255,201,60,.1); color: #FFD97A; box-shadow: inset 0 0 0 1px rgba(255,201,60,.28); }
.btn .spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.is-loading .spin { display: inline-block; }
.btn.is-loading { pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth__or { display: flex; align-items: center; gap: 14px; color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; margin: 6px 0; }
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth__sso { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth__sso .btn { font-size: 14px; }
.auth__alt { text-align: center; font-size: 14px; color: var(--muted); margin-top: 4px; }
.auth__demo { margin-top: 8px; padding: 14px; border-radius: 16px; background: rgba(100,210,255,.06); box-shadow: inset 0 0 0 1px rgba(100,210,255,.2); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.auth__demo > div { display: flex; gap: 8px; flex-wrap: wrap; }
.auth__demo small { font-size: 12px; }
.auth__legal { text-align: center; font-size: 12px; color: var(--dim); padding-top: 16px; }
.auth__steps { display: flex; gap: 6px; margin-bottom: 10px; }
.auth__steps span { flex: 1; padding-top: 10px; font-size: 11.5px; font-weight: 600; color: var(--dim); border-top: 3px solid var(--glass-2); }
.auth__steps .on { color: #fff; border-color: var(--magenta); }
.auth__steps .done { color: var(--text-2); border-color: var(--verde-vu); }
.auth__ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--grad-soft); color: var(--rosa); box-shadow: inset 0 0 0 1px rgba(224,22,93,.3); margin-bottom: 4px; animation: popin2 .6s var(--env-pluck); }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 6px 0; }
.otp input { height: 62px; width: 100%; min-width: 0; text-align: center; font: 700 26px/1 var(--font); font-variant-numeric: tabular-nums; border: 0; border-radius: 14px; background: var(--bg-3); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); caret-color: var(--magenta); transition: box-shadow var(--t-fast), background var(--t-fast); }
.otp input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--magenta), 0 0 0 5px rgba(224,22,93,.15); }
.otp input.filled { background: rgba(224,22,93,.1); box-shadow: inset 0 0 0 1px rgba(224,22,93,.45); animation: pluck .3s var(--env-pluck); }
.otp input.is-err { box-shadow: inset 0 0 0 2px var(--err); }
.auth__row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-top: 4px; }
.auth__row button.link[disabled] { color: var(--dim); text-decoration: none; cursor: default; }
.auth__done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.auth__done .btn { width: 100%; }
.pws { display: flex; flex-direction: column; gap: 8px; margin-top: -4px; }
.pws__bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pws__bars i { height: 5px; border-radius: 4px; background: var(--glass-2); transition: background var(--colcheia); }
.pws[data-s="1"] i:nth-child(-n+1) { background: var(--coral); }
.pws[data-s="2"] i:nth-child(-n+2) { background: var(--laranja); }
.pws[data-s="3"] i:nth-child(-n+3) { background: #C9D14A; }
.pws[data-s="4"] i { background: var(--verde-vu); }
.pws__l { font-size: 12px; font-weight: 600; color: var(--muted); }
.pws__rules { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.pws__rules li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--dim); transition: color var(--t-fast); }
.pws__rules li svg { opacity: .35; }
.pws__rules li.ok { color: var(--verde-vu); } .pws__rules li.ok svg { opacity: 1; }
.auth__check { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; font-size: 13.5px; color: var(--text-2); cursor: pointer; line-height: 1.45; }
.auth__check input { position: absolute; opacity: 0; pointer-events: none; }
.auth__box { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--line-3); color: transparent; transition: var(--t-fast); margin-top: 1px; }
.auth__check input:checked + .auth__box { background: var(--magenta); box-shadow: none; color: #fff; }
.auth__check input:focus-visible + .auth__box { outline: 2px solid var(--amber); outline-offset: 2px; }
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth__art { display: none; }
  .auth__main { background: radial-gradient(80% 40% at 50% 0%, rgba(224,22,93,.14), transparent 70%), var(--bg); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .auth__mlogo { display: block; }
  .auth__sso { grid-template-columns: 1fr; }
}

/* ---------- Páginas de erro ---------- */
.err { position: relative; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 26px 20px; text-align: center; background: radial-gradient(60% 45% at 50% 34%, rgba(224,22,93,.14), transparent 70%), var(--bg); overflow: hidden; }
.err--offline, .err--manutencao { background: radial-gradient(60% 45% at 50% 34%, rgba(233,105,48,.14), transparent 70%), var(--bg); }
.err__logo img { height: 44px; }
.err__in { margin: auto; max-width: 640px; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 0; }
.err__big { display: flex; align-items: center; justify-content: center; gap: .03em; font-size: clamp(120px, 22vw, 240px); line-height: .82; background: var(--grad-v); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 20px 60px rgba(224,22,93,.3)); }
.err__ring { position: relative; display: inline-block; width: .74em; height: .74em; border-radius: 50%; overflow: hidden; animation: ring-spin 12s linear infinite; }
.err__ring img { position: absolute; width: 295.8%; max-width: none; left: -18.3%; top: -23.8%; }
@keyframes ring-spin { to { rotate: 360deg; } }
.err h2 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.err p { font-size: 16.5px; max-width: 48ch; }
.err__acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.err__quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.err__quick a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 99px; font-size: 13.5px; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: var(--t-fast); }
.err__quick a:hover { color: #fff; background: var(--glass); }
.err__foot { font-size: 12px; }
.err__art { width: min(520px, 100%); display: grid; place-items: center; }
.err__eq { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 90px; }
.err__eq i { width: 14px; border-radius: 4px 4px 2px 2px; background: linear-gradient(0deg, var(--verde-vu), #C9D14A 60%, var(--coral)); height: 20%; animation: eqx calc(var(--tempo) / 2) ease-in-out infinite alternate; animation-delay: calc(var(--i) * -53ms); }
@keyframes eqx { to { height: 100%; } }
.err__clip { position: absolute; right: -58px; top: 0; font: 800 11px/1 var(--font); letter-spacing: .14em; color: #fff; background: var(--err); padding: 5px 7px; border-radius: 5px; box-shadow: 0 0 16px var(--err); animation: led var(--colcheia) steps(1) infinite; }
.err__cable { width: 320px; height: 120px; }
.err__cable path { fill: none; stroke: var(--text-2); stroke-width: 6; stroke-linecap: round; }
.err__cable .c2 { animation: dangle 2.4s ease-in-out infinite; transform-origin: 310px 70px; }
.err__cable rect { fill: #2a2228; stroke: var(--line-3); stroke-width: 1.5; }
.err__cable .jack { fill: #b9a9b1; animation: dangle 2.4s ease-in-out infinite; transform-origin: 310px 70px; }
.err__cable .spark path { stroke: var(--laranja); stroke-width: 2.5; animation: led var(--colcheia) steps(1) infinite; }
@keyframes dangle { 50% { transform: rotate(6deg); } }
.err__tuner { position: relative; width: 240px; display: flex; flex-direction: column; align-items: center; }
.err__tuner svg { width: 240px; height: 140px; overflow: visible; }
.err__tuner .arc { fill: none; stroke: var(--line-2); stroke-width: 2; }
.err__tuner line { stroke: var(--line-3); stroke-width: 2; stroke-linecap: round; }
.err__tuner line.mid { stroke: var(--verde-vu); stroke-width: 3; }
.err__tuner .needle { stroke: var(--laranja); stroke-width: 3; transform-origin: 110px 120px; animation: tune 3.2s var(--env-ataque) infinite; filter: drop-shadow(0 0 6px rgba(233,105,48,.7)); }
.err__tuner circle { fill: var(--laranja); }
.err__tuner b { position: absolute; top: 46px; font-size: 44px; color: #fff; }
.err__tuner small { font-size: 12px; color: var(--muted); margin-top: 4px; }
@keyframes tune { 0% { transform: rotate(-38deg); } 25% { transform: rotate(22deg); } 45% { transform: rotate(-12deg); } 62% { transform: rotate(6deg); } 76%, 100% { transform: rotate(0deg); } }
.err__lock { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; color: var(--rosa); background: radial-gradient(circle, rgba(224,22,93,.18), transparent 70%); box-shadow: inset 0 0 0 2px rgba(224,22,93,.4); animation: batida var(--tempo) var(--env-ataque) infinite; }
.err__eta { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 4px; }
.err__det { width: 100%; text-align: left; margin-top: 10px; padding: 14px; border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); }
.err__det summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.err__det code { display: block; white-space: pre-wrap; font-size: 12px; color: var(--muted); margin: 12px 0; font-family: ui-monospace, Menlo, monospace; }

/* Aviso de sem conexão */
body.is-offline::before { content: "Sem conexão · tentando reconectar"; position: fixed; z-index: 200; left: 50%; top: 12px; transform: translateX(-50%); padding: 8px 14px; border-radius: 99px; background: var(--err); color: #fff; font-size: 12.5px; font-weight: 700; box-shadow: var(--e-3); }
/* A página de erro usa .err--<código>; não herda a utilidade .err (texto vermelho) */
div.err[class*="err--"] { color: var(--text); }
