/* Auth — вход и регистрация */
:root {
  --auth-ink: #14181f;
  --auth-muted: #6a7385;
  --auth-line: rgba(20, 24, 32, .08);
  --auth-card: rgba(255, 255, 255, .82);
  --auth-accent: #1f6feb;
  --auth-accent-soft: rgba(31, 111, 235, .12);
}

body.auth-page {
  margin: 0;
  padding: 0;
  padding-bottom: 0 !important;
  overflow-x: hidden;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--auth-ink);
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(31, 111, 235, .16), transparent 58%),
    radial-gradient(700px 420px at 100% 10%, rgba(20, 184, 166, .12), transparent 55%),
    radial-gradient(600px 400px at 50% 110%, rgba(15, 23, 42, .06), transparent 60%),
    #f3f5f8;
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  min-height: 100dvh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    max-width: 1180px;
    margin: 0 auto;
    gap: 0;
  }
}

/* —— Hero —— */
.auth-hero {
  position: relative;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 22px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.auth-hero-glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background:
    radial-gradient(circle at 30% 40%, rgba(31,111,235,.22), transparent 45%),
    radial-gradient(circle at 75% 30%, rgba(20,184,166,.16), transparent 40%);
  filter: blur(8px);
  pointer-events: none;
  animation: authGlow 10s ease-in-out infinite alternate;
}

@keyframes authGlow {
  from { transform: translateY(0) scale(1); opacity: .9; }
  to { transform: translateY(12px) scale(1.05); opacity: 1; }
}

.auth-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--auth-ink);
  text-decoration: none;
  margin-bottom: 22px;
  transition: transform .2s;
}
.auth-logo:hover { transform: translateY(-1px); }

.auth-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #1a1d24, #334155);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 10px 24px rgba(20, 24, 32, .22);
  overflow: hidden;
}
.auth-logo-mark.has-img { background: #fff; padding: 0; }
.auth-logo-mark.has-img img { width: 100%; height: 100%; object-fit: cover; }
.auth-logo-mark svg { width: 18px; height: 18px; }

.auth-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #0f3d8c;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.12;
}

.auth-hero-lead {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--auth-muted);
  max-width: 380px;
  font-weight: 500;
}

.auth-features {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform .2s, box-shadow .2s;
}
.auth-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(20,30,60,.08);
}
.auth-feature strong {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  margin-bottom: 2px;
}
.auth-feature span {
  display: block;
  font-size: 12px;
  color: var(--auth-muted);
  font-weight: 500;
  line-height: 1.35;
}

.auth-feature-ic {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(31,111,235,.14), rgba(20,184,166,.12));
  display: grid;
  place-items: center;
  color: #1f4f9c;
  flex-shrink: 0;
}
.auth-feature-ic svg { width: 18px; height: 18px; }

.auth-stats {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.auth-stats > div {
  padding: 12px 10px;
  border-radius: 14px;
  background: rgba(20, 24, 32, .92);
  color: #fff;
  text-align: center;
}
.auth-stats b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 2px;
}
.auth-stats span {
  font-size: 10.5px;
  opacity: .72;
  font-weight: 500;
}

/* —— Panel / form —— */
.auth-panel {
  padding: 18px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

@media (min-width: 960px) {
  .auth-hero { padding: 48px 40px 48px 24px; }
  .auth-panel {
    padding: 48px 28px 48px 20px;
    align-items: center;
  }
}

.auth-form {
  width: 100%;
  max-width: 420px;
  padding: 26px 22px 22px;
  border-radius: 26px;
  background: var(--auth-card);
  border: 1px solid rgba(255,255,255,.95);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.8) inset,
    0 24px 60px rgba(15, 23, 42, .1);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form-enter {
  animation: authFormIn .45s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes authFormIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.auth-form-head { margin-bottom: 2px; }
.auth-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--auth-accent);
}
.auth-form h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.03em;
}
.auth-form .sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--auth-muted);
  font-weight: 500;
}

