/* K. Patel Group - login styles.
   Self-contained so the login pages render correctly with or without Tabler loaded.
   Tokens follow DESIGN.md section 1.

   One layout: the pigment field covers the whole viewport, the typographic
   statement sits over it on the left and the sign-in content sits in a frosted
   glass card on the right.

   Sections: 1 base, 2 pigment field, 3 left column, 4 glass card, 5 responsive. */

/* ================================================================== *
 * 1. BASE - font, tokens, layout skeleton, controls
 * ================================================================== */

/* Source Sans 3, self hosted as a variable weight file (Latin; Latin Extended
   for accented names). Falls back to Inter and then to the system stack. */
@font-face {
  font-family: 'Source Sans 3 KP';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/assets/fonts/source-sans-3/source-sans-3-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4;
}

@font-face {
  font-family: 'Source Sans 3 KP';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/assets/fonts/source-sans-3/source-sans-3-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.kp-login {
  --kp-login-fg: #CBD5E1;
  --kp-login-muted: #39414F;
  --kp-login-body: #0B1220;
  --kp-accent: #2457D6;

  /* The app's type scale (kp-theme.css), repeated so this page stands alone.
     The statement and the pigment card illustration keep their own sizes. */
  --kp-fs-label: 11px;
  --kp-fs-small: 12px;
  --kp-fs-body: 13px;
  --kp-fs-card: 15px;
  --kp-fs-title: 20px;
  --kp-fs-display: 24px;

  /* Chooser (no portal): a deep indigo ground under a mixed field. */
  --kp-pigment-base: #120F2A;
  --kp-pig-1: #DC2626;
  --kp-pig-2: #2563EB;
  --kp-pig-3: #F97316;
  --kp-pig-4: #14B8A6;
  --kp-pig-5: #9333EA;
  --kp-pig-6: #4F46E5;
  --kp-pig-7: #F472B6;

  /* Documented photo slot: set --kp-login-photo to url("/assets/images/x.jpg")
     on .kp-login and that photograph appears behind the washes. */
  --kp-login-photo: none;
  --kp-login-photo-opacity: .28;

  position: fixed;
  inset: 0;
  display: flex;
  overflow: auto;
  background: var(--kp-pigment-base);
  color: var(--kp-login-body);
  font-family: 'Source Sans 3 KP', Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--kp-fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Manufacturing leans plum, red and orange; trading leans navy, teal and cyan. */
.kp-login[data-portal="manufacturing"] {
  --kp-pigment-base: #1B0B22;
  --kp-pig-1: #E11D1D;
  --kp-pig-2: #EA580C;
  --kp-pig-3: #C81E5A;
  --kp-pig-4: #F59E0B;
  --kp-pig-5: #A21CAF;
  --kp-pig-6: #F97316;
  --kp-pig-7: #F5C518;
}

.kp-login[data-portal="trading"] {
  --kp-pigment-base: #06202B;
  --kp-pig-1: #0F766E;
  --kp-pig-2: #1D4ED8;
  --kp-pig-3: #0EA5E9;
  --kp-pig-4: #14B8A6;
  --kp-pig-5: #4338CA;
  --kp-pig-6: #06B6D4;
  --kp-pig-7: #22D3EE;
}

.kp-login svg { flex: 0 0 auto; }

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

/* ================================================================== *
 * 2. PIGMENT FIELD - the colour composition, full bleed
 * ================================================================== */

/* A stack of soft colour washes over a near black ink base, in the entity
   palette, drifting slowly (stopped under prefers-reduced-motion), with a
   grain overlay so it reads as pigment on paper rather than a gradient.
   Portal pages lean the palette towards their own accent by redefining
   --kp-pig-* above; the markup never changes.

   The composition is weighted to the left: the washes crowd the left two
   thirds where the statement sits, and only their long tails reach the right
   third, which the scrim darkens further so the glass card has a calm,
   lower-contrast ground to sit on. */
.kp-login__aside {
  position: relative;
  z-index: 1;
  flex: 0 0 48%;
  min-width: 0;
  color: var(--kp-login-fg);
}

.kp-pigment {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
  background: var(--kp-pigment-base);
}

.kp-pigment__photo {
  position: absolute;
  inset: 0;
  background-image: var(--kp-login-photo);
  background-size: cover;
  background-position: center;
  opacity: var(--kp-login-photo-opacity);
  filter: saturate(.7);
}

.kp-pigment__wash {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  mix-blend-mode: screen;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

/* Each wash is a wide radial: a near solid core, a broad mid band and a long
   tail out to 85%, so the washes meet and the base only survives at the edges
   and in the right third. */
.kp-pigment__wash--a {
  width: 76%; height: 68%; top: -14%; left: -8%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--kp-pig-1) 90%, transparent) 0%, color-mix(in srgb, var(--kp-pig-1) 66%, transparent) 46%, rgba(0, 0, 0, 0) 85%);
  opacity: 1;
  animation: kp-drift-a 72s ease-in-out infinite;
}

