.kz-auth {
  --auth-primary: #007a5e;
  --auth-primary-dark: #00624a;
  --auth-primary-light: #00956e;
  --auth-bg: #f3f5f4;
  --auth-card: #ffffff;
  --auth-text: #333333;
  --auth-muted: #666666;
  --auth-border: #b8ddd0;
  --auth-input-bg: #f8f8f8;
  --auth-max: 480px;
  min-height: 100vh;
  background: var(--auth-bg);
  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: var(--auth-bg);
}

.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__bg::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 154px;
  background: var(--auth-primary);
  z-index: 1;
}

.kz-auth__back {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-primary);
  font-size: 20px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.kz-auth__head {
  position: relative;
  z-index: 2;
  padding: 48px 16px 8px;
  text-align: center;
}

.kz-auth__logo-text {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: var(--auth-primary);
  letter-spacing: 0.5px;
}

.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: 0;
  padding: 0 14px 20px;
}

.kz-auth__tabs {
  display: flex;
  border-bottom: 1px solid rgba(184, 221, 208, 0.8);
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 12px 12px 0 0;
  backdrop-filter: blur(4px);
}

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

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

.kz-auth__tab.active {
  color: var(--auth-primary);
}

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

.kz-auth__tab.active::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 0;
  height: 3px;
  background: var(--auth-primary);
  border-radius: 3px 3px 0 0;
}

.kz-auth__panel {
  display: none;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 0 0 16px 16px;
  padding: 4px 4px 8px;
  box-shadow: 0 4px 20px rgba(0, 122, 94, 0.08);
}

.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: 8px;
  background: var(--auth-card);
  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: #999;
  font-weight: 500;
}

.kz-auth__field input:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 2px rgba(0, 122, 94, 0.12);
}

.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: #e0e0e0;
  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: 8px;
  overflow: hidden;
  background: var(--auth-card);
}

.kz-auth__phone:focus-within {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 2px rgba(0, 122, 94, 0.12);
}

.kz-auth__phone-prefix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-right: 1px solid #eee;
  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);
}

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

.kz-auth__warn-text {
  margin: -2px 0 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff8e6;
  border: 1px solid #ffe0a3;
  color: #e65100;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.kz-auth__captcha {
  display: flex;
  margin-bottom: 10px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--auth-card);
}

.kz-auth__captcha:focus-within {
  border-color: var(--auth-primary);
}

.kz-auth__captcha input {
  flex: 1;
  height: 46px;
  border: none;
  outline: none;
  font-size: 14px;
  font-weight: 600;
  padding: 0 12px;
}

.kz-auth__captcha-code {
  min-width: 72px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-left: 1px solid #eee;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--auth-primary);
  font-family: monospace;
  user-select: none;
}

.kz-auth__captcha-refresh {
  width: 44px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #eee;
  color: var(--auth-primary);
  cursor: pointer;
  background: #fafafa;
}

.kz-auth__check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: #444;
  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 {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--auth-primary-light) 0%, var(--auth-primary) 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 122, 94, 0.22);
  transition: opacity 0.2s, transform 0.1s;
}

.kz-auth__submit:active {
  transform: scale(0.98);
  opacity: 0.92;
}

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

.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: 700;
  padding: 0;
}

.kz-auth__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  color: #aaa;
  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(184, 221, 208, 0.9);
}

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

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

.kz-auth__fp-box {
  background: #fff;
  border-radius: 14px;
  width: 86%;
  max-width: 340px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.kz-auth__fp-head {
  background: var(--auth-primary);
  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: #eef6f2;
  border-radius: 10px;
  border: 1px solid var(--auth-border);
  text-decoration: none;
  color: var(--auth-primary);
  font-weight: 600;
}

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

.kz-auth__loading {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 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 #e8e8e8;
  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__logo {
    width: 80%;
  }

  .kz-auth__tab {
    font-size: 14px;
  }
}
