/* ==========================================================================
   MarketPilot AI — страница входа и регистрации
   ========================================================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  position: relative;
  overflow-x: hidden;
}

.auth-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.auth-glow { position: absolute; border-radius: 50%; filter: blur(100px); }
.auth-glow-1 { width: 720px; height: 720px; top: -300px; left: -120px; background: radial-gradient(circle, rgba(79, 124, 255, 0.32), transparent 66%); }
.auth-glow-2 { width: 620px; height: 620px; bottom: -280px; right: -140px; background: radial-gradient(circle, rgba(124, 92, 255, 0.26), transparent 68%); }
.auth-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 20%, transparent 80%);
}

.auth-back {
  position: fixed; top: 24px; left: 24px; z-index: 5;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--muted);
  padding: 8px 13px; border-radius: 10px;
  border: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.04);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.auth-back svg { width: 15px; height: 15px; }
.auth-back:hover { color: #fff; border-color: var(--stroke-strong); background: rgba(255, 255, 255, 0.07); }

.auth-wrap {
  width: min(1080px, 100%);
  display: grid; grid-template-columns: 1fr 460px; gap: 56px;
  align-items: center;
}

/* ---------- левая колонка ---------- */
.auth-hero { display: flex; flex-direction: column; gap: 22px; }
.auth-hero .brand { display: inline-flex; align-items: center; gap: 10px; }
.auth-hero .brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, #4f7cff, #7c5cff 60%, #a855f7); color: #fff;
  box-shadow: 0 10px 26px -12px rgba(94, 116, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.auth-hero .brand-mark svg { width: 22px; height: 22px; }
.auth-hero .brand-text { font-size: 19px; font-weight: 800; letter-spacing: -0.035em; }
.auth-hero .brand-ai { color: #8fa8ff; margin-left: 3px; }

.auth-hero h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; letter-spacing: -0.04em; margin-top: 8px; }
.auth-hero-sub { font-size: 15px; color: var(--text-soft); line-height: 1.62; max-width: 460px; }

.auth-points { display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; gap: 10px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.ap-ico {
  width: 18px; height: 18px; border-radius: 6px; flex: none; margin-top: 1px;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  background: rgba(46, 230, 168, 0.14); color: #7ef3c4; border: 1px solid rgba(46, 230, 168, 0.24);
}

.auth-hero-foot { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted-2); margin-top: 6px; }

/* ---------- карточка формы ---------- */
.auth-card {
  position: relative;
  padding: 28px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(22, 29, 48, 0.92), rgba(9, 13, 24, 0.96));
  box-shadow: 0 40px 100px -50px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
}

.auth-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 20px;
  border-radius: 11px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--stroke);
}
.auth-tabs button {
  flex: 1; padding: 9px 0; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  transition: all 0.25s var(--ease);
}
.auth-tabs button:hover { color: var(--text); }
.auth-tabs button.is-active { color: #fff; background: rgba(255, 255, 255, 0.1); box-shadow: 0 4px 14px -10px #000; }

.auth-form h2 { font-size: 21px; letter-spacing: -0.03em; }
.auth-lead { font-size: 12.5px; color: var(--muted); margin: 5px 0 18px; }

.auth-form .field { margin-bottom: 13px; }
.auth-form .field label { display: block; font-size: 12px; color: var(--text-soft); margin-bottom: 6px; font-weight: 500; }
.auth-form .field input {
  width: 100%; height: 44px; padding: 0 13px;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13.5px; color: var(--text);
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.auth-form .field input::placeholder { color: var(--muted-2); }
.auth-form .field input:hover { border-color: rgba(255, 255, 255, 0.18); }
.auth-form .field input:focus {
  outline: none; border-color: rgba(110, 140, 255, 0.65);
  background: rgba(91, 140, 255, 0.07); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.14);
}
.auth-form .field.has-error input { border-color: rgba(255, 107, 107, 0.65); background: rgba(255, 107, 107, 0.06); }
.field-err { display: block; font-size: 11px; color: #ff9c9c; margin-top: 4px; }

.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 44px; }
.pass-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center; color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.pass-toggle svg { width: 17px; height: 17px; }
.pass-toggle:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }

.pass-meter { display: flex; gap: 4px; margin-top: 7px; height: 3px; }
.pass-meter i { flex: 1; border-radius: 99px; background: rgba(255, 255, 255, 0.1); transition: background 0.3s; }
.pass-meter.s1 i:nth-child(1) { background: var(--red); }
.pass-meter.s2 i:nth-child(-n+2) { background: var(--amber); }
.pass-meter.s3 i { background: var(--green); }

.checkbox { display: flex; align-items: flex-start; gap: 9px; font-size: 11.5px; color: var(--muted); line-height: 1.5; cursor: pointer; margin: 4px 0 2px; }
.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.cb-box {
  width: 17px; height: 17px; border-radius: 5px; flex: none; margin-top: 1px;
  border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.04);
  display: grid; place-items: center; transition: all 0.2s var(--ease);
}
.cb-box svg { width: 11px; height: 11px; opacity: 0; transform: scale(0.6); transition: all 0.2s var(--ease); color: #fff; }
.checkbox input:checked + .cb-box { background: linear-gradient(140deg, #4a7bff, #7c5cff); border-color: transparent; }
.checkbox input:checked + .cb-box svg { opacity: 1; transform: scale(1); }
.checkbox input:focus-visible + .cb-box { outline: 2px solid var(--blue-2); outline-offset: 2px; }
.checkbox a { color: #9db2ff; text-decoration: underline; text-underline-offset: 2px; }

.auth-form .btn[type="submit"] { margin-top: 12px; }
.auth-alt { margin-top: 10px; }
.auth-note { font-size: 11px; color: var(--muted-2); line-height: 1.5; margin-top: 12px; text-align: center; }

.auth-notice {
  padding: 11px 13px; border-radius: 10px; margin-bottom: 14px;
  font-size: 12.5px; line-height: 1.5;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.24);
  color: #ffe0a3;
}
.auth-notice.is-error {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.26);
  color: #ffb3b3;
}

.auth-success {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 10px; padding: 34px 10px; animation: fade-up 0.4s var(--ease);
}
.auth-success h2 { font-size: 22px; }
.auth-success p { font-size: 13px; color: var(--muted); max-width: 280px; line-height: 1.55; }
.as-ico { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: rgba(46, 230, 168, 0.14); border: 1px solid rgba(46, 230, 168, 0.3); color: var(--green); }
.as-ico svg { width: 28px; height: 28px; }
.as-ico::after {
  content: ''; position: absolute; width: 60px; height: 60px; border-radius: 50%;
  animation: pulse-ring 2s infinite;
}

.btn-spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

/* ---------- адаптив ---------- */
@media (max-width: 980px) {
  .auth-wrap { grid-template-columns: minmax(0, 1fr); max-width: 520px; gap: 28px; }
  .auth-hero { text-align: left; }
  .auth-hero h1 { font-size: clamp(26px, 6vw, 34px); }
  .auth-points, .auth-hero-foot { display: none; }
  .auth-back { top: 16px; left: 16px; }
  .auth-page { padding: 74px 18px 40px; align-items: flex-start; }
}

@media (max-width: 520px) {
  .auth-card { padding: 20px 16px; border-radius: 18px; }
  .auth-page { padding: 64px 12px 32px; }
  .auth-hero h1 { font-size: 25px; }
}