.kp-pigment__wash--b {
  width: 88%; height: 70%; top: -18%; left: 16%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--kp-pig-2) 90%, transparent) 0%, color-mix(in srgb, var(--kp-pig-2) 62%, transparent) 46%, rgba(0, 0, 0, 0) 85%);
  opacity: .96;
  animation: kp-drift-b 84s ease-in-out infinite;
}

.kp-pigment__wash--c {
  width: 70%; height: 64%; top: 24%; left: -24%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--kp-pig-3) 90%, transparent) 0%, color-mix(in srgb, var(--kp-pig-3) 66%, transparent) 46%, rgba(0, 0, 0, 0) 85%);
  opacity: .98;
  animation: kp-drift-c 66s ease-in-out infinite;
}

.kp-pigment__wash--d {
  width: 84%; height: 68%; bottom: -24%; left: 12%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--kp-pig-4) 90%, transparent) 0%, color-mix(in srgb, var(--kp-pig-4) 62%, transparent) 46%, rgba(0, 0, 0, 0) 85%);
  opacity: .96;
  animation: kp-drift-d 78s ease-in-out infinite;
}

.kp-pigment__wash--e {
  width: 66%; height: 60%; top: 38%; left: -16%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--kp-pig-5) 90%, transparent) 0%, color-mix(in srgb, var(--kp-pig-5) 66%, transparent) 46%, rgba(0, 0, 0, 0) 85%);
  opacity: .98;
  animation: kp-drift-e 90s ease-in-out infinite;
}

.kp-pigment__wash--f {
  width: 58%; height: 54%; top: 4%; left: 30%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--kp-pig-6) 90%, transparent) 0%, color-mix(in srgb, var(--kp-pig-6) 66%, transparent) 46%, rgba(0, 0, 0, 0) 85%);
  opacity: .94;
  animation: kp-drift-f 60s ease-in-out infinite;
}

/* The bright one: yellow for manufacturing, cyan for trading, pink on the
   chooser. It sits low and to the left of centre, well away from both the
   headline and the glass card. */
.kp-pigment__wash--g {
  width: 56%; height: 50%; bottom: -6%; left: 22%;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--kp-pig-7) 90%, transparent) 0%, color-mix(in srgb, var(--kp-pig-7) 64%, transparent) 46%, rgba(0, 0, 0, 0) 85%);
  opacity: .96;
  animation: kp-drift-g 68s ease-in-out infinite;
}

/* Grain, generated by feTurbulence so no image file is needed. */
.kp-pigment__grain {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  opacity: .32;
  mix-blend-mode: overlay;
}

/* Vignette: edge darkening so the field reads as a lit surface. */
.kp-pigment__vignette {
  position: absolute;
  inset: 0;
  opacity: .5;
  background: radial-gradient(118% 92% at 38% 46%, rgba(0, 0, 0, 0) 44%, rgba(0, 0, 0, .44) 78%, rgba(0, 0, 0, .82) 100%);
}

/* Scrim: keeps the statement readable on the left and pulls the right third
   down to a calmer, darker ground for the glass card. */
