/* Base */
*{ box-sizing: border-box; }

body.auth-page{
  margin: 0;
  font-family: var(--wl-font-family, system-ui, -apple-system, "Segoe UI", Arial, sans-serif);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--wl-text-on-light, #1a2f4a);
  background: var(--wl-palette-bg, #e4edf7);
}

.login-root{
  min-height: 100vh;
  min-height: 100dvh;
}

/* Background */
.login-bg{
  position: fixed;
  inset: 0;
  background: var(--wl-palette-bg, #e4edf7);
  z-index: -1;
}

/* Logo centered above the card (legacy / other auth pages) */
.auth-stack{
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: clamp(20px, 4vh, 36px);
}

.auth-logo-top{
  display: block;
  text-decoration: none;
  line-height: 0;
  flex-shrink: 0;
}

.auth-hero-logo{
  display: block;
  width: min(560px, 96vw);
  height: auto;
  max-height: min(300px, 42vh);
  object-fit: contain;
  margin-inline: auto;
  filter: drop-shadow(0 10px 28px rgba(26, 47, 74, 0.16));
}

/* Logo inside the white auth card */
.auth-card__brand{
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 12px;
  text-decoration: none;
  line-height: 0;
}

.auth-card__logo{
  display: block;
  width: auto;
  height: clamp(72px, 18vw, 108px);
  max-width: min(280px, 70%);
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(26, 47, 74, 0.12));
}

/* Shell + card */
.auth-shell{
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 40px);
  padding-top: clamp(28px, 6vh, 56px);
}

.auth-card{
  width: min(420px, 100%);
  padding: clamp(24px, 4vw, 32px);
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(26, 47, 74, 0.08);
  box-shadow:
    0 4px 6px -1px rgba(26, 47, 74, 0.06),
    0 20px 40px -12px rgba(26, 47, 74, 0.12);
}

.auth-card__head{
  margin-bottom: 22px;
  text-align: center;
}

.auth-card__title{
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3.5vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--wl-palette-navy, #1a2f4a);
  line-height: 1.25;
}

.auth-card__sub{
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(26, 47, 74, 0.62);
}

.login-form{
  width: 100%;
  display: grid;
  gap: 16px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* Stacked fields */
.login-form .row{
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 8px;
}

.login-form .row label{
  font-family: var(--wl-font-family, system-ui, sans-serif);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--wl-palette-navy-mid, #243854);
  text-align: start;
  white-space: normal;
}

.login-form .row input{
  min-width: 0;
  width: 100%;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(26, 47, 74, 0.18);
  background: #f8fafc;
  outline: none;
  padding: 10px 14px;
  font-size: 16px;
  color: var(--wl-text-on-light, #1a2f4a);
  box-shadow: none;
  transition:
    border-color .16s ease-out,
    background-color .16s ease-out,
    box-shadow .16s ease-out;
}

.login-form .row input::placeholder{
  color: #9ca3af;
}

.login-form .row input:focus{
  border-color: var(--wl-palette-logo, #36d7e8);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(54, 215, 232, 0.2);
}

.login-btn{
  width: 100%;
  margin-top: 4px;
  border: 0;
  cursor: pointer;
  padding: 14px 20px;
  border-radius: 12px;
  color: var(--wl-palette-navy, #1a2f4a);
  font-weight: 800;
  font-size: 1rem;
  background: var(--wl-palette-logo, #36d7e8);
  box-shadow: 0 8px 20px rgba(54, 215, 232, 0.35);
  transition:
    transform .18s ease-out,
    box-shadow .18s ease-out,
    filter .18s ease-out;
}

.login-btn:hover{
  filter: brightness(1.04);
  box-shadow: 0 10px 26px rgba(54, 215, 232, 0.42);
}

.error{
  margin: 0;
  min-height: 22px;
  width: 100%;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #b91c1c;
}

.forgot-link{
  text-align: center;
  margin-top: 2px;
  display: block;
  color: var(--wl-palette-logo-deep, #1fb8d4);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.forgot-link:hover{
  text-decoration: underline;
}

.footer{
  margin: 8px 0 0;
  color: rgba(26, 47, 74, 0.6);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.5;
}

.footer a{
  color: var(--wl-palette-logo-deep, #1fb8d4);
  font-weight: 700;
  text-decoration: none;
}

.footer a:hover{
  text-decoration: underline;
}

/* ===== Dark mode ===== */
body.dark-mode.auth-page{
  background: #020617;
  color: #e5edf7;
}

body.dark-mode .login-bg{
  background:
    radial-gradient(circle at 100% 0%, rgba(34, 211, 238, 0.12), transparent 45%),
    linear-gradient(180deg, #0f172a 0%, #020617 100%);
}

body.dark-mode .auth-hero-logo,
body.dark-mode .auth-card__logo{
  filter: drop-shadow(0 12px 36px rgba(0, 0, 0, 0.45));
}

body.dark-mode .auth-card{
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.85);
}

body.dark-mode .auth-card__title{
  color: #f8fafc;
}

body.dark-mode .auth-card__sub{
  color: #9ca3af;
}

body.dark-mode .login-form .row label{
  color: #e5edf7;
}

body.dark-mode .login-form .row input{
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #020617;
  color: #e5edf7;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
}

body.dark-mode .login-form .row input::placeholder{
  color: #6b7280;
}

body.dark-mode .login-form .row input:focus{
  border-color: #06b6d4;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.55);
}

body.dark-mode .login-btn{
  color: #f9fafb;
  background: linear-gradient(135deg, #22d3ee, #0e7490);
  box-shadow: 0 16px 40px rgba(8, 47, 73, 0.75);
}

body.dark-mode .login-btn:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
}

body.dark-mode .error{
  color: #f97373;
}

body.dark-mode .forgot-link,
body.dark-mode .footer{
  color: #9ca3af;
}

body.dark-mode .footer a,
body.dark-mode .forgot-link{
  color: #22d3ee;
}

body.dark-mode .login-form input:-webkit-autofill,
body.dark-mode .login-form input:-webkit-autofill:hover,
body.dark-mode .login-form input:-webkit-autofill:focus,
body.dark-mode .login-form input:-webkit-autofill:active{
  -webkit-box-shadow: 0 0 0 1000px #020617 inset !important;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35) inset !important;
  -webkit-text-fill-color: #f8fafc !important;
  caret-color: #f8fafc;
}

@media (max-width: 380px){
  .auth-hero-logo{
    width: min(440px, 94vw);
    max-height: min(260px, 38vh);
  }
}
