/* =========================================================
   Login — glass card. Tokens de fonte/cor compartilhados vêm de theme.css
   (importado antes deste arquivo no <head> de login.html).
   ========================================================= */

:root {
  --blue-500: #0085ff;   /* centro do gradiente de fundo */
  --blue-700: #003465;   /* borda do gradiente de fundo */
  --glass-fill: rgba(88, 130, 193, 0.28);
  --border-accent: #ffffff;  /* borda da logo — branco sólido */
  --placeholder: #bcbec0;
  --comet-color: #ffffff;
  --comet-glow: rgba(255, 255, 255, 0.7);
  --radius-card: 28.46px;
  --radius-btn: 7.12px;
  --radius-input: 5px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  line-height: 1.2;
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Fundo ---------- */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    url("assets/bg.jpg") center / cover no-repeat,
    radial-gradient(ellipse at 55% 45%, var(--blue-500) 0%, var(--blue-700) 100%);
}

/* ---------- Card de vidro ---------- */
.card {
  width: 410px;
  max-width: 100%;
  padding: 40px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
  border-radius: var(--radius-card);
  background: var(--glass-fill);
  backdrop-filter: blur(8.9px);
  -webkit-backdrop-filter: blur(8.9px);
  overflow: hidden;
}

.logo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50px;
  border: 2px solid var(--border-accent);
  display: block;
}

/* ---------- Formulário ---------- */
.form {
  width: 250px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.fields {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.field label {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.field input,
.field select {
  width: 100%;
  height: 32px;
  padding: 0 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  background: var(--white);
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  outline: none;
  position: relative;
  z-index: 1;
}

.field select { cursor: pointer; }

.field input::placeholder { color: var(--placeholder); }

/* ---------- Anel "cometa" no foco: um traço de luz com calda que gira em
   volta do campo enquanto ele está focado. Diferente do .hover-comet do
   painel (que usa transform:rotate — ok em avatares quadrados/redondos):
   aqui o campo é um retângulo bem mais largo que alto, e girar a caixa
   inteira faz ela parecer "girando" de verdade (o bug reportado). Em vez
   disso, o anel fica parado e só o ângulo do gradiente cônico (via
   @property) gira por dentro dele — a luz se move, a caixa não. ---------- */
@property --cometa-ang {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.field-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius-input);
}

/* Anel fino sempre visível no foco — garante que o contorno do campo
   apareça inteiro, já que o campo é bem mais largo que alto e um brilho
   fino sozinho girando por ângulo passa rápido demais nos lados compridos. */
.field-wrap::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 1.5px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.field-wrap:focus-within::before { opacity: 1; }

.field-wrap::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--cometa-ang),
    transparent 0deg,
    transparent 270deg,
    var(--comet-glow) 320deg,
    var(--comet-color) 355deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  filter: drop-shadow(0 0 3px var(--comet-color));
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.field-wrap:focus-within::after {
  opacity: 1;
  animation: girar-cometa 1.8s linear infinite;
}

@keyframes girar-cometa {
  to { --cometa-ang: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  .field-wrap:focus-within::after { animation: none; }
}

.input-wrap { position: relative; width: 100%; }

.input-wrap input { padding-right: 36px; }

.toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.toggle-password img { width: 100%; height: 100%; display: block; }

.forgot {
  margin-top: -6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
}

.forgot:hover { text-decoration: underline; }

.error-message {
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-input);
  background: rgba(255, 80, 80, 0.18);
  border: 1px solid rgba(255, 120, 120, 0.6);
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  display: none;
}

.error-message.visible { display: block; }

/* ---------- Botões ---------- */
.btn-primary {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: var(--radius-btn);
  background: var(--blue-700);
  color: var(--white);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s ease;
}

.btn-primary:hover { filter: brightness(1.15); }

.btn-primary:disabled { opacity: 0.6; cursor: default; }

.divider {
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.social {
  width: 100%;
  display: flex;
  gap: 17px;
}

.btn-social {
  flex: 1 0 0;
  min-width: 0;
  padding: 9px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: background .15s ease;
}

.btn-social:hover { background: #f3f4f6; }

.btn-social img { width: 17px; height: 17px; display: block; }

.register {
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: 9.96px;
  font-weight: 400;
  line-height: 1.2;
}

.register a {
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
}

.register a:hover { text-decoration: underline; }

/* ---------- Responsivo ---------- */
@media (max-width: 480px) {
  .card { padding: 32px 24px; gap: 32px; }
  .form { width: 100%; }
}
