/* KodexCRM auth card — reference signup layout with Kodex tokens
   Stage (atmosphere) + centered white card: form left | visual right */

html.kodex-ds:has(body.kds-auth-card-page),
html.kodex-ds:has(body.login_admin),
html.kodex-ds:has(body.customers.login),
html.kodex-ds:has(body.customers.register),
html.kodex-ds:has(body.authentication),
html.kodex-ds:has(body.forgot-password) {
  --kpf-auth-ink: #0a0c14;
  --kpf-auth-navy: #001028;
  --kpf-auth-cobalt: var(--kodex-action-primary, #001bff);
  --kpf-auth-cobalt-soft: #3d5afe;
  --kpf-auth-card: var(--kodex-bg-surface, #ffffff);
  --kpf-auth-radius: var(--kodex-radius-md, 4px);
  --kpf-auth-font-display: var(--kodex-font-display, "Neue Haas Grotesk Display", "Satoshi", system-ui, sans-serif);
  --kpf-auth-font-body: var(--kodex-font-body, "Satoshi", system-ui, sans-serif);
}

/* Full-bleed atmosphere (replaces orange canvas from the reference) */
body.login_admin,
body.customers.login,
body.customers_login,
body.customers.register,
body.authentication,
body.forgot-password,
body.tw-bg-neutral-100.authentication,
body.kds-auth-card-page {
  position: relative !important;
  min-height: 100vh !important;
  margin: 0 !important;
  background: var(--kpf-auth-ink, #0a0c14) !important;
  overflow-x: hidden !important;
  font-family: var(--kpf-auth-font-body) !important;
}

body.login_admin::before,
body.customers.login::before,
body.customers_login::before,
body.customers.register::before,
body.authentication::before,
body.forgot-password::before,
body.tw-bg-neutral-100.authentication::before,
body.kds-auth-card-page::before {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 40%, color-mix(in srgb, var(--kpf-auth-cobalt, #001bff) 55%, transparent) 0%, transparent 42%),
    radial-gradient(circle at 70% 60%, color-mix(in srgb, var(--kpf-auth-cobalt-soft, #3d5afe) 40%, transparent) 0%, transparent 38%),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--kpf-auth-navy, #001028) 80%, #0a0c14) 0%, #0a0c14 70%);
  animation: kpf-auth-orbit 28s linear infinite;
  will-change: transform;
}

body.login_admin::after,
body.customers.login::after,
body.customers.register::after,
body.authentication::after,
body.forgot-password::after,
body.tw-bg-neutral-100.authentication::after,
body.kds-auth-card-page::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
}

@keyframes kpf-auth-orbit {
  0% { transform: rotate(0deg) scale(1.05); }
  50% { transform: rotate(180deg) scale(1.12); }
  100% { transform: rotate(360deg) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  body.login_admin::before,
  body.customers.login::before,
  body.customers.register::before,
  body.authentication::before,
  body.forgot-password::before,
  body.kds-auth-card-page::before {
    animation: none !important;
  }
}

body.login_admin > *,
body.customers.login > *,
body.customers.register > *,
body.authentication > *,
body.forgot-password > *,
body.kds-auth-card-page > * {
  position: relative;
  z-index: 2;
}

/* Kill legacy Perfex chrome + old split-fixed auth when card page is active */
body.kds-auth-card-page.login_admin #header,
body.kds-auth-card-page .navbar,
body.kds-auth-card-page footer,
body.customers.login.kds-auth-card-page .navbar,
body.customers.login.kds-auth-card-page footer,
body.customers_login.kds-auth-card-page .navbar,
body.customers_login.kds-auth-card-page footer {
  display: none !important;
}

body.customers.login.kds-auth-card-page #wrapper,
body.customers.login.kds-auth-card-page .content,
body.customers.login.kds-auth-card-page .container,
body.customers_login.kds-auth-card-page #wrapper,
body.customers_login.kds-auth-card-page .content,
body.customers_login.kds-auth-card-page .container,
body.kds-auth-card-page #wrapper,
body.kds-auth-card-page #content,
body.kds-auth-card-page .content,
body.kds-auth-card-page .container {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 100vh !important;
  height: auto !important;
  max-height: none !important;
  background: transparent !important;
  display: block !important;
  overflow: visible !important;
}

/* Client login: collapse theme row wrappers so the auth card is full-bleed like admin */
body.kds-auth-card-page #wrapper > #content > .container > .row,
body.customers.login.kds-auth-card-page #wrapper > #content > .container > .row {
  margin: 0 !important;
  display: block !important;
  width: 100% !important;
  max-width: none !important;
}

body.kds-auth-card-page .kds-insp-auth,
body.kds-auth-card-page .kds-insp-auth__side,
body.kds-auth-card-page .kds-insp-auth__form {
  all: unset;
}

/* —— Stage: fill the viewport —— */
.kds-auth-stage {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.kds-auth-stage__legal {
  display: none;
}

.kds-auth-card__legal {
  margin: auto 0 0;
  padding: 16px 24px 20px;
  text-align: center;
  font-size: 11px;
  line-height: 1.4;
  color: #001bff;
  font-family: var(--kpf-auth-font-body, "Satoshi", system-ui, sans-serif);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

/* —— White card: full-bleed split —— */
.kds-auth-card {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--kpf-auth-card, #fff);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  border: 0;
}

/* Left: form — app-style column, vertically centered */
.kds-auth-card__form {
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-content: safe center;
  align-items: center;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  overflow-y: auto;
  background: var(--kodex-bg-surface, #fff);
  color: var(--kodex-text-primary, #14141a);
  box-sizing: border-box;
}

.kds-auth-card__form-inner {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: clamp(28px, 5vh, 56px) clamp(28px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
}

.kds-auth-card__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.kds-auth-card__mark {
  width: 36px;
  height: 36px;
  border-radius: var(--kpf-auth-radius, 4px);
  background: var(--kpf-auth-cobalt, #001bff);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.kds-auth-card__mark img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.kds-auth-card__brand-name {
  font-family: var(--kpf-auth-font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--kodex-text-primary, #14141a);
}

.kds-auth-card__tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--kodex-border-default, #d3d6e0);
  border-radius: var(--kpf-auth-radius, 4px);
  background: var(--kodex-bg-subtle, #f5f5f5);
}

.kds-auth-card__tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--kodex-text-muted, #6e7180);
  font-family: var(--kpf-auth-font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 3px;
  cursor: pointer;
}

.kds-auth-card__tab.is-active,
.kds-auth-card__tab[aria-selected='true'] {
  background: #fff;
  color: var(--kodex-text-primary, #14141a);
  font-weight: 600;
  box-shadow: var(--kodex-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.06));
}

.kds-auth-card__panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.kds-auth-card__panel.is-active {
  display: flex;
}

.kds-auth-card__panel[hidden] {
  display: none !important;
}

.kds-auth-card__header h1 {
  margin: 0;
  font-family: var(--kpf-auth-font-display);
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--kodex-text-primary, #14141a);
}

.kds-auth-card__header p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--kodex-text-muted, #6e7180);
  max-width: 36ch;
}

.kds-auth-card__fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.kds-auth-card__field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.kds-auth-card__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--kodex-text-secondary, #40424d);
  min-width: 0;
}

.kds-auth-card__field input,
.kds-auth-card__field select,
.kds-auth-card__pw {
  min-height: 44px;
  border-radius: var(--kodex-input-radius, var(--kpf-auth-radius, 4px));
  border: 1px solid var(--kodex-border-default, #d3d6e0);
  background: var(--kodex-bg-surface, #fff);
  color: var(--kodex-text-primary, #14141a);
  font-family: var(--kpf-auth-font-body);
  font-size: 14px;
  font-weight: 400;
  padding: 0 14px;
  width: 100%;
  box-sizing: border-box;
}

.kds-auth-card__field input:focus,
.kds-auth-card__field select:focus,
.kds-auth-card__pw:focus-within {
  outline: none;
  border-color: var(--kpf-auth-cobalt, #001bff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kpf-auth-cobalt, #001bff) 16%, transparent);
}

.kds-auth-card__pw {
  display: flex;
  align-items: center;
  padding-right: 8px;
  gap: 4px;
}

.kds-auth-card__pw input {
  border: 0;
  background: transparent;
  box-shadow: none !important;
  padding: 0;
  min-height: 42px;
  flex: 1;
}

.kds-auth-card__pw button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--kodex-text-muted, #6e7180);
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--kpf-auth-radius, 4px);
}

.kds-auth-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.kds-auth-card__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--kodex-text-secondary, #40424d);
  cursor: pointer;
}

.kds-auth-card__check input {
  width: 16px;
  height: 16px;
  accent-color: var(--kpf-auth-cobalt, #001bff);
}

.kds-auth-card__link,
.kds-auth-card__link-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--kpf-auth-cobalt, #001bff);
  text-decoration: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.kds-auth-card__link:hover,
.kds-auth-card__link-btn:hover {
  color: var(--kodex-action-primary-hover, #0015cc);
  text-decoration: underline;
}

.kds-auth-card__submit {
  appearance: none;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: var(--kpf-auth-radius, 4px);
  background: linear-gradient(
    90deg,
    var(--kpf-auth-cobalt, #001bff) 0%,
    color-mix(in srgb, var(--kpf-auth-cobalt, #001bff) 72%, #fff) 100%
  );
  color: var(--kodex-action-primary-fg, #fff);
  font-family: var(--kpf-auth-font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--kpf-auth-cobalt, #001bff) 28%, transparent);
}

.kds-auth-card__submit:hover {
  background: linear-gradient(
    90deg,
    var(--kodex-action-primary-hover, #0015cc) 0%,
    var(--kpf-auth-cobalt, #001bff) 100%
  );
}

.kds-auth-card__or {
  display: grid;
  place-items: center;
  position: relative;
  margin: 2px 0;
  color: var(--kodex-text-muted, #6e7180);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.kds-auth-card__or::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: var(--kodex-border-subtle, #edeff7);
}

.kds-auth-card__or span {
  position: relative;
  padding: 0 10px;
  background: var(--kodex-bg-surface, #fff);
}

.kds-auth-card__social {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.kds-auth-card__social button {
  appearance: none;
  min-height: 44px;
  border-radius: var(--kpf-auth-radius, 4px);
  border: 1px solid var(--kodex-border-default, #d3d6e0);
  background: var(--kodex-bg-surface, #fff);
  color: var(--kodex-text-primary, #14141a);
  cursor: not-allowed;
  display: grid;
  place-items: center;
  opacity: 0.7;
}

.kds-auth-card__foot {
  margin: 4px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--kodex-text-muted, #6e7180);
}

.kds-auth-card__error {
  margin: 0;
  color: var(--kodex-feedback-error, #c41e3a);
  font-size: 13px;
}

.kds-auth-card__gate {
  padding: 16px;
  border: 1px solid var(--kodex-border-default, #d3d6e0);
  border-radius: var(--kpf-auth-radius, 4px);
  background: var(--kodex-bg-subtle, #f5f5f5);
  font-size: 14px;
  color: var(--kodex-text-secondary, #40424d);
}

.kds-auth-card__gate a {
  color: var(--kpf-auth-cobalt, #001bff);
  font-weight: 600;
}

/* Right: visual / testimonial — inset curved media, carousel inside */
.kds-auth-card__visual {
  position: relative;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 100%;
  height: 100%;
  background: var(--kodex-bg-surface, #fff);
  box-sizing: border-box;
}

.kds-auth-card__visual-media {
  position: relative;
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  clip-path: inset(0 round 16px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 24px 64px;
  min-height: 0;
  height: 100%;
  background: #05070e;
  color: #fff;
  isolation: isolate;
  box-sizing: border-box;
}

/* Color morph — brand blues shift (no orbital spin) */
.kds-auth-card__visual-media::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 20% 25%, color-mix(in srgb, #001bff 72%, #000) 0%, transparent 55%),
    radial-gradient(ellipse 80% 65% at 85% 75%, color-mix(in srgb, #3d5afe 65%, #000) 0%, transparent 50%),
    radial-gradient(ellipse 70% 55% at 55% 50%, color-mix(in srgb, #0015cc 70%, #000) 0%, transparent 55%),
    linear-gradient(160deg, #05070e 0%, #001028 50%, color-mix(in srgb, #001bff 45%, #000) 130%);
  background-size: 160% 160%, 160% 160%, 140% 140%, 100% 100%;
  background-position: 0% 0%, 100% 100%, 50% 50%, 0 0;
  animation: kpf-auth-color-morph 9s ease-in-out infinite;
  will-change: background-position, filter;
  opacity: 0.88;
}

/* Heavy film grain (static) */
.kds-auth-card__visual-media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 128 128' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.25' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n2)' opacity='1'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n3'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n3)' opacity='0.9'/%3E%3C/svg%3E");
  background-size: 160px 160px, 80px 80px, 48px 48px;
  opacity: 0.85;
  mix-blend-mode: overlay;
  animation: none;
}

@keyframes kpf-auth-color-morph {
  0% {
    background-position: 0% 15%, 100% 85%, 45% 55%, 0 0;
    filter: hue-rotate(0deg) saturate(1.1) brightness(0.82);
  }
  25% {
    background-position: 35% 45%, 60% 15%, 70% 25%, 0 0;
    filter: hue-rotate(-10deg) saturate(1.25) brightness(0.9);
  }
  50% {
    background-position: 85% 10%, 10% 75%, 50% 85%, 0 0;
    filter: hue-rotate(14deg) saturate(1.3) brightness(0.95);
  }
  75% {
    background-position: 50% 90%, 35% 20%, 15% 40%, 0 0;
    filter: hue-rotate(-6deg) saturate(1.15) brightness(0.86);
  }
  100% {
    background-position: 0% 15%, 100% 85%, 45% 55%, 0 0;
    filter: hue-rotate(0deg) saturate(1.1) brightness(0.82);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kds-auth-card__visual-media::before {
    animation: none !important;
  }
}

.kds-auth-card__tags,
.kds-auth-card__quote,
.kds-auth-card__carousel {
  position: relative;
  z-index: 2;
}

.kds-auth-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kds-auth-card__tags span {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--kpf-auth-radius, 4px);
  font-size: 12px;
  font-weight: 500;
  background: color-mix(in srgb, #fff 14%, transparent);
  border: 1px solid color-mix(in srgb, #fff 18%, transparent);
  backdrop-filter: blur(8px);
}

.kds-auth-card__quote {
  position: relative;
  z-index: 2;
  margin: 0;
  margin-top: auto;
  padding: 0;
  max-width: 22ch;
  border: 0;
  background: none;
  backdrop-filter: none;
  font-family: var(--kpf-auth-font-body, "Satoshi", system-ui, sans-serif);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #fff;
}

/* Bottom-right of the curved media — same column as the panel */
.kds-auth-card__carousel {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 0;
  width: auto;
  z-index: 3;
}

.kds-auth-card__carousel button {
  width: 36px;
  height: 36px;
  border-radius: var(--kpf-auth-radius, 4px);
  border: 1px solid color-mix(in srgb, #fff 55%, transparent);
  background: #fff;
  color: var(--kodex-text-primary, #14141a);
  display: grid;
  place-items: center;
  cursor: default;
  opacity: 0.92;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

@media (min-width: 1200px) {
  .kds-auth-card__form-inner {
    max-width: 560px;
  }

  .kds-auth-card__header h1 {
    font-size: 36px;
  }

  .kds-auth-card__field input,
  .kds-auth-card__field select,
  .kds-auth-card__pw {
    min-height: 50px;
  }

  .kds-auth-card__submit {
    min-height: 54px;
    font-size: 16px;
  }
}

@media (max-width: 1100px) {
  .kds-auth-card {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }

  .kds-auth-card__form-inner {
    max-width: 440px;
  }
}

/* —— Tablet / mobile: app-style login shell —— */
@media (max-width: 1024px) {
  body.kds-auth-card-page {
    background: #07090f !important;
  }

  .kds-auth-stage {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding: 0;
  }

  .kds-auth-card {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    width: 100%;
    min-height: 100dvh;
    height: auto;
    background: transparent;
  }

  /* App hero — taller strip so the screen feels filled */
  .kds-auth-card__visual {
    display: flex;
    order: 1;
    flex: 0 0 auto;
    height: clamp(180px, 32vh, 280px);
    min-height: 180px;
    max-height: 300px;
    padding: 0;
    background: transparent;
  }

  .kds-auth-card__visual-media {
    border-radius: 0;
    clip-path: none;
    height: 100%;
    min-height: 0;
    padding: 18px 18px 28px;
    justify-content: flex-end;
  }

  .kds-auth-card__quote,
  .kds-auth-card__carousel {
    display: none;
  }

  .kds-auth-card__tags {
    margin-bottom: 0;
  }

  .kds-auth-card__tags span {
    padding: 5px 11px;
    font-size: 11px;
  }

  /* White sheet fills the rest of the viewport */
  .kds-auth-card__form {
    order: 2;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    justify-content: flex-start;
    align-items: stretch;
    background: var(--kodex-bg-surface, #fff);
    border-radius: 20px 20px 0 0;
    margin-top: -18px;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.22);
    z-index: 2;
    overflow: visible;
  }

  .kds-auth-card__form-inner {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    padding: 22px 22px 12px;
    gap: 12px;
  }

  .kds-auth-card__brand {
    justify-content: center;
    width: 100%;
  }

  .kds-auth-card__mark {
    width: 36px;
    height: 36px;
  }

  .kds-auth-card__mark img {
    width: 20px;
    height: 20px;
  }

  .kds-auth-card__brand-name {
    font-size: 16px;
  }

  .kds-auth-card__tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 3px;
    gap: 3px;
    align-self: stretch;
  }

  .kds-auth-card__tab {
    text-align: center;
    padding: 9px 10px;
    font-size: 13px;
    min-height: 40px;
  }

  .kds-auth-card__header {
    text-align: center;
  }

  .kds-auth-card__header h1 {
    font-size: 22px;
  }

  .kds-auth-card__header p {
    margin-left: auto;
    margin-right: auto;
    max-width: 32ch;
    font-size: 13px;
  }

  .kds-auth-card__panel {
    gap: 12px;
  }

  .kds-auth-card__fields {
    gap: 10px;
  }

  .kds-auth-card__field input,
  .kds-auth-card__field select,
  .kds-auth-card__pw {
    min-height: 44px;
    font-size: 16px;
  }

  .kds-auth-card__submit {
    min-height: 48px;
    font-size: 15px;
  }

  .kds-auth-card__social {
    gap: 8px;
  }

  .kds-auth-card__social button {
    min-height: 44px;
  }

  .kds-auth-card__field-row {
    grid-template-columns: 1fr;
  }

  .kds-auth-card__row {
    gap: 8px;
  }

  .kds-auth-card__legal {
    margin-top: 8px;
    padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    color: #001bff;
  }
}

@media (max-width: 640px) {
  .kds-auth-card__visual {
    height: clamp(200px, 34vh, 280px);
    min-height: 200px;
    max-height: 300px;
  }

  .kds-auth-card__form {
    margin-top: -20px;
    border-radius: 22px 22px 0 0;
  }

  .kds-auth-card__form-inner {
    max-width: none;
    padding: 20px 18px 8px;
    gap: 11px;
  }

  .kds-auth-card__header h1 {
    font-size: 20px;
    letter-spacing: -0.03em;
  }

  .kds-auth-card__header p {
    font-size: 12px;
  }

  .kds-auth-card__or {
    margin: 0;
  }

  .kds-auth-card__foot {
    padding-top: 0;
    margin: 0;
  }
}

@media (max-width: 380px) {
  .kds-auth-card__form-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .kds-auth-card__social {
    gap: 6px;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .kds-auth-card__form-inner {
    max-width: 400px;
    padding-top: 24px;
  }

  .kds-auth-card__visual {
    height: clamp(200px, 28vh, 260px);
    min-height: 200px;
  }
}

@media (min-width: 901px) and (max-height: 720px) {
  .kds-auth-card__form {
    justify-content: flex-start;
  }

  .kds-auth-card__form-inner {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .kds-auth-card__visual-media {
    padding: 16px;
  }

  .kds-auth-card__quote {
    font-size: clamp(22px, 2.8vw, 32px);
    max-width: 24ch;
  }
}

/* Forgot / reset / 2FA stock Perfex → same card language */
body.authentication .authentication-form-wrapper,
body.forgot-password .authentication-form-wrapper,
body.kpf-auth-atmosphere .authentication-form-wrapper {
  max-width: 420px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-top: 12vh !important;
}

body.authentication .company-logo img,
body.forgot-password .company-logo img {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

body.authentication h1,
body.forgot-password h1 {
  color: #e8e9ed !important;
}

body.authentication .tw-bg-white,
body.forgot-password .tw-bg-white {
  background: #fff !important;
  border-radius: var(--kpf-auth-radius, 4px) !important;
  border: 1px solid color-mix(in srgb, #fff 30%, transparent) !important;
  box-shadow: var(--kodex-shadow-modal, 0 24px 48px rgba(0, 0, 0, 0.18)) !important;
  padding: 28px !important;
}

body.authentication .form-control,
body.forgot-password .form-control,
body.authentication .btn,
body.forgot-password .btn {
  border-radius: var(--kpf-auth-radius, 4px) !important;
}
