/* KZM auth — login & register */
:root {
  --kzm-auth-blue: #1d6fd8;
  --kzm-auth-blue-deep: #0f4fa8;
  --kzm-auth-cyan: #22d3ee;
  --kzm-auth-ink: #0c1a33;
  --kzm-auth-muted: rgba(12, 26, 51, 0.62);
  --kzm-auth-line: rgba(255, 255, 255, 0.22);
  --kzm-auth-glass: rgba(255, 255, 255, 0.88);
  --kzm-auth-radius: 22px;
  --kzm-auth-font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body.kzm-auth-body {
  margin: 0;
  min-height: 100%;
  font-family: var(--kzm-auth-font);
  color: var(--kzm-auth-ink);
  -webkit-font-smoothing: antialiased;
}

.kzm-auth-body {
  overflow-x: hidden;
}

/* Background scene */
.kzm-auth-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #0a1628;
}

.kzm-auth-scene__photo {
  position: absolute;
  inset: -4%;
  background:
    linear-gradient(115deg, rgba(8, 22, 48, 0.92) 0%, rgba(12, 40, 88, 0.78) 42%, rgba(8, 28, 62, 0.55) 100%),
    url("/assets/bg-1920.webp?v=1") center / cover no-repeat;
  transform: scale(1.04);
  animation: kzm-auth-kenburns 28s ease-in-out infinite alternate;
}

.kzm-auth-scene__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 520px at 12% 18%, rgba(34, 211, 238, 0.22), transparent 58%),
    radial-gradient(760px 480px at 88% 12%, rgba(59, 130, 246, 0.28), transparent 55%),
    radial-gradient(640px 400px at 50% 100%, rgba(99, 102, 241, 0.18), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.9;
}

.kzm-auth-scene__grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.kzm-auth-scene__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: kzm-auth-float 14s ease-in-out infinite;
}

.kzm-auth-scene__orb--1 {
  width: 340px;
  height: 340px;
  left: -80px;
  top: 20%;
  background: rgba(34, 211, 238, 0.35);
}

.kzm-auth-scene__orb--2 {
  width: 280px;
  height: 280px;
  right: 8%;
  top: 8%;
  background: rgba(96, 165, 250, 0.4);
  animation-delay: -4s;
}

.kzm-auth-scene__orb--3 {
  width: 220px;
  height: 220px;
  right: 30%;
  bottom: 6%;
  background: rgba(129, 140, 248, 0.32);
  animation-delay: -8s;
}

@keyframes kzm-auth-kenburns {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(-1%, -1%, 0); }
}

@keyframes kzm-auth-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(12px, -18px, 0); }
}

.kzm-auth-home {
  position: fixed;
  z-index: 20;
  top: 20px;
  left: 24px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s ease, transform 0.15s ease;
}

.kzm-auth-home:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.kzm-auth-home img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.kzm-auth-main {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 88px 20px 32px;
}

.kzm-auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 0;
  width: min(1040px, 100%);
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: kzm-auth-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.kzm-auth-shell--wide {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 520px);
  width: min(1120px, 100%);
}

@keyframes kzm-auth-rise {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Brand panel */
.kzm-auth-brand {
  position: relative;
  padding: 40px 36px;
  background:
    linear-gradient(165deg, rgba(15, 79, 168, 0.94) 0%, rgba(8, 40, 92, 0.88) 55%, rgba(6, 28, 62, 0.92) 100%);
  color: #fff;
  overflow: hidden;
}

.kzm-auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.14), transparent 45%),
    radial-gradient(circle at 100% 80%, rgba(34, 211, 238, 0.2), transparent 50%);
  pointer-events: none;
}

.kzm-auth-brand__inner {
  position: relative;
  z-index: 1;
  max-width: 380px;
}

.kzm-auth-brand__eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.kzm-auth-brand__title {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-wrap: balance;
}

.kzm-auth-brand__title-main {
  font-size: clamp(32px, 3.6vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.kzm-auth-brand__title-sub {
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.88);
  max-width: 18ch;
}

.kzm-auth-brand__lead {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
}

.kzm-auth-brand__features {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kzm-auth-brand__features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.kzm-auth-brand__ico {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #a5f3fc;
}

.kzm-auth-brand__ico svg {
  width: 18px;
  height: 18px;
}

/* Form card */
.kzm-auth-card {
  padding: 36px 32px 30px;
  background: var(--kzm-auth-glass);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.kzm-auth-card__head {
  margin-bottom: 22px;
}

.kzm-auth-card__title {
  margin: 0;
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--kzm-auth-ink);
}

.kzm-auth-card__sub {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--kzm-auth-muted);
}

.kzm-auth-card__foot {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--kzm-auth-muted);
}

.kzm-auth-card__foot a {
  color: var(--kzm-auth-blue);
  font-weight: 800;
  text-decoration: none;
}

.kzm-auth-card__foot a:hover {
  text-decoration: underline;
}

.kzm-auth-fine {
  margin-top: 10px;
  text-align: center;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(12, 26, 51, 0.48);
  font-weight: 500;
}

