/*
   IAM sign-in screens: Login, OTP verification and Forgot Password.

   One split card - a softly tinted brand panel beside a white form - in the same visual language as
   the rest of the platform: compact, low-contrast, colour only in tints, icon tiles and borders.
   Everything is scoped under .iamauth and these pages load this file themselves, so nothing here can
   reach another screen.
*/

.iamauth {
  --ia-primary: #6366c9;
  --ia-ink: #2f3349;
  --ia-muted: #8592a3;
  --ia-border: #e7e9f0;
  --ia-surface: #fff;
  --ia-radius: 14px;
  --ia-navy: #15294b;  /* brand navy and gold, taken from the iPULSE logo */
  --ia-gold: #b8913f;

  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #f4f5fd 0%, #f8f7fd 45%, #fbfcff 100%);
}

.iamauth * { box-sizing: border-box; }

/* ------------------------------------------------------------------ the card ------- */

.iamauth .ia-card {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  background: var(--ia-surface);
  border: 1px solid #e6e8fa;
  border-radius: var(--ia-radius);
  box-shadow: 0 1.5rem 3rem rgba(47, 51, 73, .08);
}

/* A narrow card for the short forms (OTP, password reset). */
.iamauth .ia-card.is-single { grid-template-columns: 1fr; width: min(460px, 100%); }

/* ------------------------------------------------------------------ brand panel ---- */

.iamauth .ia-brand {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2.5rem 2.25rem;
  background: linear-gradient(160deg, #f3f4ff 0%, #f7f5fd 55%, #fafbff 100%);
  border-right: 1px solid #eceefb;
}

.iamauth .ia-logo img { display: block; max-width: 340px; width: 100%; height: auto; }

.iamauth .ia-brand-title {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ia-navy);
}

.iamauth .ia-brand-lead {
  margin: .5rem 0 0;
  font-size: .875rem;
  line-height: 1.6;
  color: var(--ia-muted);
}

/* Applications on the platform: small gold-dotted chips. */
.iamauth .ia-apps-label {
  margin: 0 0 .6rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ia-gold);
}

.iamauth .ia-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }

.iamauth .ia-chips li {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ia-navy);
  background: #fff;
  border: 1px solid var(--ia-border);
  border-radius: 999px;
}

.iamauth .ia-chips li::before {
  content: "";
  width: .375rem;
  height: .375rem;
  border-radius: 50%;
  background: var(--ia-gold);
}

.iamauth .ia-chips li.is-more {
  color: #8a6a26;
  background: transparent;
  border: 1px dashed color-mix(in srgb, var(--ia-gold) 60%, #fff);
}

.iamauth .ia-chips li.is-more::before { display: none; }

.iamauth .ia-points { list-style: none; margin: auto 0 0; padding: 0; display: grid; gap: .85rem; }

.iamauth .ia-points li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: .8125rem;
  color: var(--ia-ink);
}

.iamauth .ia-points i {
  flex: 0 0 1.75rem;
  height: 1.75rem;
  border-radius: .5rem;
  display: grid;
  place-items: center;
  font-size: .95rem;
  color: var(--ia-primary);
  background: #e8e9fb;
}

.iamauth .ia-points span { color: var(--ia-muted); display: block; font-size: .75rem; }
.iamauth .ia-points strong { display: block; font-weight: 600; }

/* ------------------------------------------------------------------ form side ------ */

/* min-width:0 is load-bearing: a grid item refuses to shrink below its content's intrinsic width,
   so without it the six OTP boxes and the step strip push out past the card's edge. */
.iamauth .ia-form-side {
  min-width: 0;
  padding: 2.5rem 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.iamauth .ia-form-side > div { min-width: 0; }

.iamauth .ia-head-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: .7rem;
  display: grid;
  place-items: center;
  margin-bottom: .9rem;
  font-size: 1.3rem;
  color: var(--ia-primary);
  background: #e8e9fb;
}

.iamauth .ia-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.35; /* the theme gives headings a very tall line-height */
  font-weight: 600;
  color: var(--ia-ink);
}

.iamauth .ia-lead {
  margin: .25rem 0 1.5rem;
  font-size: .8125rem;
  color: var(--ia-muted);
}

.iamauth .ia-field { margin-bottom: 1.1rem; }

.iamauth .ia-label {
  display: block;
  margin-bottom: .35rem;
  font-size: .78rem;
  font-weight: 500;
  color: var(--ia-ink);
}

.iamauth .ia-input-wrap { position: relative; display: block; }

.iamauth .ia-input-wrap > .bx {
  position: absolute;
  top: 50%;
  left: .85rem;
  transform: translateY(-50%);
  font-size: 1.05rem;
  color: var(--ia-muted);
  pointer-events: none;
}