.kp-pigment__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, .22) 26%, rgba(0, 0, 0, 0) 52%),
    linear-gradient(270deg, rgba(0, 0, 0, .46) 0%, rgba(0, 0, 0, .22) 24%, rgba(0, 0, 0, 0) 48%),
    radial-gradient(70% 42% at 0% 14%, rgba(0, 0, 0, .46) 0%, rgba(0, 0, 0, .2) 46%, rgba(0, 0, 0, 0) 74%),
    linear-gradient(0deg, rgba(0, 0, 0, .34) 0%, rgba(0, 0, 0, 0) 22%);
}

@keyframes kp-drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
  50% { transform: translate3d(11%, 9%, 0) scale(1.18); opacity: .88; }
}
@keyframes kp-drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.06); opacity: .96; }
  50% { transform: translate3d(-10%, 12%, 0) scale(1); opacity: .86; }
}
@keyframes kp-drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .96; }
  50% { transform: translate3d(14%, -10%, 0) scale(1.16); opacity: .86; }
}
@keyframes kp-drift-d {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.1); opacity: 1; }
  50% { transform: translate3d(-12%, -11%, 0) scale(1); opacity: .88; }
}
@keyframes kp-drift-e {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .92; }
  50% { transform: translate3d(-14%, 8%, 0) scale(1.22); opacity: .82; }
}
@keyframes kp-drift-f {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.08); opacity: .94; }
  50% { transform: translate3d(10%, 14%, 0) scale(.94); opacity: .68; }
}
@keyframes kp-drift-g {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .96; }
  50% { transform: translate3d(-9%, -8%, 0) scale(1.14); opacity: .74; }
}

/* ================================================================== *
 * 3. LEFT COLUMN - brand, statement, tilted colour index card, swatches
 * ================================================================== */

.kp-login__aside-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 44px 48px 30px;
  display: flex;
  flex-direction: column;
}

.kp-login__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kp-login__chip {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .3);
  color: #fff;
  font-weight: 700;
  font-size: var(--kp-fs-card);
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.kp-login__wordmark {
  font-size: var(--kp-fs-title);
  font-weight: 600;
  color: #fff;
  margin: 0;
  letter-spacing: -.01em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .6);
}

.kp-login__aside-body {
  margin-top: auto;
  margin-bottom: auto;
  padding: 28px 0;
}

.kp-login__aside-foot { margin-top: auto; }

.kp-login__aside-footer {
  font-size: var(--kp-fs-small);
  color: rgba(255, 255, 255, .78);
  margin: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}

/* A small chip rather than a bare line of caps, with a dot in the portal
   accent so the eyebrow carries colour too. */
.kp-login__pretitle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 22px;
  padding: 0 11px 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .22);
  font-size: var(--kp-fs-label);
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 600;
  color: rgba(255, 255, 255, .92);
  margin: 0 0 14px;
}

.kp-login__pretitle::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--kp-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--kp-accent) 35%, transparent);
  flex: 0 0 auto;
}

