/* enterprise/assets/ent.css — оформление Nirva Enterprise.
 *
 * Самостоятельный файл, не наследует assets/css/main.css: это другой продукт
 * на другом домене, и он должен выглядеть строже личной Nirva — там золото и
 * тепло, здесь рабочий инструмент.
 *
 * --ent-accent приходит из базы (ent_companies.accent_color) и подставляется в
 * inline-стиль <body>. В PHP он ОБЯЗАТЕЛЬНО проходит через
 * EntCompanyRepository::safeAccentColor() — без этой проверки строка из базы
 * становится CSS-инъекцией на все страницы компании.
 */

:root {
    --ent-accent:  #0f766e;   /* перекрывается компанией через inline-стиль */
    --ent-bg:      #f6f7f9;
    --ent-card:    #ffffff;
    --ent-t1:      #16202e;
    --ent-t2:      #48586b;
    --ent-t3:      #7b8798;
    --ent-bd:      #e3e7ec;
    --ent-danger:  #c0392b;
    --ent-radius:  14px;
}

* { box-sizing: border-box; }

body.ent {
    margin: 0;
    background: var(--ent-bg);
    color: var(--ent-t1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

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

.ent-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top));
    background: var(--ent-accent);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}
.ent-header__back,
.ent-header__exit {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    opacity: .85;
    flex: 0 0 auto;
}
.ent-header__back { font-size: 22px; line-height: 1; }
.ent-header__title {
    flex: 1 1 auto;
    font-weight: 700;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Основная колонка ────────────────────────────────────────────────────── */

.ent-main {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px 16px calc(40px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Плашка приватности. Намеренно неяркая: она должна быть на каждом экране и
   при этом не кричать — иначе её перестают читать через день. */
.ent-note {
    background: color-mix(in srgb, var(--ent-accent) 8%, #fff);
    border: 1px solid color-mix(in srgb, var(--ent-accent) 22%, #fff);
    border-radius: var(--ent-radius);
    padding: 12px 14px;
    font-size: 13px;
    color: var(--ent-t2);
}

.ent-card {
    background: var(--ent-card);
    border: 1px solid var(--ent-bd);
    border-radius: var(--ent-radius);
    padding: 16px;
}
.ent-card--muted { opacity: .65; }
.ent-card__title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.ent-card__meta  { font-size: 14px; color: var(--ent-t3); }

/* Крупное число — остаток разборов. */
.ent-metric {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--ent-accent);
    margin: 4px 0 6px;
}

/* ── Формы ───────────────────────────────────────────────────────────────── */

.ent-form { display: flex; flex-direction: column; gap: 14px; }

.ent-field { display: flex; flex-direction: column; gap: 6px; }
.ent-field label { font-size: 13px; font-weight: 600; color: var(--ent-t2); }
.ent-field input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--ent-bd);
    border-radius: 10px;
    font-size: 16px;   /* 16px обязательны: меньше — и iOS зумит страницу при фокусе */
    font-family: inherit;
    background: #fff;
    color: var(--ent-t1);
}
.ent-field input:focus {
    outline: none;
    border-color: var(--ent-accent);
}

/* Выбор «есть аккаунт / нет аккаунта». Человек выбирает сам, сервер не
   подсказывает: иначе форма превращается в проверялку, кто зарегистрирован. */
.ent-modes { display: flex; flex-direction: column; gap: 8px; }
.ent-mode {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--ent-bd);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}
.ent-mode input { accent-color: var(--ent-accent); }

.ent-btn {
    display: inline-block;
    padding: 13px 18px;
    border: none;
    border-radius: 10px;
    background: var(--ent-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.ent-btn:disabled { opacity: .5; cursor: default; }

.ent-error {
    background: rgba(192, 57, 43, .08);
    border: 1px solid rgba(192, 57, 43, .28);
    color: var(--ent-danger);
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 14px;
}

/* ── Экраны входа и подключения ──────────────────────────────────────────── */

body.ent--auth { background: var(--ent-bg); }

.ent-auth {
    max-width: 440px;
    margin: 0 auto;
    padding: 40px 16px calc(40px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ent-auth__brand {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.4px;
    text-align: center;
}
.ent-auth__brand span { color: var(--ent-accent); }
.ent-auth__sub {
    text-align: center;
    font-size: 14px;
    color: var(--ent-t3);
    margin-top: -10px;
}
.ent-auth__note {
    font-size: 13px;
    color: var(--ent-t3);
    text-align: center;
}

/* Экран согласия. Читается до того, как человек окажется внутри, поэтому
   список, а не абзац: правила должны просматриваться за пять секунд. */
.ent-consent {
    background: var(--ent-card);
    border: 1px solid var(--ent-bd);
    border-radius: var(--ent-radius);
    padding: 16px;
}
.ent-consent__title { font-weight: 700; margin-bottom: 10px; }
.ent-consent__list {
    margin: 0;
    padding-left: 18px;
    font-size: 14px;
    color: var(--ent-t2);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ent-consent__list b { color: var(--ent-t1); }

/* ── Кабинет руководителя ────────────────────────────────────────────────── */

.ent-ok {
    background: color-mix(in srgb, var(--ent-accent) 10%, #fff);
    border: 1px solid color-mix(in srgb, var(--ent-accent) 30%, #fff);
    border-radius: var(--ent-radius);
    padding: 13px 14px;
    font-size: 14px;
    color: var(--ent-t1);
}

/* Поле со ссылкой регистрации. readonly и моноширинный: ссылку копируют
   целиком, а не правят, и в моноширинном видно, что она не обрезана. */
.ent-copy {
    width: 100%;
    margin-top: 8px;
    padding: 9px 10px;
    border: 1px solid var(--ent-bd);
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    background: #fff;
    color: var(--ent-t1);
}

.ent-hint {
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--ent-t3);
    line-height: 1.45;
}
.ent-hint b { color: var(--ent-t2); }

/* Строка человека: слева кто, справа остаток разборов. Ничего о содержании
   его разборов здесь не появляется и появиться не может. */
.ent-person {
    padding: 12px 0;
    border-top: 1px solid var(--ent-bd);
}
.ent-person:first-of-type { border-top: none; padding-top: 4px; }
.ent-person__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.ent-person__name {
    font-weight: 600;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.ent-person__credits {
    font-size: 22px;
    font-weight: 800;
    color: var(--ent-accent);
    flex: 0 0 auto;
}

.ent-tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: lowercase;
    padding: 2px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ent-accent) 12%, #fff);
    color: var(--ent-accent);
}

/* Форма в одну строку — начисление и отзыв. */
.ent-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.ent-inline input {
    width: 70px;
    padding: 7px 9px;
    border: 1px solid var(--ent-bd);
    border-radius: 8px;
    font-size: 16px;   /* 16px: меньше — и iOS зумит страницу при фокусе */
    font-family: inherit;
    background: #fff;
    color: var(--ent-t1);
}

.ent-btn--sm { padding: 7px 12px; font-size: 13px; }
.ent-btn--ghost {
    background: transparent;
    color: var(--ent-t3);
    border: 1px solid var(--ent-bd);
}

.ent-invites { margin-top: 14px; }
.ent-invite {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 9px 0;
    border-top: 1px solid var(--ent-bd);
    font-size: 14px;
}
.ent-invite__label { font-weight: 600; }
.ent-invite__state { color: var(--ent-t3); font-size: 13px; }
.ent-invite__state--ok { color: var(--ent-accent); font-weight: 600; }

/* ── Лендинг ─────────────────────────────────────────────────────────────── */
/* Публичная страница продукта. Оформление строже кабинета: сюда приходит
   руководитель, который ещё ничего не купил, и первое, что ему нужно, —
   быстро понять границы приватности, а не любоваться градиентами. */

body.ent--landing { background: #fff; }

.lnd-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 960px;
    margin: 0 auto;
    padding: 18px 16px;
    padding-top: calc(18px + env(safe-area-inset-top));
}
.lnd-top__brand { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.lnd-top__brand span { color: var(--ent-accent); }
.lnd-top__login {
    color: var(--ent-t2);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.lnd-hero {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 16px 48px;
}
.lnd-hero__title {
    margin: 0;
    font-size: 34px;
    line-height: 1.2;
    letter-spacing: -.6px;
    font-weight: 800;
}
.lnd-hero__lead {
    margin: 18px 0 0;
    font-size: 17px;
    line-height: 1.55;
    color: var(--ent-t2);
    max-width: 640px;
}
.lnd-hero__cta {
    margin-top: 26px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.lnd-btn--big { padding: 15px 26px; font-size: 16px; }
.lnd-link {
    color: var(--ent-accent);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--ent-accent) 35%, #fff);
}

/* Видно только владельцу до настройки: ссылка в никуда хуже честной надписи. */
.lnd-nocontact {
    font-size: 14px;
    color: var(--ent-danger);
    border: 1px dashed currentColor;
    border-radius: 8px;
    padding: 10px 14px;
}

.lnd-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 44px 16px;
}
.lnd-section--alt {
    max-width: none;
    background: var(--ent-bg);
}
.lnd-section--alt > * { max-width: 960px; margin-left: auto; margin-right: auto; }

.lnd-h2 {
    margin: 0 0 12px;
    font-size: 25px;
    line-height: 1.25;
    letter-spacing: -.4px;
    font-weight: 800;
}
.lnd-sub {
    margin: 0 0 28px;
    font-size: 15.5px;
    line-height: 1.55;
    color: var(--ent-t2);
    max-width: 640px;
}

.lnd-rules { display: grid; gap: 18px; }
.lnd-rule {
    background: var(--ent-card);
    border: 1px solid var(--ent-bd);
    border-radius: var(--ent-radius);
    padding: 20px;
}
.lnd-rule__num {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--ent-accent) 12%, #fff);
    color: var(--ent-accent);
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 12px;
}
.lnd-rule__title { font-weight: 700; font-size: 17px; margin-bottom: 7px; }
.lnd-rule__text  { font-size: 14.5px; line-height: 1.55; color: var(--ent-t2); }

.lnd-steps { display: grid; gap: 16px; }
.lnd-step {
    border-left: 2px solid color-mix(in srgb, var(--ent-accent) 35%, #fff);
    padding: 2px 0 2px 16px;
}
.lnd-step__n {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--ent-accent);
}
.lnd-step__t { font-weight: 700; font-size: 16.5px; margin: 5px 0 6px; }
.lnd-step__d { font-size: 14.5px; line-height: 1.55; color: var(--ent-t2); }

.lnd-cols { display: grid; gap: 20px; }
.lnd-col__t { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.lnd-col__d { font-size: 14.5px; line-height: 1.55; color: var(--ent-t2); }

.lnd-final {
    max-width: 960px;
    margin: 0 auto;
    padding: 44px 16px 56px;
    border-top: 1px solid var(--ent-bd);
}

.lnd-foot {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--ent-bd);
    font-size: 13px;
    color: var(--ent-t3);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lnd-foot__muted a { color: var(--ent-accent); }

/* Две колонки с планшета. На телефоне всё в одну — иначе карточки правил
   сжимаются до нечитаемой ширины. */
@media (min-width: 720px) {
    .lnd-rules { grid-template-columns: repeat(3, 1fr); }
    .lnd-steps { grid-template-columns: repeat(2, 1fr); gap: 24px 28px; }
    .lnd-cols  { grid-template-columns: repeat(2, 1fr); gap: 26px 32px; }
    .lnd-hero { padding-top: 56px; padding-bottom: 64px; }
    .lnd-hero__title { font-size: 44px; }
}