.iamauth .ia-input-wrap .form-control,
.iamauth .ia-input-wrap .form-select {
  height: 2.75rem;
  padding-left: 2.5rem;
  font-size: .875rem;
  color: var(--ia-ink);
  background-color: #fff;
  border: 1px solid var(--ia-border);
  border-radius: .55rem;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.iamauth .ia-input-wrap .form-control:focus,
.iamauth .ia-input-wrap .form-select:focus {
  border-color: color-mix(in srgb, var(--ia-primary) 55%, #fff);
  box-shadow: 0 0 0 .18rem rgba(99, 102, 201, .13);
}

.iamauth .ia-input-wrap .form-control::placeholder { color: #b6bdcc; }

.iamauth .ia-toggle {
  position: absolute;
  top: 50%;
  right: .5rem;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: .4rem;
  background: none;
  color: var(--ia-muted);
  cursor: pointer;
}

.iamauth .ia-toggle:hover { color: var(--ia-primary); background: #f3f4fb; }

.iamauth .ia-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
  font-size: .8125rem;
}

.iamauth .ia-row .form-check-label { font-size: .8125rem; color: var(--ia-muted); }

.iamauth .ia-link {
  color: var(--ia-primary);
  font-size: .8125rem;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
}

.iamauth .ia-link:hover { text-decoration: underline; }

.iamauth .ia-submit {
  width: 100%;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 0;
  border-radius: .55rem;
  font-size: .9rem;
  font-weight: 500;
  color: #fff;
  background: var(--ia-primary);
  transition: background-color .15s ease, box-shadow .15s ease;
}

.iamauth .ia-submit:hover:not(:disabled) { background: #5457bd; box-shadow: 0 .4rem .9rem rgba(99, 102, 201, .25); }
.iamauth .ia-submit:disabled { opacity: .75; cursor: default; }

.iamauth .ia-submit-ghost {
  width: 100%;
  height: 2.6rem;
  margin-top: .6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 1px solid var(--ia-border);
  border-radius: .55rem;
  font-size: .85rem;
  color: var(--ia-ink);
  background: #fff;
}

.iamauth .ia-submit-ghost:hover { border-color: #d5d8e6; background: #fafbfd; }

.iamauth .ia-foot {
  margin: 1.5rem 0 0;
  text-align: center;
  font-size: .75rem;
  color: var(--ia-muted);
}

/* ------------------------------------------------------------------ messages ------- */

.iamauth .ia-alert {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .7rem .85rem;
  margin-bottom: 1.25rem;
  font-size: .8125rem;
  border-radius: .55rem;
}

.iamauth .ia-alert .bx { font-size: 1.05rem; margin-top: .05rem; }
.iamauth .ia-alert.is-error { color: #a13d3d; background: #fdf3f3; border: 1px solid #f3dcdc; }
.iamauth .ia-alert.is-ok { color: #2f6b45; background: #f0f8f3; border: 1px solid #d3eadb; }
.iamauth .ia-alert.is-info { color: #3f5f7f; background: #f1f7fd; border: 1px solid #d9e8f7; }

/* ------------------------------------------------------------------ OTP boxes ------ */

/* Six boxes that write into the single hidden field the page already posts. */
.iamauth .ia-otp {
  display: flex;
  gap: .5rem;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.iamauth .ia-otp input {
  flex: 1 1 0;
  min-width: 0;
  height: 3rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ia-ink);
  border: 1px solid var(--ia-border);
  border-radius: .55rem;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.iamauth .ia-otp input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--ia-primary) 55%, #fff);
  box-shadow: 0 0 0 .18rem rgba(99, 102, 201, .13);
}

.iamauth .ia-otp input.is-filled { border-color: #c9cbee; background: #fbfbff; }

.iamauth .ia-otp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  font-size: .78rem;
  color: var(--ia-muted);
}

.iamauth .ia-verified {
  display: grid;
  place-items: center;
  gap: .5rem;
  padding: .5rem 0 1.25rem;
  text-align: center;
}

.iamauth .ia-verified i {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: #3f9a6b;
  background: #edf7f1;
}

.iamauth .ia-verified strong { font-size: .95rem; font-weight: 600; color: var(--ia-ink); }

.iamauth .ia-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem .5rem;
  margin-bottom: 1.25rem;
  font-size: .72rem;
  color: var(--ia-muted);
}

.iamauth .ia-step {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
}

.iamauth .ia-steps .ia-step-line { min-width: 1rem; }

.iamauth .ia-step b {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .68rem;
  font-weight: 600;
  color: var(--ia-muted);
  background: #eef0f5;
}

.iamauth .ia-step.is-done b { color: #fff; background: #3f9a6b; }
.iamauth .ia-step.is-current b { color: #fff; background: var(--ia-primary); }
.iamauth .ia-step.is-current { color: var(--ia-ink); font-weight: 500; }
.iamauth .ia-steps .ia-step-line { flex: 1 1 auto; height: 1px; background: var(--ia-border); }

/* ------------------------------------------------------------------ responsive ----- */

@media (max-width: 767.98px) {
  .iamauth { padding: 1rem; }
  .iamauth .ia-card { grid-template-columns: 1fr; }
  .iamauth .ia-brand { display: none; }
  .iamauth .ia-form-side { padding: 2rem 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .iamauth * { transition: none !important; animation: none !important; }
}