.kp-login__lede {
  font-size: clamp(34px, 3.6vw, 54px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -.028em;
  color: #fff;
  margin: 0;
  max-width: 14ch;
  text-shadow: 0 2px 28px rgba(0, 0, 0, .55), 0 1px 4px rgba(0, 0, 0, .5);
}

/* "pigments" is painted in the field palette. A touch of white is mixed into
   both stops so the word keeps its contrast against the dark corner. */
.kp-login__lede-tint {
  background-image: linear-gradient(94deg,
    color-mix(in srgb, var(--kp-pig-1) 64%, #fff) 0%,
    color-mix(in srgb, var(--kp-pig-7) 80%, #fff) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: none;
}

.kp-login__lede-sub {
  font-size: var(--kp-fs-card);
  line-height: 1.45;
  font-weight: 400;
  color: rgba(255, 255, 255, .86);
  margin: 16px 0 0;
  max-width: 34ch;
  text-shadow: 0 1px 14px rgba(0, 0, 0, .6), 0 1px 3px rgba(0, 0, 0, .45);
}

/* The floating pigment card: a white card of colour index chips, tilted and
   drifting on a long soft shadow. The float lives on the outer element and the
   tilt on the inner one so the two transforms do not fight. */
.kp-pigment-card {
  width: 340px;
  margin: 40px 0 0;
  animation: kp-card-float 12s ease-in-out infinite;
  will-change: transform;
}

.kp-pigment-card__inner {
  transform: rotate(-6deg);
  background: #FCFBF9;
  border-radius: 12px;
  padding: 18px 18px 16px;
  box-shadow:
    0 54px 90px -26px rgba(0, 0, 0, .8),
    0 20px 40px rgba(0, 0, 0, .45),
    inset 0 0 0 1px rgba(255, 255, 255, .8);
}

.kp-pigment-card__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 10px;
}

.kp-chip { display: block; min-width: 0; }

.kp-chip__swatch {
  display: block;
  width: 100%;
  height: 44px;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    inset 0 -3px 6px rgba(0, 0, 0, .26),
    inset 0 0 0 1px rgba(0, 0, 0, .14);
}

.kp-chip__name {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  color: #14181F;
  height: 26px;
  overflow: hidden;
}

.kp-chip__code {
  display: block;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: .04em;
  color: #6B7280;
  font-variant-numeric: tabular-nums;
}

.kp-pigment-card__caption {
  margin: 34px 0 0;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255, 255, 255, .78);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}

@keyframes kp-card-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- entity swatch row ---------- */

.kp-login__swatches {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0 0 16px;
  padding: 0;
}

.kp-swatch {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.kp-swatch__chip {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .24);
}

.kp-swatch__name {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .88);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .8);
}

/* ================================================================== *
 * 4. RIGHT COLUMN - the frosted glass sign-in card
 * ================================================================== */

.kp-login__main {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 32px;
  min-width: 0;
}

.kp-login__panel {
  width: 100%;
  max-width: 440px;
}

/* The glass card. Everything on the right - the sign-in form, the portal
   chooser and the forgot password form - lives inside this one card. */
.kp-login__shell {
  width: 100%;
  background-color: rgba(255, 255, 255, .84);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .55);
  border-top: 4px solid var(--kp-accent);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45);
  color: var(--kp-login-body);
}

/* The card is light in both themes, so its title does not follow the app's
   heading colour, which turns pale in the dark theme. */
.kp-login__title {
  font-size: var(--kp-fs-display);
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 0 0 4px;
  color: var(--kp-login-body);
}

.kp-login__subtitle {
  font-size: var(--kp-fs-body);
  color: var(--kp-login-muted);
  margin: 0 0 22px;
}

/* The same for the password checklist and its note on the reset page. */
.kp-login .kp-password-rules,
.kp-login .kp-field-hint {
  color: var(--kp-login-muted);
}

.kp-login .kp-password-rules li.is-met {
  color: #047857;
}

/* Inside the glass the form block is a plain section, not a second card. */
.kp-login__card {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

/* ---------- portal chooser cards ---------- */

.kp-portal-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out, transform 150ms ease-out;
}

.kp-portal-card:hover {
  border-color: var(--kp-accent);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--kp-accent) 22%, transparent);
  transform: translateY(-2px);
  color: inherit;
  text-decoration: none;
}

.kp-portal-card:focus-visible {
  border-color: var(--kp-accent);
  outline: 2px solid color-mix(in srgb, var(--kp-accent) 40%, transparent);
  outline-offset: 2px;
}

.kp-portal-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(140deg, var(--kp-accent) 0%, color-mix(in srgb, var(--kp-accent) 72%, #0A0C10) 100%);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--kp-accent) 35%, transparent);
  flex: 0 0 auto;
}

.kp-portal-card__icon svg { width: 24px; height: 24px; }

.kp-portal-card__body { display: block; min-width: 0; flex: 1 1 auto; }

.kp-portal-card__name {
  display: block;
  font-size: var(--kp-fs-card);
  font-weight: 600;
  margin: 0 0 2px;
}

.kp-portal-card__entities {
  display: block;
  font-size: var(--kp-fs-body);
  color: var(--kp-login-muted);
  margin: 0;
}

/* The entity colours of that portal, under the entity list line. */
.kp-portal-card__swatches {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}

.kp-portal-card__swatch {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}

.kp-portal-card__chev {
  color: #6B7280;
  align-self: center;
  flex: 0 0 auto;
}

.kp-portal-card__chev svg { width: 20px; height: 20px; }

.kp-login__resume { margin-bottom: 20px; }

.kp-btn-resume {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(15, 23, 42, .14);
  background: rgba(255, 255, 255, .78);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: var(--kp-fs-body);
  font-weight: 500;
  color: var(--kp-login-body);
  cursor: pointer;
}

.kp-btn-resume svg { width: 16px; height: 16px; flex: 0 0 auto; }

.kp-btn-resume:hover { border-color: var(--kp-accent); color: var(--kp-accent); }

.kp-btn-resume:focus-visible,
.kp-login__links a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--kp-accent) 40%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- form controls ---------- */

