/* ─────────────────────────────────────────────────────────
   LOGIN — Grupo Referencial · Triangulação
───────────────────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --verde: #93f205;
  --verde-dark: #6db804;
  --ink: #000000;
  --ink-2: #000000;
  --gray-1: #000000;
  --gray-2: #8a93a0;
  --gray-3: #c7ced6;
  --gray-4: #e3e7ec;
  --gray-5: #f1f4f7;
  --err: #d64550;

 
  --card-x: 50%;
  --card-y: 50%;
}

html, body {
  height: 100%;
  font-family: "Rational", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  line-height: 1;
  user-select: none;
}

/* ── Shell ─────────────────────────────────── */
.login-shell {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: #000;
}

/* ── Vídeo de fundo ─────────────────────────── */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: grayscale(35%) contrast(1.05) brightness(0.75);
}
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(1200px 700px at 30% 40%, rgba(0,0,0,0.25), rgba(0,0,0,0.55) 70%),
    linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0.55));
  pointer-events: none;
}

/* ── Coluna central — formulário ───────────── */
.login-main {
  position: relative;
  z-index: 2;
  height: 100vh;
  overflow-y: auto;
  min-height: 0;
}

.login-card {
  /* Posicionado via --card-x / --card-y (ver :root no topo) */
  position: absolute;
  left: var(--card-x);
  top: var(--card-y);
  transform: translate(-50%, -50%);
  width: calc(100% - 48px);
  max-width: 400px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-radius: 20px;
  padding: 36px 32px 28px;
  box-shadow:
    0 20px 60px -10px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* Logo centralizada no topo */
.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.login-logo img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.login-title {
  font-family: var(--font-display, "Rational Display", "Rational", sans-serif);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.028em;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.login-sub {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 32px;
  line-height: 1.5;
  text-align: center;
}

/* Formulário */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Campos refinados ───────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.field-label {
  font-family: var(--font-display, "Rational Display", "Rational", sans-serif);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding-bottom: 2px;
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.10);
  border: 1.5px solid rgba(255, 255, 255, 0.20);
  border-radius: 14px;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}
.field-wrap:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.32);
}
.field-wrap:focus-within {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--verde);
  box-shadow:
    0 0 0 4px rgba(147, 242, 5, 0.15),
    0 8px 24px -8px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}
.field-wrap:focus-within::before {
  width: 100%;
  opacity: 0.9;
}
.field-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, transparent, var(--verde-dark), transparent);
  border-radius: 999px;
  transform: translateX(-50%);
  opacity: 0;
  transition: width 0.4s ease, opacity 0.3s ease;
}

.field-icon {
  position: absolute;
  left: 16px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 19px;
  pointer-events: none;
  transition: color 0.2s, transform 0.2s;
}
.field-wrap:focus-within .field-icon {
  color: var(--verde);
  transform: scale(1.05);
}

.field-wrap input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: 0;
  height: 52px;
  padding: 0 18px 0 46px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: #fff;
  caret-color: var(--verde);
}
.field-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.2s;
}
.field-wrap:focus-within input::placeholder {
  opacity: 0.5;
  transform: translateX(4px);
}
.field-wrap input:-webkit-autofill,
.field-wrap input:-webkit-autofill:hover,
.field-wrap input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(30, 30, 30, 0.9) inset;
  -webkit-text-fill-color: #fff;
  caret-color: var(--verde);
  transition: background-color 9999s ease-out 0s;
}

.field-eye {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px 14px;
  margin-right: 4px;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  border-radius: 8px;
  transition: all 0.18s ease;
}
.field-eye:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.10);
}
.field-eye .material-symbols-outlined { font-size: 19px; }

/* Erro inline */
.login-erro {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(214, 69, 80, 0.07);
  border: 1px solid rgba(214, 69, 80, 0.22);
  border-radius: 8px;
  color: var(--err);
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.2s, max-height 0.2s, margin 0.2s;
  margin: 0;
}
.login-erro.show {
  opacity: 1;
  max-height: 50px;
  margin-top: -4px;
}
.login-erro .material-symbols-outlined { font-size: 16px; flex-shrink: 0; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.login-erro.shake { animation: shake 0.35s; }

/* Botão */
.login-btn {
  position: relative;
  height: 48px;
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s, transform 0.1s;
  overflow: hidden;
}
.login-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--verde);
  transition: width 0.25s;
}
.login-btn:hover { background: var(--ink-2); }
.login-btn:hover::before { width: 100%; opacity: 0.12; }
.login-btn:active { transform: scale(0.99); }
.login-btn:disabled { cursor: wait; opacity: 0.7; }

.btn-arrow { font-size: 18px; transition: transform 0.2s; }
.login-btn:hover .btn-arrow { transform: translateX(3px); }

.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-btn.loading .btn-label,
.login-btn.loading .btn-arrow { display: none; }
.login-btn.loading .btn-spinner { display: block; }

/* Rodapé */
.login-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}
.login-footer .dot { opacity: 0.5; margin: 0 6px; }

/* Botão — leve ajuste pra combinar com o glass */
.login-btn {
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.5);
}

/* Responsivo */
@media (max-width: 480px) {
  .login-main { padding: 24px 18px; }
  .login-card { padding: 28px 22px 22px; }
  .login-title { font-size: 1.3rem; }
}
