/*
 * Вход и регистрация rvbit.ru — в стиле сайта enterprise.rvbit.ru
 * (сентябрь 2026). Заменяет app.css + handoff-auth.css + theme.js на этих
 * страницах: тема одна, тёмная тёплая, как на сайте, откуда сюда приходят.
 *
 * Разметка и скрипты страниц не менялись. Встроенные <style> в index.html и
 * verify.html пишут цвета через переменные app.css (--text-primary, --accent
 * и т.д.) — они определены здесь под новую палитру, поэтому работают как
 * раньше. Главный зелёный — #2f7d32, как у кнопок в приложении и на сайте.
 */

@font-face {
  font-family: 'Geologica';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/geologica.woff2') format('woff2');
}

:root {
  color-scheme: dark;

  --bg: oklch(0.17 0.013 158);
  --bg-sunk: oklch(0.145 0.012 158);
  --surface: oklch(0.205 0.014 158);
  --surface-2: oklch(0.24 0.015 158);
  --surface-3: oklch(0.285 0.016 158);
  --line: oklch(0.34 0.014 158);
  --line-soft: oklch(0.275 0.013 158);
  --line-strong: oklch(0.52 0.012 158);
  --ink: oklch(0.96 0.008 105);
  --ink-2: oklch(0.84 0.012 115);
  --ink-3: oklch(0.72 0.012 125);
  --green: oklch(0.79 0.16 148);
  --green-soft: oklch(0.79 0.16 148 / 0.12);
  --green-line: oklch(0.79 0.16 148 / 0.38);
  --brand: #2f7d32;
  --brand-hover: #2b7330;
  --amber: oklch(0.83 0.13 78);
  --amber-soft: oklch(0.83 0.13 78 / 0.12);
  --danger: oklch(0.74 0.15 25);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Имена из app.css — на них написаны встроенные стили страниц */
  --bg-primary: var(--surface);
  --bg-secondary: var(--surface-2);
  --bg-tertiary: var(--surface-3);
  --bg-input: var(--bg-sunk);
  --bg-active: var(--green-soft);
  --border-color: var(--line);
  --border-active: var(--green-line);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-tertiary: var(--ink-3);
  --text-muted: var(--ink-3);
  --text-accent: var(--green);
  --text-on-accent: #fff;
  --accent: var(--brand);
  --accent-hover: var(--brand-hover);
  --color-danger: var(--danger);
  --warn-bg: var(--amber-soft);
  --warn-text: var(--amber);
  --brand-header: transparent;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geologica', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  font-weight: 360;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Та же неподвижная фактура сети, что на сайте ниже первого экрана */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/bg/contour.svg') 0 0 / 560px repeat;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000, transparent 75%);
  pointer-events: none;
}

h1,
h2,
p {
  margin: 0;
}

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

::selection {
  background: oklch(0.79 0.16 148 / 0.32);
}

/* ── Шапка ─────────────────────────────────────────────────────────── */

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  background: none;
  color: var(--ink);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

/* Знак продукта: тёмный квадрат с белым кубом, как в приложении и на сайте */
.mark {
  display: block;
  flex: none;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 26%;
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.14);
}

.mark svg {
  display: block;
}

.brand {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.about {
  margin-left: auto;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.about:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* Подвал прижат к низу и на коротких страницах (подтверждение почты) */
body > main {
  flex: 1;
  width: 100%;
}

/* ── Главная: две колонки ─────────────────────────────────────────── */

.page {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 20px 64px;
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .page {
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 64px;
    align-items: start;
    padding-top: 72px;
  }
}

.page h1 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}

.lead {
  max-width: 32em;
  color: var(--ink-2);
  font-size: 1.0625rem;
}

/* Условия — спокойной панелью, а не рекламной плашкой */
.promo {
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid var(--green-line);
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--ink);
  font-weight: 500;
}

.promo small {
  display: block;
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 360;
}

.checks {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.checks li {
  position: relative;
  padding-left: 26px;
}

.checks li::before {
  content: '';
  position: absolute;
  top: 0.45em;
  left: 2px;
  width: 11px;
  height: 6px;
  border-bottom: 2px solid var(--green);
  border-left: 2px solid var(--green);
  transform: rotate(-45deg);
}

/* ── Карточка формы ───────────────────────────────────────────────── */

.card {
  position: relative;
  padding: 24px 26px 26px;
  border: 1px solid transparent;
  border-radius: 24px;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(180deg, oklch(0.9 0.06 85 / 0.22), var(--line-soft) 38%) border-box;
  box-shadow: 0 30px 70px -40px oklch(0 0 0 / 0.7);
}

.muted {
  color: var(--ink-3);
}

label {
  display: block;
  margin: 16px 0 8px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 400;
}

input[type='email'],
input[type='password'],
input[type='text'] {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--bg-sunk);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

input::placeholder {
  color: var(--ink-3);
}

input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.hint {
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 0.8125rem;
  line-height: 1.5;
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 520;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.18);
  transition: background-color 160ms var(--ease), box-shadow 260ms var(--ease);
}

button:hover:not(:disabled),
.btn:hover {
  background: var(--brand-hover);
  box-shadow:
    0 10px 30px -12px oklch(0.6 0.15 148 / 0.75),
    inset 0 1px 0 oklch(1 0 0 / 0.18);
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Вкладки — не кнопки: сбрасываем заливку, остальное во встроенных стилях */
.tab,
.tab:hover:not(:disabled) {
  min-height: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.tabs {
  border-bottom-color: var(--line-soft);
}

.msg {
  margin-top: 15px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
}

.msg.err {
  border: 1px solid oklch(0.74 0.15 25 / 0.4);
  background: oklch(0.74 0.15 25 / 0.1);
  color: var(--danger);
}

.msg.ok {
  border: 1px solid var(--green-line);
  background: var(--green-soft);
  color: var(--ink);
}

.plan {
  color: var(--ink-3);
  line-height: 1.5;
}

/* На телефоне форма ближе к началу: пункты с галочками повторяют условия,
   которые и так написаны под кнопкой «Создать компанию» */
@media (max-width: 899px) {
  .checks {
    display: none;
  }

  .tab {
    padding-inline: 4px;
    white-space: nowrap;
  }
}

/* ── Подвал ───────────────────────────────────────────────────────── */

footer {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 32px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-3);
  font-size: 0.875rem;
  text-align: center;
}

footer a {
  color: var(--ink-2);
  text-decoration: none;
}

footer a:hover {
  color: var(--ink);
}

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