.kz-auth {
  --auth-primary: #4da3e0;
  --auth-primary-dark: #2d6fb8;
  --auth-primary-light: #7db8e8;
  --auth-bg-top: #101c3d;
  --auth-bg-bottom: #080d1a;
  --auth-bg: #101c3d;
  --auth-card: #161f33;
  --auth-surface: #1a2540;
  --auth-text: #ffffff;
  --auth-muted: #a0aec0;
  --auth-border: rgba(255, 255, 255, 0.12);
  --auth-input-bg: #121b30;
  --auth-max: 480px;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--auth-bg-top) 0%, #0b142b 48%, var(--auth-bg-bottom) 100%);
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--auth-text);
  font-weight: 500;
}

.kz-auth *,
.kz-auth *::before,
.kz-auth *::after {
  box-sizing: border-box;
}

header.btcbet-header,
#btcbet-menuPopup,
app-header,
[class*="header-wrap"] {
  display: none !important;
}

body:has(.kz-auth) {
  background: #080d1a !important;
}

.kz-auth__page {
  max-width: var(--auth-max);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: 32px;
}

.kz-auth__bg {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--auth-max);
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.kz-auth__bg-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 154px);
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  pointer-events: none;
}

.kz-auth__bg-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 154px;
  object-fit: cover;
  object-position: bottom center;
  opacity: 0;
  pointer-events: none;
}

.kz-auth__back {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e8f1ff;
  font-size: 20px;
  text-decoration: none;
  background: linear-gradient(145deg, rgba(26, 37, 64, 0.92) 0%, rgba(16, 28, 61, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.kz-auth__head {
  position: relative;
  z-index: 2;
  padding: 0;
  margin: 0;
  text-align: center;
  line-height: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 70% 20%, rgba(77, 163, 224, 0.18), transparent 55%),
    linear-gradient(180deg, #152246 0%, #101c3d 55%, #080d1a 100%);
}

.kz-auth__banner-wrap {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.kz-auth__banner {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 46vh;
  object-fit: cover;
  object-position: center 22%;
  transform: scale(1.02);
}

.kz-auth__banner-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 13, 26, 0.18) 0%, transparent 28%, transparent 58%, rgba(8, 13, 26, 0.55) 82%, #080d1a 100%),
    linear-gradient(90deg, rgba(8, 13, 26, 0.22) 0%, transparent 34%, transparent 70%, rgba(8, 13, 26, 0.12) 100%);
  z-index: 1;
}

.kz-auth__banner-glow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.55), rgba(77, 163, 224, 0.45), transparent);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.25);
  z-index: 2;
  pointer-events: none;
}

.kz-auth__logo-text {
  margin: 0;
  padding: 48px 16px 8px;
  font-size: 28px;
  font-weight: 600;
  color: var(--auth-primary);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.kz-auth__logo {
  display: block;
  max-width: 280px;
  width: 72%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.kz-auth__card {
  position: relative;
  z-index: 2;
  margin: -28px 0 0;
  padding: 0 14px 20px;
  background: transparent;
}

.kz-auth__tabs {
  display: flex;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #1a2540 0%, #141e36 100%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: none;
  overflow: hidden;
  padding: 3px;
}

.kz-auth__tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--auth-muted);
  cursor: pointer;
  position: relative;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.kz-auth__tab img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.55;
}

.kz-auth__tab.active {
  color: #fff8e7;
  background:
    linear-gradient(180deg, rgba(255, 220, 140, 0.14) 0%, transparent 45%),
    linear-gradient(135deg, #1e4a8c 0%, #12306a 55%, #0a1f4a 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.kz-auth__tab.active img {
  opacity: 1;
}

.kz-auth__tab.active::after {
  display: none;
}

.kz-auth__panel {
  display: none;
  background: linear-gradient(180deg, #161f33 0%, #121b30 100%);
  border-radius: 18px;
  padding: 14px 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.kz-auth__panel.active {
  display: block;
}

.kz-auth__hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-muted);
  margin: 0 0 12px 2px;
  line-height: 1.45;
}

.kz-auth__field {
  position: relative;
  margin-bottom: 10px;
}

.kz-auth__field-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--auth-primary);
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kz-auth__field-prefix svg {
  width: 18px;
  height: 18px;
}

