/* Sign-in page
   Town Hall photo sits at low opacity behind a deep navy wash.
   One load sequence (brand, then card), a slow photo drift and drifting waves. */

.lg-page {
  margin: 0;
  min-height: 100vh;
  background: var(--ink-900);
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

/* ---------- Background stage ---------- */
.lg-stage {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(900px 600px at 12% 8%, #1d5a8c 0%, transparent 60%),
    linear-gradient(155deg, #0f3556 0%, #0a2238 55%, #071827 100%);
}
.lg-photo {
  position: absolute; inset: -4%;
  background: url('../img/town-hall.jpg') center 58% / cover no-repeat;
  opacity: 0.30;
  mix-blend-mode: luminosity;
  transform-origin: 50% 60%;
  animation: photoIn 1.6s ease-out both, photoDrift 38s ease-in-out 1.6s infinite alternate;
  will-change: transform;
}
.lg-stage::after { /* keeps left text and bottom edge readable */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 24, 39, 0.78) 0%, rgba(7, 24, 39, 0.25) 55%, rgba(7, 24, 39, 0.5) 100%),
    linear-gradient(0deg, rgba(7, 24, 39, 0.85) 0%, transparent 38%);
}
@keyframes photoIn { from { opacity: 0; } to { opacity: 0.30; } }
@keyframes photoDrift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to   { transform: scale(1.1) translate3d(-1.5%, -1%, 0); }
}

/* Waves along the bottom edge */
.lg-waves {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  height: 150px; overflow: hidden; pointer-events: none;
}
.lg-waves svg { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; }
.lg-waves .w1 { animation: waveX 26s linear infinite; }
.lg-waves .w2 { animation: waveX 40s linear infinite reverse; }
.lg-waves .w3 { animation: waveX 60s linear infinite; }
@keyframes waveX { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Layout ---------- */
.lg-wrap { background: transparent; }
.lg-page .lg-main { flex: none; padding: 0; }
.lg-page .lg-card { max-width: none; }
.lg-page .lg-card h1 { font-size: 26px; }
.lg-page .lg-footer { margin-top: 26px; color: #8fb0c9; }
.lg-page .lg-footer strong { color: #d4e6f4; }

.lg-wrap {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
  align-items: center;
  gap: clamp(32px, 7vw, 120px);
  padding: 48px clamp(24px, 7vw, 112px);
  max-width: 1440px; margin: 0 auto;
}

/* ---------- Brand column ---------- */
.lg-brand { max-width: 560px; }
.lg-logos { display: flex; align-items: center; margin-bottom: 30px; animation: rise 0.8s cubic-bezier(.2,.7,.2,1) 0.15s both; }
.lg-logo {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18), 0 10px 30px rgba(0, 0, 0, 0.35);
}
.lg-logo + .lg-logo { margin-left: -14px; }
.lg-brand h2 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-size: clamp(30px, 3.6vw, 46px); line-height: 1.12; font-weight: 600; letter-spacing: -0.02em;
  color: #fff; margin: 0 0 14px;
  animation: rise 0.8s cubic-bezier(.2,.7,.2,1) 0.3s both;
}
.lg-brand .lg-muni {
  font-size: 16px; color: #b7d3e8; margin: 0;
  display: flex; align-items: center; gap: 12px;
  animation: rise 0.8s cubic-bezier(.2,.7,.2,1) 0.45s both;
}
.lg-brand .lg-muni::before {
  content: ""; width: 36px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--aqua-400), transparent);
}
.lg-brand .lg-tagline {
  margin: 28px 0 0; max-width: 30em; font-size: 14.5px; line-height: 1.65; color: #8fb0c9;
  animation: rise 0.8s cubic-bezier(.2,.7,.2,1) 0.6s both;
}

/* ---------- Card ---------- */
.lg-main { display: flex; flex-direction: column; align-items: center; }
.lg-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  color: var(--text-900);
  border-radius: 20px;
  padding: 40px 36px 34px;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 30px 70px -10px rgba(2, 12, 24, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.25);
  animation: cardIn 0.9s cubic-bezier(.2,.7,.2,1) 0.35s both;
  position: relative;
}
.lg-card::before { /* water-tone accent along the top edge */
  content: ""; position: absolute; left: 36px; right: 36px; top: 0; height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--blue-600), var(--aqua-400));
}
.lg-card.shake { animation: lg-shake 0.45s ease; }
.lg-card h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 6px; color: var(--ink-900); }
.lg-card p.sub { color: var(--text-600); font-size: 14px; margin: 0 0 26px; }

