/* Porta do Escritório Virtual. O filme é o protagonista; a porta é só o
   visor do Liberalinho e o campo do código, translúcidos, no pé da tela. */
:root {
  --noite: #0c1236;      /* marinho Liberali, escurecido */
  --led: #6ff3e6;        /* ciano dos olhos de LED */
  --texto: #f4f6ff;
  --erro: #ffb4b4;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--noite); color: var(--texto); font-family: "JetBrains Mono", ui-monospace, monospace; overflow: hidden; }
::selection { background: rgba(111,243,230,.35); color: #fff; }

.fundo { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* só o pé da tela escurece um pouco, para o campo ler bem sobre o filme */
.veu { position: fixed; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(8,12,38,.62), rgba(8,12,38,.2) 30%, rgba(8,12,38,0) 52%); }

.porta { position: fixed; left: 50%; bottom: clamp(36px, 10vh, 112px); transform: translateX(-50%);
  width: min(340px, calc(100% - 32px)); }
#forma { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.visor { width: 92px; height: 37px; border-radius: 999px; background: rgba(5,8,23,.62);
  box-shadow: 0 6px 18px rgba(3,6,24,.4); }

.campo { position: relative; width: 100%; }
#codigo { width: 100%; height: 52px; padding: 0 54px; border-radius: 14px; outline: none;
  font: 500 17px/1 "JetBrains Mono", monospace; letter-spacing: .22em; text-align: center;
  color: var(--texto); caret-color: var(--led);
  background: rgba(10,15,46,.3); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 10px 30px rgba(3,6,24,.28);
  transition: border-color .2s, box-shadow .2s, background-color .2s; }
#codigo::placeholder { color: #e9edff; opacity: .86; letter-spacing: .04em; }
#codigo:focus { border-color: var(--led); background: rgba(10,15,46,.42); }

#confirmar { position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 10px; cursor: pointer; color: var(--noite); background: var(--led);
  box-shadow: 0 3px 10px rgba(3,6,24,.35); transition: filter .15s, transform .1s, opacity .2s; }
#confirmar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#confirmar:hover { filter: brightness(1.08); }
#confirmar:active { transform: translateY(1px); }
#confirmar:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#confirmar:disabled { opacity: .6; cursor: wait; }

.aviso { min-height: 1.2em; margin: 0; font-size: 12.5px; color: var(--erro); text-align: center;
  text-shadow: 0 1px 10px rgba(3,6,24,.85); opacity: 0; transition: opacity .25s; }
.aviso.on { opacity: 1; }
#forma.erro .campo { animation: treme .42s; }
@keyframes treme { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
#forma.ok { animation: entra .6s cubic-bezier(.16,1,.3,1) forwards; }
@keyframes entra { to { opacity: 0; transform: translateY(8px); filter: blur(3px); } }

.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  #forma.erro .campo, #forma.ok { animation: none; }
}
/* se o navegador preencher sozinho, mantém o campo translúcido */
#codigo:-webkit-autofill, #codigo:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--texto); caret-color: var(--led);
  transition: background-color 9999s 0s; box-shadow: 0 10px 30px rgba(3,6,24,.28); }