.kp-login .form-label {
  display: block;
  font-size: var(--kp-fs-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--kp-login-muted);
  margin-bottom: 7px;
}

.kp-login .form-control {
  display: block;
  width: 100%;
  height: 46px;
  padding: 10px 14px;
  font-size: var(--kp-fs-body);
  color: var(--kp-login-body);
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  box-shadow: none;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}

/* Full strength: the app's own placeholder rule fades its colour to 70%. */
.kp-login .form-control::placeholder { color: #666E7C; opacity: 1; }

/* Floating focus ring in the portal accent. */
.kp-login .form-control:focus {
  border-color: var(--kp-accent);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kp-accent) 24%, transparent),
              0 6px 18px color-mix(in srgb, var(--kp-accent) 18%, transparent);
}

.kp-login__field { margin-bottom: 16px; }

.kp-login__pw { position: relative; }

.kp-login__pw .form-control { padding-right: 44px; }

.kp-login__pw-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--kp-login-muted);
  cursor: pointer;
  padding: 0;
}

.kp-login__pw-toggle svg { width: 18px; height: 18px; }
.kp-login__pw-toggle:hover { color: var(--kp-login-body); }

.kp-login .btn-kp-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--kp-accent);
  color: #fff;
  font-size: var(--kp-fs-body);
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: opacity 150ms ease-out, box-shadow 150ms ease-out;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--kp-accent) 30%, transparent);
}

.kp-login .btn-kp-primary:hover { opacity: .94; color: #fff; }
.kp-login .btn-kp-primary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--kp-accent) 40%, transparent);
  outline-offset: 2px;
}
.kp-login .btn-kp-primary:disabled { opacity: .6; cursor: not-allowed; }

.kp-login__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 999px;
  animation: kp-spin 600ms linear infinite;
}

@keyframes kp-spin { to { transform: rotate(360deg); } }

.kp-login__links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  font-size: var(--kp-fs-body);
}

.kp-login__links a {
  color: var(--kp-login-muted);
  text-decoration: none;
  cursor: pointer;
}

.kp-login__links a:hover { color: var(--kp-accent); text-decoration: underline; }

.kp-login .alert {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: var(--kp-fs-body);
  margin-bottom: 16px;
  border: 1px solid #E08A8A;
  background: rgba(253, 241, 241, .92);
  color: #8F1111;
}

