/* ==================================================
   LOGIN AUTOKEY — GLASS UI (ALINHADO AO CONSULTA / ADMIN)
================================================== */

:root {
  --bg-page: #F5F6F7;
  --bg-glass: rgba(255, 255, 255, 0.82);
  --bg-input: rgba(255, 255, 255, 0.75);

  --border-subtle: rgba(0, 0, 0, 0.08);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-primary: #1F5FBF;
  --accent-danger: #790000;
  --accent-vinho: #790000;

  --radius-lg: 28px;
  --radius: 18px;
  --radius-sm: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-secondary);

  background-image: url('images/background3.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;

  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  pointer-events: none;
  z-index: -1;
}

.login-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  justify-content: center;
}

.login-zone {
  width: 100%;
  padding: 36px 30px 28px;

  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);

  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.55);

  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.login-logo {
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-vinho);
  text-align: center;
  margin-bottom: 6px;
}

.login-desc {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.45;
  margin-bottom: 22px;
}

#loginForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-erro:empty, .login-erro[hidden] {
  display: none !important;
}
.login-erro.visivel {
  display: block;
}
.login-erro {
  display: none;

  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(229, 62, 62, 0.12);
  border: 1px solid rgba(229, 62, 62, 0.35);
  color: #c53030;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.login-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.login-zone input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius);

  background: var(--bg-input);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  border: 1px solid rgba(15, 23, 42, 0.12);

  font-size: 16px; /* 16px evita zoom automático no mobile */
  color: var(--text-primary);
  outline: none;
  touch-action: manipulation;
  transition: border-color .15s, background .15s;
}

.login-zone input::placeholder {
  color: var(--text-muted);
  font-size: 14.5px;
}

.login-zone input:focus {
  background: #ffffff;
  border-color: var(--accent-vinho);
  box-shadow: 0 0 0 3px rgba(121, 0, 0, 0.12);
}

.login-actions {
  margin-top: 8px;
}

.login-actions button {
  width: 100%;
  padding: 14px;
  border-radius: 999px;

  background: var(--accent-vinho);
  border: 0;

  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;

  box-shadow:
    0 10px 22px rgba(121, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);

  transition: transform .15s ease, box-shadow .15s ease, background .15s;
}

.login-actions button:hover {
  transform: translateY(-1px);
  background: #960000;
  box-shadow: 0 14px 28px rgba(121, 0, 0, 0.35);
}

.login-actions button:active {
  transform: scale(0.98);
}

.login-actions button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.login-footer {
  margin-top: 22px;
  text-align: center;
}

.login-voltar {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  transition: color .15s;
}

.login-voltar:hover {
  color: var(--accent-vinho);
}

@media (max-width: 480px) {
  .login-zone {
    padding: 28px 20px 22px;
    border-radius: 22px;
  }
  .login-title {
    font-size: 18px;
  }
}