/* Alerts */
.kzm-auth-alert {
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.kzm-auth-alert--error {
  background: rgba(254, 226, 226, 0.95);
  border-color: rgba(220, 38, 38, 0.2);
  color: #991b1b;
}

.kzm-auth-alert--success {
  background: rgba(220, 252, 231, 0.95);
  border-color: rgba(22, 163, 74, 0.2);
  color: #166534;
}

.kzm-auth-alert ul {
  margin: 0;
  padding-left: 18px;
}

/* Form */
.kzm-auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kzm-auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.kzm-auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.kzm-auth-field--full {
  grid-column: 1 / -1;
}

.kzm-auth-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  color: var(--kzm-auth-ink);
  letter-spacing: 0.01em;
}

.kzm-auth-label svg {
  width: 15px;
  height: 15px;
  color: var(--kzm-auth-blue);
  flex-shrink: 0;
}

.kzm-auth-req {
  color: #dc2626;
}

.kzm-auth-input-wrap {
  position: relative;
}

.kzm-auth-input {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  border-radius: 14px;
  border: 1px solid rgba(15, 79, 168, 0.14);
  background: rgba(255, 255, 255, 0.92);
  font: 600 15px/1.3 var(--kzm-auth-font);
  color: var(--kzm-auth-ink);
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.kzm-auth-input::placeholder {
  color: rgba(12, 26, 51, 0.38);
  font-weight: 500;
}

.kzm-auth-input:focus {
  border-color: rgba(29, 111, 216, 0.55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(29, 111, 216, 0.12);
}

.kzm-auth-input[aria-invalid="true"] {
  border-color: rgba(220, 38, 38, 0.5);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.kzm-auth-input--pass {
  padding-right: 52px;
}

.kzm-auth-hint {
  font-size: 11px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--kzm-auth-muted);
}

.kzm-auth-hint--error {
  color: #991b1b;
  font-weight: 700;
}

.kzm-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 2px 0;
}

.kzm-auth-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--kzm-auth-ink);
  user-select: none;
}

.kzm-auth-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--kzm-auth-blue);
  margin: 0;
}

.kzm-auth-link {
  font-size: 13px;
  font-weight: 800;
  color: var(--kzm-auth-blue);
  text-decoration: none;
}

.kzm-auth-link:hover {
  text-decoration: underline;
}

.kzm-auth-pass-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 11px;
  background: rgba(29, 111, 216, 0.08);
  color: var(--kzm-auth-blue-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.kzm-auth-pass-toggle:hover {
  background: rgba(29, 111, 216, 0.16);
}

.kzm-auth-pass-toggle svg {
  width: 18px;
  height: 18px;
}

/* Consent */
.kzm-auth-consent {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid rgba(15, 79, 168, 0.12);
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}

.kzm-auth-consent[aria-invalid="true"] {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(254, 242, 242, 0.9);
}

.kzm-auth-consent input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--kzm-auth-blue);
  flex-shrink: 0;
}

.kzm-auth-consent__text {
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--kzm-auth-ink);
}

.kzm-auth-consent__text a {
  color: var(--kzm-auth-blue);
  font-weight: 800;
  text-decoration: none;
}

.kzm-auth-consent__text a:hover {
  text-decoration: underline;
}

/* Submit */
.kzm-auth-submit {
  appearance: none;
  width: 100%;
  min-height: 54px;
  margin-top: 4px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font: 800 15px/1 var(--kzm-auth-font);
  letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(135deg, var(--kzm-auth-blue) 0%, var(--kzm-auth-blue-deep) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 14px 32px rgba(15, 79, 168, 0.38);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kzm-auth-submit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.18) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
}

.kzm-auth-submit:hover {
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 18px 38px rgba(15, 79, 168, 0.45);
}

.kzm-auth-submit:hover::after {
  transform: translateX(120%);
}

.kzm-auth-submit:active {
  transform: translateY(1px);
}

.kzm-auth-submit__in {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  position: relative;
  z-index: 1;
}

.kzm-auth-submit svg {
  width: 18px;
  height: 18px;
}

/* Mobile */
@media (max-width: 900px) {
  .kzm-auth-brand {
    display: none;
  }

  .kzm-auth-shell,
  .kzm-auth-shell--wide {
    grid-template-columns: 1fr;
    width: min(480px, 100%);
    border-radius: 24px;
  }

  .kzm-auth-card {
    padding: 28px 22px 24px;
  }
}

@media (max-width: 520px) {
  .kzm-auth-main {
    padding: 76px 12px 20px;
  }

  .kzm-auth-home {
    top: 14px;
    left: 14px;
    padding: 6px 10px;
  }

  .kzm-auth-grid {
    grid-template-columns: 1fr;
  }

  .kzm-auth-field--full {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kzm-auth-scene__photo,
  .kzm-auth-scene__orb,
  .kzm-auth-shell {
    animation: none;
  }

  .kzm-auth-submit::after {
    display: none;
  }
}