.lg-card .alert { margin-bottom: 20px; }

.lg-card .form-group { margin-bottom: 18px; }
.lg-card label { font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.lg-field { position: relative; }
.lg-field .lg-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-400); pointer-events: none;
  transition: color 0.15s ease;
}
.lg-field input[type=text], .lg-field input[type=password] {
  padding: 12px 14px 12px 42px; min-height: 48px; font-size: 15px;
  border-radius: 12px; background: var(--surface-2); border-color: var(--line-strong);
}
.lg-field input:focus { background: #fff; }
.lg-field:focus-within .lg-ico { color: var(--blue-600); }
.lg-field.has-toggle input { padding-right: 46px; }
.lg-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-400); cursor: pointer; display: grid; place-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.lg-toggle:hover { background: var(--blue-050); color: var(--blue-600); }
.lg-toggle svg { width: 18px; height: 18px; }
.lg-toggle .eye-off { display: none; }
.lg-toggle[aria-pressed="true"] .eye { display: none; }
.lg-toggle[aria-pressed="true"] .eye-off { display: block; }

.lg-caps { display: none; margin-top: 7px; font-size: 12.5px; color: var(--warning); }
.lg-caps.on { display: block; animation: alertIn 0.2s ease; }

.lg-card .lg-btn {
  position: relative; width: 100%; margin-top: 8px; min-height: 50px;
  border: 0; border-radius: 12px; cursor: pointer;
  font: 600 15px/1 'Inter', sans-serif; color: #fff; letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  box-shadow: 0 10px 22px -8px rgba(11, 102, 178, 0.7);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.lg-card .lg-btn::after { /* light sweep on hover */
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-20deg); transition: left 0.6s ease;
}
.lg-card .lg-btn:hover { box-shadow: 0 14px 26px -8px rgba(11, 102, 178, 0.8); filter: brightness(1.05); }
.lg-card .lg-btn:hover::after { left: 120%; }
.lg-card .lg-btn:active { transform: translateY(1px); }
.lg-card .lg-btn:focus-visible { outline: 3px solid rgba(63, 208, 189, 0.55); outline-offset: 2px; }
.lg-btn .lg-inner { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.lg-btn .lg-spinner {
  display: none; width: 18px; height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.lg-btn.loading .lg-spinner { display: block; }
.lg-btn.loading { pointer-events: none; filter: brightness(0.95); }

.lg-footer { margin-top: 26px; text-align: center; font-size: 12.5px; color: #8fb0c9; animation: rise 0.8s ease 0.9s both; }
.lg-footer strong { color: #d4e6f4; font-weight: 600; }
.lg-credit { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.lg-credit img { width: 26px; height: 26px; background: #fff; border-radius: 6px; padding: 2px; }
.lg-credit .avenra-link { display: inline-flex; color: inherit; text-decoration: none; }
.lg-credit .avenra-link:hover strong, .lg-credit .avenra-link:focus-visible strong { text-decoration: underline; }

/* ---------- Motion ---------- */
@keyframes rise   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(26px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes lg-shake  { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
@keyframes spin   { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .lg-wrap { grid-template-columns: minmax(0, 480px); justify-content: center; gap: 28px; padding: 36px 20px 60px; align-content: center; }
  .lg-brand { text-align: center; max-width: none; }
  .lg-logos { justify-content: center; margin-bottom: 18px; }
  .lg-logo { width: 60px; height: 60px; }
  .lg-brand h2 { font-size: 26px; margin-bottom: 8px; }
  .lg-brand .lg-muni { justify-content: center; font-size: 14.5px; }
  .lg-brand .lg-muni::before { display: none; }
  .lg-brand .lg-tagline { display: none; }
}
@media (max-width: 480px) {
  .lg-card { padding: 32px 22px 26px; border-radius: 18px; }
  .lg-card::before { left: 22px; right: 22px; }
  .lg-waves { height: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-photo { animation: none; opacity: 0.30; }
  .lg-waves svg, .lg-logos, .lg-brand *, .lg-card, .lg-footer { animation: none !important; }
}
