/* NeuraChat — базовые токены и общие компоненты
   Направление: чистый продукт-минимализм (ChatGPT/Gemini),
   единый гротеск, монохром + один живой акцент, pill-кнопки. */

:root {
  --paper: #ffffff;
  --paper-2: #f7f8f8;
  --paper-3: #f0f2f1;
  --surface: #ffffff;
  --ink: #0d0f0e;
  --ink-soft: #333936;
  --muted: #6d746f;
  --faint: #9aa19c;
  --line: #ececec;
  --line-strong: #dfe1e0;
  --dark: #0b0d0c;
  --dark-2: #141815;
  --dark-ink: #f2f4f2;
  --dark-muted: #9aa6a0;

  /* акцент — глубокий изумруд + живой мешевый градиент */
  --accent: #0e7a5b;
  --accent-strong: #0a5b44;
  --accent-tint: #e8f4ef;
  --accent-tint-2: #f2f8f5;
  --grad: linear-gradient(105deg, #0e7a5b 0%, #12a17a 44%, #2bd4a8 100%);
  --grad-soft: linear-gradient(135deg, #d6f2e7 0%, #e9f0ff 55%, #f6ecff 100%);
  --danger: #c23a30;

  --font-display: 'Schibsted Grotesk', -apple-system, 'Segoe UI', sans-serif;
  --font-ui: 'Schibsted Grotesk', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;
  --radius-xl: 28px;
  --shadow-card: 0 1px 2px rgba(13, 15, 14, 0.04), 0 8px 24px -14px rgba(13, 15, 14, 0.12);
  --shadow-pop: 0 12px 40px -12px rgba(13, 15, 14, 0.22);
  --shadow-hero: 0 40px 90px -40px rgba(14, 122, 91, 0.4);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.006em;
}

h1, h2, h3, h4, p { margin: 0; }
img, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: rgba(14, 122, 91, 0.16); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------- типографика ------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------- логотип ------- */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}
.logo svg { flex: none; }

/* ------- кнопки (pill) ------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.5); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-strong); box-shadow: 0 8px 22px -10px rgba(14, 122, 91, 0.6); }

.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--muted); background: var(--paper-2); }

.btn-quiet { background: transparent; color: var(--ink-soft); padding: 9px 15px; }
.btn-quiet:hover { background: rgba(13, 15, 14, 0.05); }

.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: default; pointer-events: none; }

/* ------- формы ------- */

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.field input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder { color: var(--faint); }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 122, 91, 0.13);
}
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.form-error {
  display: none;
  background: #fbeceb;
  border: 1px solid #eecac6;
  color: var(--danger);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  margin-bottom: 18px;
}
.form-error.visible { display: block; }

.strength { display: flex; gap: 5px; margin-top: 8px; }
.strength span { height: 4px; flex: 1; border-radius: 2px; background: var(--line); transition: background 0.2s ease; }
.strength[data-score='1'] span:nth-child(-n + 1),
.strength[data-score='2'] span:nth-child(-n + 2) { background: #d19a2e; }
.strength[data-score='3'] span:nth-child(-n + 3),
.strength[data-score='4'] span:nth-child(-n + 4) { background: var(--accent); }

/* ------- страницы входа/регистрации ------- */

.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60rem 40rem at 88% -20%, rgba(43, 212, 168, 0.1), transparent 62%),
    radial-gradient(46rem 30rem at -10% 120%, rgba(18, 161, 122, 0.07), transparent 60%),
    var(--paper);
}
.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 44px);
}
.auth-top .aside { font-size: 14px; color: var(--muted); }
.auth-top .aside a { color: var(--accent); font-weight: 500; text-decoration: none; }
.auth-top .aside a:hover { text-decoration: underline; }

.auth-main { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 20px 60px; }
.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 38px 36px 30px;
}
.auth-card h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.auth-card .sub { color: var(--muted); font-size: 14.5px; margin-bottom: 28px; }
.op-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-strong);
  background: var(--accent-tint);
  border: 1px solid var(--accent-tint);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.auth-alt { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.auth-alt .btn-ghost { font-weight: 450; }
.auth-alt .btn-ghost svg { flex: none; }

.auth-legal { font-size: 12.5px; color: var(--muted); margin-top: 18px; line-height: 1.5; }
.auth-legal a { color: var(--ink-soft); }
.auth-footer { text-align: center; font-size: 13px; color: var(--muted); padding: 18px; }

/* ------- страницы документов ------- */

.legal-body { background: var(--paper); min-height: 100vh; display: flex; flex-direction: column; }
.legal-main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) 22px 80px; }
.legal-main h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.legal-date { color: var(--muted); font-size: 13.5px; margin-bottom: 36px; }
.legal-main h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 32px 0 10px; }
.legal-main p, .legal-main li { font-size: 15px; line-height: 1.7; color: var(--ink-soft); }
.legal-main ul { padding-left: 22px; margin: 10px 0; }
.legal-main a { color: var(--accent); }
.legal-back { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 28px; }
.legal-back:hover { color: var(--accent); }

/* ------- тосты ------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  max-width: min(90vw, 480px);
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
