/* Login & password reset pages — isolated from app shell to prevent layout conflicts */

.login-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--auth-root-bg);
  -webkit-font-smoothing: antialiased;
}

/* Force partner-style light auth surface */
.login-page.login-page--light,
html:not(.dark) .login-page {
  color: #0f172a;
  background: #ffffff;
}

.login-page.login-page--light .login-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.login-page.login-page--light .login-card__title,
.login-page.login-page--light .login-page__aside-title {
  color: #0f2744;
}

.login-page.login-page--light .login-page__aside-title {
  font-family: "Times New Roman", Times, Georgia, serif;
}

.login-page.login-page--light .login-card__subtitle,
.login-page.login-page--light .login-page__aside-tagline,
.login-page.login-page--light .login-field__label {
  color: #64748b;
}

.login-page *,
.login-page *::before,
.login-page *::after {
  box-sizing: border-box;
}

.login-page__viewport {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-page__layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  width: 100%;
  max-width: 1040px;
}

.login-page__aside {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  padding: 12px 8px;
  max-width: 420px;
}

.login-page__aside-title {
  margin: 0;
  font-family: "Times New Roman", Times, Georgia, serif;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--auth-brand-title);
  line-height: 1.2;
}

.login-page__aside-tagline {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--auth-subtitle);
}

.login-page__features {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-page__features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--auth-features);
}

.login-page__features li::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 183, 167, 0.2);
}

.login-card {
  width: 95%;
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 28px 28px;
  border-radius: 18px;
  border: 1px solid var(--auth-panel-card-border);
  background: var(--auth-panel-card-bg);
  box-shadow: var(--auth-panel-card-shadow);
  backdrop-filter: blur(16px);
}

.login-card__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  margin-bottom: 28px;
}

.login-card__brand .brand-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 auto;
}

.login-card__brand .brand-logo__img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(280px, 92vw);
  max-height: 120px;
  object-fit: contain;
}

.login-card__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--auth-brand-title);
  line-height: 1.25;
}

.login-card__subtitle {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--auth-subtitle);
  max-width: 32ch;
}

.login-card__alert {
  margin-bottom: 20px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.login-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin: 0;
}

.login-field__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-field-label);
  line-height: 1.35;
}

.login-card .input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font-size: 1rem;
  line-height: 1.4;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

html.dark .login-card .input {
  background: rgba(2, 6, 23, 0.45);
}

.login-card .input:focus {
  outline: none;
  border-color: rgba(37, 183, 167, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 183, 167, 0.18);
}

.login-card .input--error {
  border-color: rgba(220, 38, 38, 0.55);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.login-card .field-error {
  font-size: 0.8rem;
  color: var(--error-text);
  line-height: 1.35;
}

.login-card .input.text-center {
  text-align: center;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 0.9rem;
  color: var(--auth-subtitle);
  cursor: pointer;
  user-select: none;
}

.login-remember input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.login-card .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  margin-top: 4px;
}

.login-card__footer {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  line-height: 1.55;
  text-align: center;
  color: var(--auth-footer-note);
}

.login-card__footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.login-card__footer a:hover {
  text-decoration: underline;
}

.login-card .alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.login-card .alert p {
  margin: 0;
}

.login-card .alert p + p {
  margin-top: 6px;
}

.login-card__brand > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

/* Desktop: brand panel + login card */
@media (min-width: 900px) {
  .login-page__layout {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 56px;
  }

  .login-page__aside {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
  }

  .login-card {
    flex: 0 0 460px;
    width: 460px;
    max-width: 460px;
    padding: 40px 36px 32px;
  }

  .login-card__brand .brand-logo__img {
    max-width: min(280px, 92vw);
    max-height: 120px;
  }
}

@media (min-width: 1024px) {
  .login-card {
    flex: 0 0 480px;
    width: 480px;
    max-width: 480px;
  }
}

@media (max-width: 399px) {
  .login-page__viewport {
    padding: 12px;
  }

  .login-card {
    width: 100%;
    padding: 24px 18px 22px;
  }
}

.login-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--auth-subtitle);
  cursor: pointer;
}

.login-remember input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent, #0d9488);
}

.login-forgot-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent, #0d9488);
  text-decoration: none;
}

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

.login-remember-hint {
  margin: -0.25rem 0 0.85rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--auth-subtitle, #64748b);
}

.login-status {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  background: color-mix(in srgb, var(--accent, #0d9488) 12%, transparent);
  color: var(--text);
  margin-bottom: 1rem;
}

.login-card--narrow {
  max-width: 440px;
  width: 100%;
}

.login-dev-link a {
  color: var(--accent, #0d9488);
  font-weight: 600;
  word-break: break-all;
}
