/* ==========================================================================
   AutoDrive — Authentication screens (sign in, branch selection)
   --------------------------------------------------------------------------
   The original used a 1.4 MB background photograph behind a translucent blue
   panel, a 300px fixed-width container and inputs with no labels. This is a
   centred card on a painted background: no image request, readable at any
   size, and correctly labelled for assistive technology.
   ========================================================================== */

.ad-auth {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: var(--sp-6) var(--sp-4);
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(255, 190, 70, .16), transparent 60%),
    radial-gradient(1000px 600px at 100% 110%, rgba(54, 104, 238, .30), transparent 60%),
    linear-gradient(160deg, var(--b-950) 0%, #16264f 55%, var(--b-900) 100%);
}

/* A faint lane marking, drawn in CSS — a nod to the domain that costs nothing
   to download. */
.ad-auth::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    115deg,
    transparent 0 78px,
    rgba(255, 255, 255, .045) 78px 116px
  );
  mask-image: linear-gradient(to bottom, transparent, #000 45%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%, transparent);
}

.ad-auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: var(--sp-8);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius-xl);
  background: var(--surface-card);
  box-shadow: var(--shadow-xl);
}

/* Brand lockup: the L-plate mark reads as a floating letter on its own, so it
   is paired with the wordmark. The mark is the product's, not a tenant's —
   customer logos (css/ico/logo.png) belong to individual schools. */
.ad-auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.ad-auth-brand .ad-plate {
  width: 38px;
  height: 38px;
  font-size: 22px;
}

.ad-auth-wordmark {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: -.02em;
  color: var(--text-strong);
  line-height: 1;
}

.ad-auth-title {
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  text-align: center;
}

.ad-auth-subtitle {
  margin: 0 0 var(--sp-6);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}

.ad-field { margin-bottom: var(--sp-4); }

.ad-field > label {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

/* Inputs inside the auth card are full width — the contract layer leaves
   inputs at auto width because legacy views size them individually. */
.ad-auth-card input[type="text"],
.ad-auth-card input[type="password"],
.ad-auth-card select {
  width: 100%;
  min-height: 44px;
}

.ad-auth-card .btn {
  width: 100%;
  min-height: 44px;
  margin-top: var(--sp-2);
  font-size: var(--fs-md);
}

.ad-auth-card .alert { font-size: var(--fs-sm); }
.ad-auth-card .alert:empty,
.ad-auth-card .alert p:empty { display: none; }

.ad-auth-footer {
  margin-top: var(--sp-6);
  color: var(--text-subtle);
  font-size: var(--fs-xs);
  text-align: center;
}

/* Password field with a reveal toggle */
.ad-password { position: relative; display: flex; }
.ad-password input { padding-right: 44px; }

.ad-password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.ad-password-toggle:hover { background: var(--surface-sunken); color: var(--text); }
.ad-password-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }

@media (max-width: 420px) {
  .ad-auth-card { padding: var(--sp-6) var(--sp-5); }
}
