/* Login screen — externalised from login.html for strict CSP (audit #3 + #34).
   Single-page styles; not loaded outside /login. */

body { margin: 0; padding: 0; }
.login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  background: var(--brand-primary);
  background: linear-gradient(160deg, var(--brand-gradient-start) 0%, var(--brand-primary) 50%, var(--brand-gradient-end) 100%);
}
.login-box {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 40px 28px 32px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}
.login-logo {
  margin-bottom: 20px;
}
.login-logo svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}
.login-box h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--brand-primary);
  margin-bottom: 4px;
}
.login-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: 28px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  font-size: 16px;
  font-family: var(--font-sans);
  min-height: 48px;
  transition: border-color 150ms, box-shadow 150ms;
}
.login-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.15);
}
.login-input::placeholder {
  color: var(--text-tertiary);
}
.login-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  background: var(--brand-accent);
  color: #fff;
  font-size: 17px;
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  cursor: pointer;
  min-height: 48px;
  transition: opacity 150ms, transform 100ms;
  margin-top: 4px;
}
.login-btn:hover { opacity: 0.92; }
.login-btn:active { transform: scale(0.985); opacity: 0.85; }
/* Audit #50 — was opacity: 0.5 only, which made the orange-on-white button
   look broken instead of "submitting". A 0.7 opacity is a clear "muted but
   present" signal, and an explicit muted text colour reinforces it without
   relying on the user noticing a 50 % opacity drop. */
.login-btn:disabled {
  opacity: 0.7;
  color: rgba(255, 255, 255, 0.7);
  cursor: not-allowed;
}
.login-error {
  color: var(--status-rejected);
  font-size: var(--text-sm);
  margin-top: 4px;
  min-height: 1.3em;
}
.login-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}
.login-lang {
  margin-top: 16px;
}
.login-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* Q-4: 44 px min-height for WCAG 2.5.5 touch target. */
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 150ms, color 150ms;
}
.login-lang-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.login-lang-btn svg {
  width: 16px;
  height: 16px;
}

/* /login/2fa — small inline-style link that swaps between TOTP and backup
   modes, and the "Sign in again" escape hatch. Looks like a button but is
   visually subordinate to the primary verify CTA. */
.login-link-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 6px 4px;
  border: none;
  background: transparent;
  color: var(--brand-primary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  text-decoration: none;
  cursor: pointer;
}
.login-link-btn:hover { text-decoration: underline; }
.login-link-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* F#7 — "Forgot password?" link inside .login-form on both desktop and
   mobile. Renders centred under the submit button (the form is a flex
   column, so align-self: center works on every breakpoint). The mobile
   override in login_mobile.css preserves the existing 14px tuning. */
.login-forgot {
  background: transparent;
  border: 0;
  color: var(--brand-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  padding: 6px 4px;
  margin-top: 4px;
  align-self: center;
}
.login-forgot:hover { text-decoration: underline; }
.login-forgot:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: 2px;
}
[data-theme="dark"] .login-forgot { color: #93c5fd; }

@media (min-width: 768px) {
  .login-box {
    padding: 48px 40px 40px;
  }
}

/* Q-1: desktop split layout. Below 1024 px we render the mobile single-card
   layout (existing). At 1024 px+ we wrap the card in a two-column .login-split
   with a brand/marketing panel on the left, keeping the user-facing form
   identical on the right. Benchmarked against Linear's login (split
   brand+form) and Procore admin's auth screens. */
.login-brand { display: none; }

@media (min-width: 1024px) {
  .login-screen { align-items: center; }
  .login-split {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 56px;
    align-items: center;
    width: 100%;
    max-width: 960px;
  }
  .login-brand {
    display: block;
    color: var(--text-inverse);
    padding: 24px;
  }
  .login-brand__mark {
    display: inline-flex;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
  }
  .login-brand__mark svg { width: 44px; height: 44px; }
  .login-brand__title {
    font-size: 42px;
    font-weight: var(--weight-bold);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 12px;
  }
  .login-brand__tag {
    font-size: var(--text-lg);
    color: rgba(255, 255, 255, 0.85);
    line-height: var(--leading-normal);
    margin-bottom: 36px;
    max-width: 420px;
  }
  .login-brand__features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .login-brand__feature {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: rgba(255, 255, 255, 0.82);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    max-width: 420px;
  }
  .login-brand__feature svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--brand-accent);
    margin-top: 2px;
  }
  .login-brand__trailer {
    margin-top: 24px;
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.6);
    line-height: var(--leading-normal);
    max-width: 420px;
  }
  /* Right-side card keeps its max-width but the split container lays it out
     against the grid's 420 px track. */
  .login-split .login-box { max-width: none; }
}
