:root {
  --primary: #0969da;
  --success: #22c55e;
  --border: #e4e7ec;
  --background-deep: #f6f7f9;
  --text: #1f2329;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  background: #fff;
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }

.auth-shell {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
}

.visual-panel {
  position: relative;
  width: 60%;
  min-height: 100vh;
  flex: 1 1 60%;
  overflow: hidden;
  background: #0a1929;
}
.visual-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.1) brightness(.8) saturate(1.2) hue-rotate(-5deg);
}
.visual-overlay, .visual-dots { position: absolute; inset: 0; pointer-events: none; }
.visual-overlay {
  z-index: 1;
  background: linear-gradient(135deg, rgba(10,25,41,.4), rgba(0,89,255,.15) 50%, rgba(10,25,41,.4));
}
.visual-dots {
  z-index: 2;
  background-image: radial-gradient(rgba(66,133,244,.2) 1px, transparent 1px);
  background-size: 20px 20px;
}
.brand {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  padding: 32px 0 0 32px;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 2px 5px rgba(0,0,0,.35);
}
.brand img { width: 48px; height: 48px; margin-right: 16px; object-fit: cover; }

.form-panel {
  position: relative;
  display: flex;
  width: 40%;
  min-height: 100vh;
  flex: 0 0 40%;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: #fff;
}
.service-link {
  position: absolute;
  top: 28px;
  right: 32px;
  z-index: 4;
  display: inline-flex;
  height: 36px;
  align-items: center;
  gap: 7px;
  border: 1px solid #dce7f5;
  border-radius: 18px;
  padding: 0 14px 0 11px;
  color: #1677c8;
  background: #f6faff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .15s, background-color .15s, transform .15s;
}
.service-link:hover { border-color: #a9ccec; background: #edf7ff; transform: translateY(-1px); }
.service-link:focus-visible { outline: 2px solid rgba(9,105,218,.35); outline-offset: 2px; }
.telegram-mark {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #229ed9;
  font-size: 13px;
  transform: rotate(-12deg);
}

.login-card { width: 100%; max-width: 448px; }
.title-block { margin-bottom: 28px; }
h1 { margin: 0 0 8px; color: #171b21; font-size: 24px; font-weight: 700; line-height: 32px; }
.form-field { position: relative; margin-bottom: 16px; }
.form-field input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  padding: 0 12px;
  color: #20242b;
  background: #fff;
  font-size: 14px;
  user-select: text;
  transition: border-color .15s, box-shadow .15s;
}
.form-field input::placeholder { color: #a8abb2; }
.form-field input:hover { border-color: #c7ccd4; }
.form-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(9,105,218,.12); }
.password-field input { padding-right: 42px; }
.visibility {
  position: absolute;
  top: 4px;
  right: 5px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  color: #8a919f;
  background: transparent;
  cursor: pointer;
}
.eye {
  position: relative;
  display: block;
  width: 16px;
  height: 11px;
  border: 1.5px solid currentColor;
  border-radius: 50% 50% 45% 45%;
}
.eye::after {
  position: absolute;
  top: 3px;
  left: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}
.eye:not(.eye-open)::before {
  position: absolute;
  top: 4px;
  left: -2px;
  z-index: 1;
  width: 19px;
  height: 1.5px;
  background: currentColor;
  content: "";
  transform: rotate(-38deg);
}

.captcha {
  --slider-progress: 40px;
  position: relative;
  display: flex;
  width: 100%;
  height: 40px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #8a919f;
  background: var(--background-deep);
  font-size: 12px;
  text-align: center;
  user-select: none;
}
.captcha-progress { position: absolute; inset: 0 auto 0 0; width: var(--slider-progress); background: rgba(34,197,94,.18); }
.captcha-text { position: relative; z-index: 1; width: 100%; padding: 0 45px; }
.captcha-handle {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: grid;
  width: 40px;
  height: 38px;
  place-items: center;
  border: 0;
  border-right: 1px solid #d8dce3;
  color: #596473;
  background: #fff;
  box-shadow: 1px 0 4px rgba(31,35,41,.1);
  font-size: 19px;
  cursor: grab;
  touch-action: none;
}
.captcha-handle:active { cursor: grabbing; }
.captcha.verified { border-color: #86dca8; color: #20a45b; background: #f1fbf5; }
.captcha.verified .captcha-progress { background: rgba(34,197,94,.2); }
.captcha.verified .captcha-handle { border-right-color: var(--success); color: #fff; background: var(--success); font-size: 16px; }
.login-button {
  width: 100%;
  height: 40px;
  margin-top: 16px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.login-button:hover { background: #075fc5; }
.status { min-height: 20px; margin: 8px 0 0; color: #e5484d; font-size: 12px; line-height: 20px; }
.mobile-brand { display: none; }

@media (max-width: 1023px) {
  .visual-panel { display: none; }
  .form-panel { width: 100%; flex-basis: 100%; padding: 96px 24px 40px; }
  .service-link { top: 25px; right: 20px; }
  .mobile-brand {
    position: absolute;
    top: 24px;
    left: 24px;
    display: flex;
    align-items: center;
    color: #171b21;
    font-size: 21px;
    font-weight: 700;
  }
  .mobile-brand img { width: 38px; height: 38px; margin-right: 10px; object-fit: cover; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