.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(15, 23, 42, .05);
}
.role-switch a {
  text-align: center;
  padding: 11px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 650;
  color: var(--auth-muted);
  text-decoration: none;
  transition: .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.role-switch a svg { width: 20px; height: 20px; opacity: .75; }
.role-switch a.active {
  background: #fff;
  color: var(--auth-ink);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
}
.role-switch a.active svg { opacity: 1; color: var(--auth-accent); }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 11.5px;
  letter-spacing: .02em;
  color: #8a93a3;
  font-weight: 650;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.field-label .hint-inline,
.hint-inline {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #b0b7c4;
  font-size: 11px;
}
.field-link {
  color: var(--auth-accent);
  font-weight: 650;
  text-decoration: none;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}
.field-link:hover { text-decoration: underline; }

.field-input { position: relative; display: flex; align-items: center; }
.field-input svg.field-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: #9aa3b2;
  pointer-events: none;
}
.field-input input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--auth-line);
  transition: .2s;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--auth-ink);
  font-family: inherit;
}
.field-input input::placeholder { color: #b4bbc8; font-weight: 500; }
.field-input input:focus {
  outline: none;
  border-color: rgba(31,111,235,.45);
  box-shadow: 0 0 0 4px var(--auth-accent-soft);
  background: #fff;
}
.field-input.no-icon input { padding-left: 14px; }

.toggle-pass {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #9aa3b2;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.toggle-pass:hover { color: var(--auth-ink); background: rgba(0,0,0,.04); }
.toggle-pass svg { width: 18px; height: 18px; }

.pass-strength {
  height: 4px;
  border-radius: 999px;
  background: rgba(15,23,42,.06);
  overflow: hidden;
  margin-top: 2px;
}
.pass-strength i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: .3s;
  background: #ef4444;
}
.pass-strength i.medium { width: 66%; background: #f59e0b; }
.pass-strength i.strong { width: 100%; background: #10b981; }
.pass-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--auth-muted);
  font-weight: 500;
  min-height: 0;
}

.auth-check,
.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--auth-muted);
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
}
.auth-check input,
.agree-row input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--auth-accent);
  flex-shrink: 0;
}
.agree-row a,
.auth-footer a {
  color: var(--auth-accent);
  font-weight: 650;
  text-decoration: none;
}
.agree-row a:hover,
.auth-footer a:hover { text-decoration: underline; }

.btn-auth {
  width: 100%;
  margin-top: 4px;
  padding: 15px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #14181f, #2a3344);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: .22s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 12px 28px rgba(20, 24, 32, .22);
}
.btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(20, 24, 32, .28);
}
.btn-auth:active { transform: scale(.985); }
.btn-auth svg { width: 18px; height: 18px; }

.auth-footer {
  text-align: center;
  font-size: 13.5px;
  color: var(--auth-muted);
  font-weight: 500;
  margin: 2px 0 0;
}

.auth-back {
  display: block;
  text-align: center;
  font-size: 12.5px;
  font-weight: 650;
  color: #8a93a3;
  text-decoration: none;
  padding: 4px 0 2px;
  transition: color .2s;
}
.auth-back:hover { color: var(--auth-ink); }

.auth-alert {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 550;
}
.auth-alert.error {
  background: rgba(239, 68, 68, .08);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, .18);
}
.auth-alert.success {
  background: rgba(16, 185, 129, .1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, .2);
}

@media (max-width: 959px) {
  .auth-features { display: none; }
  .auth-stats { display: none; }
  .auth-hero {
    padding-bottom: 4px;
    min-height: auto;
  }
  .auth-hero h1 { font-size: 26px; }
  .auth-hero-lead { font-size: 13.5px; }
  .auth-panel { padding-top: 12px; }
  .auth-form { padding: 22px 18px 18px; border-radius: 22px; }
}

@media (max-width: 380px) {
  .field-row { grid-template-columns: 1fr; }
}
