/* Flow Linear login only. Other application pages keep their existing styles. */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --login-navy: #112335;
  --login-ink: #1e2d40;
  --login-muted: #5d6e80;
  --login-border: #d8e2ec;
  --login-action: #176ba3;
  --login-action-hover: #0e527f;
  --login-focus: #43aedd;
}

html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--login-ink);
  background: #fff;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
}

.welcome-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  padding: clamp(32px, 4vw, 72px);
  color: #fff;
  background:
    radial-gradient(circle at 95% 84%, rgba(67, 174, 221, .18), transparent 34%),
    linear-gradient(145deg, #112335, #1b3851);
}

.welcome-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(17, 35, 53, .76), rgba(18, 51, 77, .72));
}

.welcome-photo {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.welcome-photo.is-visible { opacity: 1; }

.brand-logo {
  position: relative;
  z-index: 2;
  display: block;
  width: clamp(220px, 22vw, 280px);
  max-width: 100%;
  height: auto;
}

.signin-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  padding: clamp(32px, 5vw, 72px);
  background: #fff;
}

.signin-content {
  width: 100%;
  max-width: 440px;
  margin: auto;
}

.signin-content h1 {
  margin: 0 0 34px;
  color: var(--login-ink);
  font-size: 2rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.form-group { margin-bottom: 24px; }
.form-group label {
  display: block;
  margin-bottom: 9px;
  color: var(--login-ink);
  font-size: .875rem;
  font-weight: 650;
}

.form-group input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--login-border);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--login-ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color .2s, box-shadow .2s;
}

.form-group input::placeholder { color: var(--login-muted); opacity: 1; }
.form-group input:focus-visible {
  border-color: var(--login-focus);
  box-shadow: 0 0 0 4px rgba(67, 174, 221, .18);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: -8px 0 28px;
}

/* Quiet in-panel actions (Forgot password, Back to sign in, Resend) are
   buttons styled as the shared blue text link: they change the panel, not
   the page, and never compete with the primary action. */
.forgot-link,
.text-action {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
}

.forgot-link,
.text-action,
.login-footer a {
  color: var(--login-action);
  font-weight: 650;
  text-decoration: none;
}
.forgot-link,
.text-action { font-size: .875rem; }
.forgot-link:hover,
.text-action:hover,
.login-footer a:hover { text-decoration: underline; }
.text-action:disabled { cursor: wait; opacity: .6; text-decoration: none; }

.signin-content h1:focus { outline: none; }

.signin-intro {
  margin: -18px 0 28px;
  color: var(--login-muted);
  font-size: .875rem;
  line-height: 1.5;
}
.signin-intro strong {
  color: var(--login-ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}

/* Live sign-in status: direct problem and next step, plain text only. */
.signin-feedback.has-status { margin: -10px 0 22px; }
.signin-status {
  margin: 0;
  color: var(--login-muted);
  font-size: .875rem;
  line-height: 1.5;
}
.signin-status.is-error { color: #9f2525; }
.signin-status.is-ok { color: #17613b; }
.signin-feedback .text-action { margin-top: 6px; }

.btn-login {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  border: 0;
  border-radius: 9px;
  background: var(--login-action);
  box-shadow: 0 4px 12px rgba(23, 107, 163, .18);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  transition: background .2s, box-shadow .2s;
}
.btn-login:hover {
  background: var(--login-action-hover);
  box-shadow: 0 5px 14px rgba(23, 107, 163, .24);
}
.btn-login:disabled { cursor: wait; opacity: .75; }

.forgot-link:focus-visible,
.text-action:focus-visible,
.login-footer a:focus-visible,
.btn-login:focus-visible {
  outline: 3px solid var(--login-focus);
  outline-offset: 3px;
}

.login-footer {
  margin-top: 25px;
  color: var(--login-muted);
  font-size: .875rem;
  text-align: center;
}

.signin-legal {
  align-self: center;
  margin-top: 28px;
  color: var(--login-muted);
  font-size: .75rem;
  text-align: center;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  opacity: 1;
  transition: opacity .45s ease;
}
.loading-overlay.fade-out { opacity: 0; pointer-events: none; }
.loading-logo-img {
  display: block;
  width: 420px;
  max-width: 72vw;
  height: auto;
  opacity: 0;
  animation: lnrLogoCycle 1.8s ease forwards;
}
.loading-overlay.initial-auth-check .loading-logo-img {
  opacity: 1;
  animation: none;
}
@keyframes lnrLogoCycle {
  0%   { opacity: 0; transform: scale(.96); }
  28%  { opacity: 1; transform: scale(1); }
  72%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.02); }
}

@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .welcome-panel { min-height: 220px; padding: 18px 24px 24px; }
  .brand-logo { width: 205px; }
  .signin-panel { min-height: 0; padding: 32px 24px 24px; }
  .signin-content { margin: 0 auto; }
  .signin-legal { margin-top: 40px; }
}

@media (max-width: 380px) {
  .welcome-panel { padding: 16px 20px 22px; }
  .signin-panel { padding: 28px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-photo { transition: none; }
}
