/* =============================================================================
   Temia — Sign-in screen
   -----------------------------------------------------------------------------
   Loaded by login.html after css/common.css. The one screen with no application
   chrome, so it brings its own two-column layout. Everything inside the card —
   fields, labels, buttons — is the shared component set.
   ============================================================================ */

/* =============================================================================
   15. Authentication layout  (login.html only)
   -----------------------------------------------------------------------------
   The one screen in the product that has no sidebar, no topbar and no footer.
   It still speaks the same language as the app: the same tokens, the same card,
   the same `.tm-field` / `.tm-label` / `.tm-control` / `.tm-btn` components,
   the same navy that fills the sidebar on every other page.

   Everything here is namespaced under `.tm-auth`, so this section cannot reach
   any of the application screens — the shared components keep their app
   behaviour everywhere else.
   ============================================================================ */

/* --- Page frame ----------------------------------------------------------- */
.tm-auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
  background: var(--color-secondary-5);
}

@media (min-width: 992px) {
  .tm-auth { grid-template-columns: minmax(0, 44%) minmax(0, 56%); }
}

/* --- Left: brand panel (the sidebar's navy, given room to breathe) --------- */
.tm-auth__brand {
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 40px 32px;
  background: var(--color-secondary-100);
  color: var(--color-white);
}

@media (min-width: 992px) {
  .tm-auth__brand { padding: 48px 56px; }
}

.tm-auth__brand-head { display: flex; align-items: flex-start; gap: 12px; }

.tm-auth__pitch { max-width: 420px; margin-top: auto; }

.tm-auth__pitch-title {
  margin: 0 0 12px;
  font-size: var(--font-size-4xl);
  line-height: var(--line-height-3xl);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-normal);
}

.tm-auth__pitch-text {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-md);
  color: var(--color-secondary-20);
}

.tm-auth__features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 0 auto;
  padding: 0;
  list-style: none;
}

.tm-auth__feature { display: flex; align-items: flex-start; gap: 12px; }

.tm-auth__feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 10%);
  color: var(--color-white);
}

.tm-auth__feature-title {
  display: block;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  font-weight: var(--font-weight-medium);
}

.tm-auth__feature-text {
  display: block;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  color: var(--color-secondary-20);
}

.tm-auth__brand-foot {
  margin-top: auto;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  color: var(--color-secondary-40);
}

/* Below `lg` the panel becomes a compact header strip above the form */
@media (max-width: 991.98px) {
  .tm-auth__brand { gap: 20px; padding: 24px 20px; }
  .tm-auth__pitch-title { font-size: var(--font-size-2xl); line-height: var(--line-height-xl); }
  .tm-auth__features,
  .tm-auth__brand-foot { display: none; }
}

/* --- Right: form panel ---------------------------------------------------- */
.tm-auth__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.tm-auth__card {
  width: 100%;
  max-width: 420px;
  height: auto;                       /* `.tm-card` stretches inside app grids */
}

.tm-auth__card-body { padding: 32px 28px; }

@media (max-width: 575.98px) {
  .tm-auth__panel   { padding: 24px 16px; }
  .tm-auth__card-body { padding: 24px 20px; }
}

/* Which door this is. The landing page sends people to one of two, and the
   chip confirms they arrived at the right one. */
.tm-auth__role {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-secondary-10);
  color: var(--color-secondary-100);
  font-size: var(--font-size-xs);
  line-height: var(--line-height-2xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wider);
  text-transform: uppercase;
}

.tm-auth__role--associate { background: var(--color-primary-10); color: var(--color-primary-100); }

.tm-auth__title {
  margin: 0 0 4px;
  font-size: var(--font-size-2xl);
  line-height: var(--line-height-xl);
  font-weight: var(--font-weight-medium);
  color: var(--color-secondary-100);
}

.tm-auth__subtitle {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-sm);
  color: var(--color-shade-60);
}

.tm-auth__form { display: flex; flex-direction: column; gap: 20px; }

/* Slightly taller controls and buttons than in dense app tables — this screen
   has one job and the touch targets should say so. */
.tm-auth .tm-control { padding-block: 10px; }   /* block-only, so `--lead` / `--trail` keep their inline padding */
.tm-auth .tm-btn--block { padding: 10px 12px; }

/* Remember me / forgot password row */
.tm-auth__options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tm-auth__check { display: flex; align-items: center; gap: 8px; margin: 0; }

.tm-auth__check .form-check-input {
  width: 16px;
  height: 16px;
  margin: 0;
  border-color: var(--color-shade-20);
  border-radius: 3px;
}

.tm-auth__check .form-check-input:checked {
  background-color: var(--color-secondary-80);
  border-color: var(--color-secondary-80);
}

.tm-auth__check .form-check-label {
  font-size: var(--font-size-xs);
  line-height: var(--line-height-2xs);
  color: var(--color-shade-80);
}

.tm-auth__link {
  font-size: var(--font-size-xs);
  line-height: var(--line-height-2xs);
  color: var(--color-primary-80);
  text-decoration: none;
}
.tm-auth__link:hover { color: var(--color-primary-100); text-decoration: underline; }

/* "or" rule between the credential form and the secondary action */
.tm-auth__or {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-2xs);
  color: var(--color-shade-40);
}
.tm-auth__or::before,
.tm-auth__or::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--color-shade-10);
}

.tm-auth__foot {
  margin: 0;
  text-align: center;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-xs);
  color: var(--color-shade-60);
}

/* Validation: Bootstrap's `.was-validated` hook, restyled to the token palette */
.tm-auth .was-validated .tm-control:invalid,
.tm-auth .tm-control.is-invalid { border-color: var(--color-red); }

.tm-auth__error {
  display: none;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-2xs);
  color: var(--color-red);
}
.tm-auth .was-validated .tm-field:has(.tm-control:invalid) .tm-auth__error { display: block; }