.kz-auth__field input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--auth-border);
  border-radius: 999px;
  background: var(--auth-input-bg);
  color: var(--auth-text);
  font-size: 14px;
  font-weight: 600;
  padding: 0 42px 0 38px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kz-auth__field input::placeholder {
  color: #7a8aa3;
  font-weight: 500;
}

.kz-auth__field input:focus {
  border-color: rgba(77, 163, 224, 0.55);
  box-shadow: none;
}

.kz-auth__field-star {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: #ff4d4f;
  font-size: 12px;
  z-index: 2;
  pointer-events: none;
}

.kz-auth__field--star input {
  padding-left: 44px;
}

.kz-auth__eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--auth-primary);
  cursor: pointer;
  padding: 4px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kz-auth__eye svg {
  width: 20px;
  height: 20px;
}

.kz-auth__pwd-strength {
  margin: -2px 0 10px;
}

.kz-auth__pwd-strength-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--auth-muted);
  margin-bottom: 6px;
}

.kz-auth__pwd-bars {
  display: flex;
  gap: 6px;
}

.kz-auth__pwd-bars span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s;
}

.kz-auth__pwd-bars span.on {
  background: var(--auth-primary);
}

.kz-auth__pwd-bars span.on.weak {
  background: #ff9800;
}

.kz-auth__pwd-bars span.on.strong {
  background: #4caf50;
}

.kz-auth__phone {
  display: flex;
  margin-bottom: 10px;
  border: 1px solid var(--auth-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--auth-input-bg);
}

.kz-auth__phone:focus-within {
  border-color: rgba(77, 163, 224, 0.55);
  box-shadow: none;
}

.kz-auth__phone-prefix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  height: 46px;
  color: var(--auth-text);
}

.kz-auth__phone-prefix img {
  width: 22px;
  height: auto;
  object-fit: contain;
}

.kz-auth__phone input {
  flex: 1;
  height: 46px;
  border: none;
  outline: none;
  font-size: 14px;
  font-weight: 600;
  padding: 0 12px;
  color: var(--auth-text);
  background: transparent;
}

.kz-auth__phone input::placeholder {
  color: #7a8aa3;
  font-weight: 500;
}

.kz-auth__warn-text {
  margin: -2px 0 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(230, 162, 0, 0.12);
  border: 1px solid rgba(230, 162, 0, 0.28);
  color: #ffc266;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.kz-auth__captcha {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}

.kz-auth__captcha input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--auth-border);
  border-radius: 999px;
  outline: none;
  font-size: 14px;
  font-weight: 600;
  padding: 0 16px;
  background: var(--auth-input-bg);
  color: var(--auth-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kz-auth__captcha input::placeholder {
  color: #7a8aa3;
  font-weight: 500;
}

.kz-auth__captcha input:focus {
  border-color: rgba(77, 163, 224, 0.55);
}

.kz-auth__captcha-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 46px;
  padding: 3px 4px 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 220, 140, 0.12) 0%, transparent 45%),
    linear-gradient(135deg, #1e4a8c 0%, #12306a 55%, #0a1f4a 100%);
  box-shadow:
    0 0 0 1px rgba(8, 13, 26, 0.3) inset,
    0 3px 10px rgba(0, 0, 0, 0.22);
  position: relative;
  overflow: hidden;
}

.kz-auth__captcha-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -28deg,
      transparent 0,
      transparent 6px,
      rgba(255, 255, 255, 0.035) 6px,
      rgba(255, 255, 255, 0.035) 7px
    );
  pointer-events: none;
}

.kz-auth__captcha-code {
  position: relative;
  z-index: 1;
  min-width: 78px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  user-select: none;
  -webkit-user-select: none;
}