/* An inactivity sign out, explained (imports/ui/shell/session.js). */
.kp-login .alert.kp-login__note {
  border-color: color-mix(in srgb, var(--kp-accent, #2457D6) 35%, transparent);
  background: color-mix(in srgb, var(--kp-accent, #2457D6) 8%, rgba(255, 255, 255, .92));
  color: var(--kp-login-body);
}

/* "Keep me signed in" */
.kp-login__remember {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -4px 0 18px;
  padding-left: 0;
  cursor: pointer;
}

.kp-login__remember .form-check-input {
  flex: none;
  float: none;
  margin: 2px 0 0;
  cursor: pointer;
  /* The card is light in both themes, so the empty box is too: the dark
     theme's form surface made it look ticked. */
  background-color: #fff;
  border-color: #E1E4EA;
}

.kp-login__remember .form-check-input:checked {
  background-color: var(--kp-accent);
  border-color: var(--kp-accent);
}

.kp-login__remember .form-check-label {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  font-size: var(--kp-fs-body);
  font-weight: 500;
  color: var(--kp-login-body);
  cursor: pointer;
}

.kp-login__remember-hint {
  display: block;
  margin-top: 2px;
  font-size: var(--kp-fs-small);
  font-weight: 400;
  color: var(--kp-login-muted);
}

/* ---------- division picker ---------- */

.kp-div-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  /* A button does not inherit its text colour: in dark mode the browser's
     own (white) would sit on this light card. The login page is always light. */
  color: var(--kp-login-body);
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}

.kp-div-card:hover {
  border-color: var(--kp-accent);
  box-shadow: 0 0 0 1px var(--kp-accent);
}

.kp-div-card:disabled { opacity: .6; cursor: progress; }

.kp-div-card__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: var(--kp-fs-label);
  font-weight: 600;
  letter-spacing: .03em;
  color: #fff;
  background: var(--kp-accent);
  flex: 0 0 auto;
}

.kp-div-card__logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
  flex: 0 0 auto;
}

.kp-div-card__name {
  display: block;
  font-size: var(--kp-fs-body);
  font-weight: 500;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.kp-div-card__code {
  font-size: var(--kp-fs-small);
  color: var(--kp-login-muted);
}

/* ================================================================== *
 * 5. RESPONSIVE and motion preferences
 * ================================================================== */

/* Wide desktops: the statement gets the larger share. */
@media (min-width: 1200px) {
  .kp-login__aside { flex: 0 0 55%; }
}

@media (max-width: 991.98px) {
  .kp-login { flex-direction: column; position: static; min-height: 100vh; }

  /* The field stays full bleed behind the page; the statement collapses to
     the brand, the eyebrow, the headline and the swatch row. */
  .kp-login__aside { flex: 0 0 auto; }
  .kp-login__aside-inner { padding: 20px 16px; gap: 20px; height: auto; }
  .kp-login__aside-body { padding: 0; margin: 0; }
  .kp-login__lede { font-size: 30px; max-width: 18ch; }
  .kp-login__lede-sub { display: none; }
  .kp-login__pretitle { margin-bottom: 10px; }
  .kp-pigment-card { display: none; }
  .kp-login__aside-foot { margin-top: 0; }
  .kp-login__swatches { gap: 12px; margin-bottom: 10px; }
  .kp-swatch__chip { width: 24px; height: 24px; }
  .kp-swatch__name { font-size: 9px; }

  .kp-login__main { padding: 8px 16px 28px; justify-content: flex-start; }
  .kp-login__shell { padding: 22px 18px; }
}

@media (max-width: 575.98px) {
  .kp-login__links { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Medium heights (laptops, browser chrome eating the viewport): tighten the
   statement and shrink the tilted card so the swatch row always stays in view. */
@media (min-width: 992px) and (max-height: 900px) {
  .kp-login__aside-inner { padding: 32px 44px 24px; }
  .kp-login__aside-body { padding: 16px 0; }
  .kp-login__pretitle { margin-bottom: 10px; }
  .kp-login__lede { font-size: clamp(30px, 3.2vw, 44px); }
  .kp-login__lede-sub { font-size: var(--kp-fs-card); margin-top: 10px; }
  .kp-pigment-card { width: 280px; margin-top: 24px; }
  .kp-pigment-card__inner { padding: 14px 14px 12px; }
  .kp-pigment-card__grid { gap: 8px 8px; }
  .kp-chip__swatch { height: 32px; }
  .kp-chip__name { height: 22px; font-size: 10px; margin-top: 4px; }
  .kp-chip__code { font-size: 9px; }
  .kp-pigment-card__caption { margin-top: 22px; }
  .kp-login__swatches { margin-bottom: 10px; }
  .kp-login__main { padding: 32px 28px; }
}

/* Short viewports: the tilted card would push the swatch row out of view. */
@media (min-width: 992px) and (max-height: 740px) {
  .kp-pigment-card { display: none; }
  .kp-login__aside-inner { padding: 24px 40px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .kp-login * { transition: none !important; animation-duration: 1ms !important; }
  .kp-pigment__wash,
  .kp-pigment,
  .kp-pigment-card { animation: none !important; }
}
