/* WHY: body token overrides were moved to main.css §2b layer —
   if they load via manifest, they arrive after first render and cause
   a visible color flash. Only layout overrides remain here. */
body {
  /* WHY: flex removed — .login-layout grid handles centering.
     overflow hidden clips grid lines to viewport. */
  height:   100vh;
  overflow: hidden;
}


/* ── Logo corner (fixed top-left) ────────────────────────────────────────── */
.login-logo-corner {
  position:    fixed;
  top:         1.5rem;
  left:        1.75rem;
  display:     flex;
  align-items: center;
  gap:         0.6rem;
  z-index:     var(--z-raised);
  color:       var(--text-main);
}

.login-logo-meta {
  display:        flex;
  flex-direction: column;
  line-height:    1.2;
}

.login-logo-name {
  font-weight: 700;
  font-size:   0.9rem;
}

.login-logo-version {
  font-size: 0.68rem;
  color:     var(--text-muted);
}

/* ── Two-column layout ───────────────────────────────────────────────────── */
.login-layout {
  display:               grid;
  grid-template-columns: 1fr 460px;
  align-items:           center;
  min-height:            100vh;
  max-width:             1280px;
  margin:                0 auto;
  padding:               0 4rem;
  gap:                   4rem;
}

/* ── Left: brand headline ────────────────────────────────────────────────── */
.login-brand {
  display:         flex;
  flex-direction:  column;
  justify-content: center;
}

.login-headline {
  font-size:      3.5rem;
  font-weight:    800;
  line-height:    1.15;
  letter-spacing: -0.03em;
  margin:         0;
}

.login-headline-accent { color: #28a745; }

/* ── Right: form column ──────────────────────────────────────────────────── */
.login-layout > div:last-child { padding: 3rem 0; }

.login-header        { margin-bottom: 2rem; }

.login-header p {
  color:     var(--text-muted);
  font-size: 0.9rem;
  margin:    0;
}

.login-card-title {
  font-size:      1.75rem;
  font-weight:    700;
  letter-spacing: -0.02em;
  margin:         0 0 0.4rem;
}

/* ── Input group ─────────────────────────────────────────────────────────── */
.input-group       { margin-bottom: 1.25rem; }

.input-group label {
  display:        block;
  font-size:      0.75rem;
  font-weight:    500;
  color:          var(--text-muted);
  margin-bottom:  0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.password-wrapper {
  position:    relative;
  display:     flex;
  align-items: center;
}

.input-icon {
  position:       absolute;
  left:           14px;
  color:          var(--text-subtle);
  pointer-events: none;
  z-index:        var(--z-input-icon);
}

.password-wrapper input {
  width:         100%;
  padding:       13px 46px 13px 40px;
  background:    var(--bg-color);
  border:        1px solid #333;
  border-radius: 6px;
  color:         var(--text-main);
  font-family:   inherit;
  font-size:     0.95rem;
}

.password-wrapper input:focus {
  outline:      none;
  border-color: #28a745;
  box-shadow:   0 0 0 2px rgb(40, 167, 69, 0.15);
}

.password-wrapper input::placeholder { color: rgb(255, 255, 255, 0.2); }

/* ── Password toggle ─────────────────────────────────────────────────────── */
.toggle-password {
  position:   absolute;
  right:      12px;
  background: none;
  border:     none;
  color:      var(--text-muted);
  cursor:     pointer;
  padding:    4px;
  line-height: 0;
}

.toggle-password:hover { color: var(--text-light); }

.toggle-pass-icon {
  width:  18px;
  height: 18px;
}

/* ── TOTP ────────────────────────────────────────────────────────────────── */
.totp-input {
  text-align:     center;
  letter-spacing: 8px;
  font-weight:    700;
  padding-left:   14px;
}

.totp-group {
  display:   none;
}

/* ── Submit ──────────────────────────────────────────────────────────────── */
.login-submit {
  width:          100%;
  padding:        13px;
  margin-top:     0.5rem;
  background:     #28a745;
  border:         none;
  border-radius:  6px;
  color:          #fff;
  font-weight:    600;
  font-size:      0.95rem;
  font-family:    inherit;
  cursor:         pointer;
  letter-spacing: 0.01em;
}

.login-submit:hover    { background: #218838; }
.login-submit:active   { background: #1e7e34; }

.login-submit:disabled {
  opacity: 0.5;
  cursor:  not-allowed;
}

/* ── Error / attempt ─────────────────────────────────────────────────────── */
.login-error {
  color:      var(--accent-red);
  font-size:  0.82rem;
  margin-top: 1rem;
  min-height: 18px;
  opacity:    0;
}

.attempt-warning {
  font-size:  0.78rem;
  color:      var(--text-muted);
  margin-top: 0.5rem;
  opacity:    0;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.login-footer {
  margin-top: 2rem;
  font-size:  0.72rem;
  color:      var(--text-subtle);
}

/* ── Entry animation ─────────────────────────────────────────────────────── */

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (width <= 900px) {
  .login-layout {
    grid-template-columns: 1fr;
    padding:               5rem 2rem 3rem;
    align-items:           flex-start;
  }

  .login-brand { display: none; }
}
