/**
 * Страницы входа / регистрации / сброса пароля — как публичный alex-digital.io (2026):
 * светлый paper-фон, шум, светлая карточка, акцент teal / mint, шрифты Bricolage / Instrument / JetBrains.
 * Подключать после common.css.
 */
:root {
  --green: #0f766e;
  --green-bright: #14b8a6;
  --green-glow: rgba(20, 184, 166, 0.38);
  --ink: #0f172a;
  --paper: #f8fafc;
  --line: rgba(15, 23, 42, 0.1);
  --line-strong: rgba(15, 23, 42, 0.14);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  /* Совместимость с инлайнами портала */
  --text-primary: var(--ink);
  --text-secondary: rgba(15, 23, 42, 0.62);
  --text-tertiary: rgba(15, 23, 42, 0.48);
  --color-primary: var(--green);
  --color-primary-dark: #0d9488;
  --color-success: var(--green);
  --color-error: #dc2626;
  --border-primary: var(--line);
  --bg-card: #ffffff;
  --bg-tertiary: var(--paper);
  --shadow-xl: 0 24px 48px -20px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
}

body.auth-brand-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-display);
  background: var(--paper);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  position: relative;
  overflow-x: hidden;
}

/* Лёгкий шум как на public_landing */
body.auth-brand-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: 0.35;
}

/* Слабое teal-свечение */
body.auth-brand-page::after {
  content: "";
  position: fixed;
  bottom: -120px;
  right: -80px;
  width: min(420px, 95vw);
  height: min(420px, 95vw);
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.22) 0%, transparent 65%);
  opacity: 1;
}

.login-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

.login-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px 34px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06), 0 24px 48px -20px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(20, 184, 166, 0.12);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header .logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 12px;
}

.login-header .logo .logo-part {
  display: inline-block;
}

.login-header .logo .logo-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 8px var(--green-glow);
  margin: 0 3px 4px;
  vertical-align: middle;
}

.login-header h3 {
  font-size: clamp(1.25rem, 3.5vw, 1.5rem);
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.login-header h3 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--green);
}

.login-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 600;
}

.form-group input {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-family: var(--font-display);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}

.form-group input::placeholder {
  color: rgba(15, 23, 42, 0.38);
}

.form-group input:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
  background: #fff;
}

.btn-login,
.btn-register {
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  background: var(--green-bright);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  font-family: var(--font-display);
  border: 1px solid var(--green-bright);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
  box-shadow: 0 6px 22px rgba(20, 184, 166, 0.35);
  margin-top: 6px;
}

.btn-login:hover,
.btn-register:hover {
  transform: translateY(-1px);
  background: #fff;
  color: var(--ink);
  border-color: #fff;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.12);
}

.btn-login:active,
.btn-register:active {
  transform: translateY(0);
}

.btn-login:disabled,
.btn-register:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.login-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
  text-align: center;
}

.login-links a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-display);
  transition: color 0.2s;
}

.login-links a:hover {
  color: var(--green-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.error-message {
  display: none;
  padding: 12px 14px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 12px;
  color: #b91c1c;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
  line-height: 1.4;
}

.error-message.show {
  display: block;
  animation: auth-shake 0.45s ease;
}

.success-message {
  display: none;
  padding: 12px 14px;
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: 12px;
  color: var(--green);
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.success-message.show {
  display: block;
}

@keyframes auth-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.portal-then-grab-hint {
  text-align: left;
  padding: 14px 16px;
  margin: 0 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.06);
  color: var(--ink);
}

.portal-logout-ok {
  padding: 12px 14px;
  margin: 0 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 118, 110, 0.35);
  background: rgba(15, 118, 110, 0.08);
  font-size: 14px;
  color: var(--ink);
  text-align: center;
  line-height: 1.45;
}

.grab-pos-wrap {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.btn-grab-pos {
  display: block;
  width: 100%;
  text-align: center;
  padding: 13px 16px;
  border-radius: 999px;
  background: #00b14f;
  color: #fff !important;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  letter-spacing: 0.04em;
  border: 2px solid #009946;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-grab-pos:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 177, 79, 0.35);
  color: #fff !important;
}

.grab-pos-hint {
  text-align: center;
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.login-legend {
  margin-top: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  font-size: 13px;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .login-card {
    padding: 28px 22px;
  }
  .login-header h3 {
    font-size: 1.2rem;
  }
}
