/* Портал в том же виде, что вход в саму CRM («Стекло»): матовая карточка на серой подложке, всё скруглено,
   главное действие — чёрной таблеткой, шрифт Onest. Человек переходит отсюда в свою CRM и не должен гадать,
   туда ли он попал. */
@font-face { font-family: Onest; font-weight: 400 700; font-display: swap; src: url('/fonts/onest-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212; }
@font-face { font-family: Onest; font-weight: 400 700; font-display: swap; src: url('/fonts/onest-cyrillic.woff2') format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Onest; font-weight: 400 700; font-display: swap; src: url('/fonts/onest-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-048F, U+0492-04AF, U+04B2-052F; }

:root {
  color-scheme: light;
  --bg: #e3e6eb;
  --surface: #fbfbfc;
  --surface-2: #f1f3f5;
  --line: #dfe2e7;
  --line-strong: #cbd0d7;
  --line-dark: #a3a9b3;
  --text: #0e1013;
  --muted: #4d535c;
  --faint: #5b616b;
  --accent: #121417;
  --ok: #13704f;
  --warn: #8a6113;
  --warn-soft: #fdf4e3;
  --danger: #a8281c;
  --page: radial-gradient(70% 60% at 85% 110%, #c5cfe6, transparent 62%), radial-gradient(60% 50% at 0 0, #f2f3f5, transparent 70%), var(--bg);
  --sheet: linear-gradient(180deg, rgba(247, 248, 250, .9), rgba(236, 239, 243, .78));
  --edge: rgba(255, 255, 255, .85);
  --sh-3: 0 24px 60px -12px rgba(20, 24, 34, .3), 0 2px 8px rgba(20, 24, 34, .08);
}
* { box-sizing: border-box; }
/* Скрытое скрыто всегда: у экранов свой display, и без этого правила атрибут hidden не работал. */
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--text); background: var(--page);
  font: 15px/1.45 Onest, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* Полосу часов и место под своей нижней панелью Safari на телефоне красит ровным цветом фона: свечения в углах
   обрывались у полосы и над панелью ровной чертой. На телефоне они гаснут к краям — как во входе в CRM. */
@media (pointer: coarse) {
  body { background: linear-gradient(var(--bg), transparent 140px, transparent calc(100% - 140px), var(--bg)), var(--page); }
}
.wrap {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
}
.card {
  width: min(430px, 100%); background: var(--sheet); border-radius: 30px; padding: 34px;
  box-shadow: inset 0 0 0 1px var(--edge), var(--sh-3); display: grid; gap: 22px;
}
.head { display: grid; justify-items: center; gap: 10px; text-align: center; }
/* Знак Sito — тот же, что на входе в CRM: синяя плитка, S из двух скоб и квадрат (скобы въезжают при открытии). */
.mark {
  width: 54px; height: 54px; border-radius: 12px; overflow: hidden; margin-bottom: 4px;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .45);
}
.mark img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.04em; line-height: 1.15; text-wrap: balance; }
h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.03em; }
p { margin: 0; }
.muted { color: var(--muted); font-size: 14px; text-wrap: balance; }
.small { font-size: 13px; }
.screen { display: grid; gap: 16px; }
.screen.center { justify-items: center; text-align: center; }
.step { font-size: 12.5px; font-weight: 600; color: var(--faint); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.hint { color: var(--faint); font-size: 12px; line-height: 1.4; }
.hint.center { text-align: center; }
.hint.bad { color: var(--danger); }
.hint.good { color: var(--ok); }
.input {
  width: 100%; min-width: 0; min-height: 46px; padding: 10px 18px; border-radius: 999px;
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #8a9099; }
.input:hover { border-color: var(--line-dark); }
.input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 4px rgba(18, 20, 23, .08); }
/* Адрес: поле и домен — одной таблеткой; рамка фокуса у всей таблетки. */
.slug {
  display: flex; align-items: center; min-width: 0; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line-strong); transition: border-color .15s, box-shadow .15s;
}
.slug:hover { border-color: var(--line-dark); }
.slug:focus-within { border-color: var(--text); box-shadow: 0 0 0 4px rgba(18, 20, 23, .08); }
.slug .input { border: 0; box-shadow: none; background: transparent; padding-right: 2px; flex: 1 1 auto; }
.suffix { padding-right: 18px; color: var(--faint); font-size: 13px; white-space: nowrap; }
/* Пароль с глазком; нажат — глаз перечёркнут. Caps Lock — меткой прямо в поле. */
.pass { position: relative; display: grid; }
.pass .input { padding-right: 52px; }
.pass-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
  display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--faint); cursor: pointer;
}
.pass-eye:hover { color: var(--text); background: var(--surface-2); }
.pass-eye:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.pass-eye[aria-pressed='true']::after { content: ''; position: absolute; width: 20px; height: 1.7px; border-radius: 1px; background: currentColor; transform: rotate(-40deg); }
.pass.caps::after {
  content: 'Caps Lock'; position: absolute; right: 48px; top: 50%; transform: translateY(-50%); pointer-events: none;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; color: var(--warn); background: var(--warn-soft);
}
.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 48px; width: 100%;
  padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-strong); cursor: pointer;
  background: color-mix(in srgb, var(--surface) 75%, transparent); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none;
}
.btn:hover { background: var(--surface); border-color: var(--line-dark); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .55); }
.btn.primary:hover { background: #000; }
.btn.ghost { width: auto; border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
/* Главная кнопка — «Продолжить с Google»: значок Google на белом кружке, чтобы цвета не тонули в чёрном. */
#go { min-height: 52px; white-space: nowrap; }
.g { flex: none; width: 26px; height: 26px; margin-left: -6px; border-radius: 50%; display: grid; place-items: center; background: #fff; }
/* Адрес под названием: строка с «изменить»; длинный домен переносится, а не раздвигает карточку. */
#slug-line { margin-top: 2px; padding-left: 18px; overflow-wrap: anywhere; }
.linkbtn {
  border: 0; padding: 0; background: none; font: inherit; font-weight: 600; color: var(--text); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.linkbtn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
/* Что выбрано на первом шаге — строкой, с кнопкой вернуться. */
.chosen {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0;
  padding: 10px 10px 10px 18px; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--line);
}
.chosen > div { display: grid; min-width: 0; }
.chosen b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chosen span { font-size: 12.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.error { color: var(--danger); font-size: 13.5px; font-weight: 500; min-height: 19px; margin: -6px 0; }
.error:empty { min-height: 0; margin: 0; }
.aside { text-align: center; font-size: 13.5px; color: var(--muted); text-wrap: balance; }
a { color: var(--text); font-weight: 600; text-underline-offset: 3px; }
.url { font-weight: 650; font-size: 16px; word-break: break-all; }
.done {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: var(--ok); box-shadow: 0 8px 20px -10px rgba(19, 112, 79, .7);
}
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--accent); animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } .btn:active { transform: none; } }
/* Узкий телефон: двадцать четыре пикселя полей карточки съедали бы строку адреса. */
@media (max-width: 380px) {
  .card { padding: 24px 18px; border-radius: 26px; }
  h1 { font-size: 23px; }
  .suffix { font-size: 11.5px; padding-right: 14px; }
  .slug .input { padding-left: 14px; }
}

/* Общий вход: список компаний вошедшего. */
.list { display: grid; gap: 10px; }
.company {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface);
  font: inherit; color: inherit; text-align: left; cursor: pointer; min-height: 56px;
}
.company:hover { border-color: var(--line-dark); }
.company .ava { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; }
.company b { display: block; font-weight: 650; }
.company small { color: var(--muted); }
.company .tag { font-size: 12px; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 2px 8px; }
.company .tag.here { color: var(--muted); background: var(--surface-2); }
.center { text-align: center; }
/* «Всё равно создать новую»: отдельно от списка, чтобы вторую компанию не заводили случайно. */
.more { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Согласие под кнопкой регистрации и документы под карточкой (legal.js). */
.consent { font-size: 12.5px; line-height: 1.45; color: var(--muted); text-align: center; text-wrap: pretty; }
.consent a, .legal a { color: inherit; text-underline-offset: 2px; }
.wrap { align-content: center; gap: 18px; }
.legal {
  width: min(430px, 100%); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px;
  font-size: 12.5px; color: var(--muted);
}
