:root {
  --primary: #0052FF; --primary-hover: #0045D8; --secondary: #0052FF;
  --bg: #F7FAFC; --bg-soft: #EEF4F8; --surface: #FFFFFF; --border: #DEE1E6; --border-strong: #C1CDDA;
  --text: #07152B; --text-sec: #516173; --text-muted: #8A98A8;
  --error: #E5484D; --success: #12B76A; --tg: #229ED9;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; font-weight: 600; }
a:hover { color: var(--primary-hover); }

.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }

.auth-art {
  position: relative; overflow: hidden; padding: 40px 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: #EAF0FF url("/assets/kab/hero-mountains.jpg") center 70% / cover no-repeat;
}
.auth-art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.82) 34%, rgba(255,255,255,.1) 64%, rgba(255,255,255,0) 100%); }
.auth-art > * { position: relative; }
.auth-art .logo img { height: 40px; width: auto; display: block; }
.auth-art h2 { font-size: clamp(30px, 3vw, 44px); line-height: 1.1; letter-spacing: -.03em; margin: 44px 0 14px; max-width: 480px; text-wrap: balance; }
.auth-art p { color: var(--text-sec); font-size: 17px; line-height: 1.55; margin: 0; max-width: 440px; text-wrap: pretty; }
.auth-art .perks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.auth-art .perk { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.9); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--text); }
.auth-art .perk img { width: 18px; height: 18px; }
.auth-art .foot { color: #0b3b27; font-size: 13px; font-weight: 500; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.card { width: 100%; max-width: 440px; }
.card .m-logo { display: none; margin-bottom: 28px; }
.card .m-logo img { height: 36px; width: auto; }
.card h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 8px; }
.card .lead { color: var(--text-sec); font-size: 15px; line-height: 1.55; margin: 0 0 28px; }

.field { margin-bottom: 16px; }
.field label { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.field label a { font-size: 13px; }
.input { position: relative; display: flex; align-items: center; }
.input input {
  width: 100%; height: 48px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  padding: 0 14px; font: 500 15px -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input input::placeholder { color: var(--text-muted); font-weight: 400; }
.input input:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(0,82,255,.14); }
.input .prefix { position: absolute; left: 14px; color: var(--text-muted); font-weight: 600; pointer-events: none; }
.input .prefix + input { padding-left: 32px; }
.input .toggle { position: absolute; right: 8px; height: 32px; padding: 0 10px; border: 0; background: transparent; color: var(--text-sec); font: 600 13px -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif; cursor: pointer; border-radius: 6px; }
.input .toggle:hover { background: var(--bg-soft); }
.input input.has-toggle { padding-right: 64px; }
.field.invalid input { border-color: var(--error); }
.field .err { color: var(--error); font-size: 13px; margin-top: 6px; min-height: 0; }
.field .hint { color: var(--text-muted); font-size: 12.5px; margin-top: 6px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-sec); margin: 6px 0 20px; line-height: 1.5; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.check.invalid { color: var(--error); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 50px; border-radius: 8px; border: 1px solid transparent; font: 600 16px -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-primary[disabled] { opacity: .6; cursor: progress; }
.btn-tg { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-tg:hover { border-color: var(--tg); color: var(--text); background: #F3FAFE; }
.btn-tg svg { width: 22px; height: 22px; }

.divider { display: flex; align-items: center; gap: 14px; color: var(--text-muted); font-size: 13px; margin: 22px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.alert { border-radius: 8px; padding: 12px 14px; font-size: 14px; line-height: 1.5; margin-bottom: 18px; display: none; }
.alert.show { display: block; }
.alert.error { background: #FEF2F2; border: 1px solid #FBCACC; color: #B42318; }
.alert.success { background: #ECFDF3; border: 1px solid #ABEFC6; color: #05603A; }
.alert a { color: inherit; text-decoration: underline; }

.switch { text-align: center; color: var(--text-sec); font-size: 14px; margin-top: 26px; }
.tg-note { color: var(--text-muted); font-size: 12.5px; text-align: center; margin-top: 10px; line-height: 1.5; }

.state { text-align: center; }
.state .icon { width: 64px; height: 64px; margin: 0 auto 20px; display: block; }
.state .btn { margin-top: 8px; }
.hidden { display: none !important; }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .card .m-logo { display: block; }
  .auth-main { align-items: flex-start; padding: 36px 20px 48px; }
  .card h1 { font-size: 26px; }
}
@media (max-width: 960px) {
  body { background: #FFFFFF url("/assets/kab/hero-mountains.jpg") center top / 230% auto no-repeat; }
  .auth-main { background: linear-gradient(180deg, rgba(255,255,255,.35) 0px, rgba(255,255,255,.88) 150px, #FFFFFF 240px); min-height: 100vh; }
}