.kz-auth__captcha-code.is-flip .kz-auth__captcha-digit {
  animation: kzCaptchaDigit 0.35s ease;
}

.kz-auth__captcha-digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 28px;
  font-size: 18px;
  font-weight: 800;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0;
  color: #fff8e7;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  transform: rotate(var(--rot, 0deg));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.kz-auth__captcha-refresh {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: #fff8e7;
  cursor: pointer;
  background: rgba(8, 13, 26, 0.28);
  padding: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.kz-auth__captcha-refresh:active {
  transform: rotate(180deg) scale(0.94);
  background: rgba(8, 13, 26, 0.45);
}

@keyframes kzCaptchaDigit {
  from { opacity: 0; transform: rotate(var(--rot, 0deg)) scale(0.7); }
  to { opacity: 1; transform: rotate(var(--rot, 0deg)) scale(1); }
}

.kz-auth__check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: #c5d4eb;
  line-height: 1.45;
}

.kz-auth__check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--auth-primary);
  flex-shrink: 0;
  cursor: pointer;
}

.kz-auth__check .link {
  color: var(--auth-primary);
  font-weight: 700;
  cursor: pointer;
}

.kz-auth__submit {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 48px;
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 999px;
  color: #fff8e7;
  background:
    linear-gradient(180deg, rgba(255, 220, 140, 0.18) 0%, transparent 42%),
    linear-gradient(135deg, #1e4a8c 0%, #12306a 48%, #0a1f4a 100%);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(8, 13, 26, 0.35) inset,
    0 4px 14px rgba(0, 0, 0, 0.28),
    0 0 18px rgba(212, 175, 55, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.kz-auth__submit::before {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 36%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg);
  animation: kzAuthShine 2.8s ease-in-out infinite;
  pointer-events: none;
}

.kz-auth__submit:active {
  transform: scale(0.97);
  filter: brightness(1.06);
  box-shadow:
    0 0 0 1px rgba(8, 13, 26, 0.35) inset,
    0 2px 8px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(212, 175, 55, 0.18);
}

.kz-auth__submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.kz-auth__submit:disabled::before {
  animation: none;
  opacity: 0;
}

@keyframes kzAuthShine {
  0%, 55% { left: -40%; opacity: 0; }
  65% { opacity: 1; }
  100% { left: 130%; opacity: 0; }
}

.kz-auth__links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
}

.kz-auth__links.center {
  justify-content: center;
}

.kz-auth__links a,
.kz-auth__links button {
  color: var(--auth-primary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
}

.kz-auth__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  color: #8fa0b8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.kz-auth__divider::before,
.kz-auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.kz-auth__fp-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 24, 0.72);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.kz-auth__fp-overlay.show {
  display: flex;
}

.kz-auth__fp-box {
  background: linear-gradient(165deg, #1a2748 0%, #121c36 55%, #0d1528 100%);
  border-radius: 14px;
  width: 86%;
  max-width: 340px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.kz-auth__fp-head {
  background: linear-gradient(135deg, #2d6fb8 0%, #1e4f8c 100%);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
}

.kz-auth__fp-head button {
  background: none;
  border: none;
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}

.kz-auth__fp-body {
  padding: 22px 18px;
  text-align: center;
}

.kz-auth__fp-body a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 22px;
  background: linear-gradient(145deg, #1a2540 0%, #141e36 100%);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  color: #cfe6ff;
  font-weight: 600;
}

.kz-auth__fp-note {
  margin-top: 14px;
  font-size: 12px;
  color: #8fa0b8;
}

.kz-auth__loading {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 13, 26, 0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.kz-auth__loading.show {
  display: flex;
}

.kz-auth__spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--auth-primary);
  border-radius: 50%;
  animation: kz-auth-spin 0.65s linear infinite;
}

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

@media (max-width: 360px) {
  .kz-auth__tab {
    font-size: 14px;
  }
}
