/* ============================================================
   Página de Login + Toggle metálico deslizante
   ============================================================ */

body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(26, 74, 173, .35) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(201, 162, 39, .15) 0%, transparent 45%),
    linear-gradient(160deg, #061a45 0%, #0a2a6a 45%, #123a8a 100%);
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  overflow: hidden;
  animation: fadeUp .5s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  padding: 1.75rem 1.5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.login-header::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background:
    linear-gradient(135deg, transparent 40%, rgba(255,255,255,.15) 40% 50%, transparent 50% 60%, rgba(255,255,255,.1) 60% 70%, transparent 70%);
}
.login-header .brasao {
  width: 64px;
  height: auto;
  margin: 0 auto .75rem;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.3));
}
.login-header h1 {
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.3;
}
.login-header p {
  color: rgba(255,255,255,.7);
  font-size: .72rem;
  margin-top: .35rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.login-body {
  padding: 1.75rem 1.5rem 1.5rem;
}

/* ---- Toggle metálico deslizante ---- */
.role-toggle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.75rem;
}

.role-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--navy);
  margin-bottom: .65rem;
  height: 1.1rem;
  transition: opacity .25s;
}

.metal-switch {
  position: relative;
  width: 160px;
  height: 52px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  /* Trilho metálico */
  background:
    linear-gradient(180deg,
      #6a7a90 0%,
      #8a9aac 15%,
      #b0bcc8 35%,
      #d0d8e0 50%,
      #a0acb8 70%,
      #708090 100%);
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,.5),
    inset 0 -3px 6px rgba(0,0,0,.35),
    0 4px 12px rgba(0,0,0,.25),
    0 1px 0 rgba(255,255,255,.3);
  border: 1px solid #5a6a7a;
  outline: none;
}

.metal-switch:focus-visible {
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,.5),
    inset 0 -3px 6px rgba(0,0,0,.35),
    0 0 0 3px rgba(10, 42, 106, .4);
}

.metal-switch-track {
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, #3a4a5a 0%, #2a3a4a 100%);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  overflow: hidden;
}

.metal-switch-track span {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  transition: color .3s, text-shadow .3s;
  z-index: 1;
  pointer-events: none;
}

.metal-switch[data-role="motorista"] .label-motorista,
.metal-switch[data-role="admin"] .label-admin {
  color: rgba(255,255,255,.9);
  text-shadow: 0 0 8px rgba(255,255,255,.4);
}

/* Botão redondo metálico (knob) */
.metal-knob {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  z-index: 2;
  transition: left .35s cubic-bezier(.4, .0, .2, 1);
  /* Metal brushed */
  background:
    radial-gradient(circle at 35% 30%, #ffffff 0%, transparent 40%),
    radial-gradient(circle at 65% 70%, rgba(0,0,0,.15) 0%, transparent 45%),
    linear-gradient(145deg,
      #e8eef4 0%,
      #c0c8d0 25%,
      #e0e6ec 45%,
      #a8b0b8 60%,
      #d0d8e0 80%,
      #9098a0 100%);
  box-shadow:
    0 3px 8px rgba(0,0,0,.4),
    0 1px 2px rgba(0,0,0,.3),
    inset 0 2px 3px rgba(255,255,255,.8),
    inset 0 -2px 3px rgba(0,0,0,.25);
  border: 1px solid #8890a0;
}

.metal-knob::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 1px,
      rgba(255,255,255,.08) 1px,
      rgba(255,255,255,.08) 2px
    ),
    linear-gradient(180deg, #d8e0e8, #a0a8b0);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.2);
  opacity: .7;
}

.metal-switch[data-role="admin"] .metal-knob {
  left: calc(100% - 47px);
}

.metal-switch:active .metal-knob {
  transform: scale(.95);
}

.login-form .form-group { margin-bottom: 1.1rem; }

.login-form .password-wrap {
  position: relative;
}
.login-form .password-wrap input { padding-right: 2.8rem; }
.login-form .toggle-pass {
  position: absolute;
  right: .7rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 1rem;
  padding: .25rem;
}
.login-form .toggle-pass:hover { color: var(--navy); }

.login-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  font-size: .85rem;
}
.login-links a { color: var(--navy-mid); font-weight: 600; }

.login-footer {
  text-align: center;
  padding: 0 1.5rem 1.25rem;
  font-size: .7rem;
  color: var(--gray-400);
}

#loginError { display: none; }
#loginError.show { display: block; }
