/* Signum base styles. Visual design is handled by Tailwind (see base.html.twig). */
:root { color-scheme: light; }

body {
    background: linear-gradient(155deg, #eceae2 0%, #f4eede 46%, #f2e2ac 100%);
    background-attachment: fixed;
    color: #1c1c1a;
    -webkit-font-smoothing: antialiased;
}

::selection { background: #fbf1c9; }

/* Motion tokens reused across the cabinet (modal, toast, menus). */
@keyframes signum-fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes signum-overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes signum-toast-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* Rendered Markdown content (legal documents, CMS pages) — shared by
   templates/public/legal/show.html.twig and templates/public/page.html.twig. */
.doc-content {
    max-width: none;
    font-size: 15px;
    line-height: 1.625;
    color: #6b625b; /* text-sub */
}
.doc-content h1, .doc-content h2, .doc-content h3 { color: #1c1c1a; font-weight: 600; }
.doc-content h1 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 0.75rem; }
.doc-content h2 { font-size: 1.25rem; margin-top: 1.75rem; margin-bottom: 0.75rem; }
.doc-content h3 { font-size: 1.125rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.doc-content p { margin-bottom: 1rem; }
.doc-content ul, .doc-content ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.doc-content ul { list-style-type: disc; }
.doc-content ol { list-style-type: decimal; }
.doc-content a { color: #1c1c1a; text-decoration: underline; }
.doc-content img { margin: 1rem 0; border-radius: 0.5rem; }
.doc-content table { margin: 1rem 0; width: 100%; border-collapse: collapse; }
.doc-content td, .doc-content th {
    border: 1px solid #ece7d9; /* border-line */
    padding: 0.5rem 0.75rem;
}
.doc-content th { text-align: left; font-weight: 600; }
.doc-content blockquote {
    border-left: 2px solid #ece7d9; /* border-line */
    padding-left: 1rem;
    color: #8a8178; /* text-muted */
}

/* Signum select — styled listbox over a native <select>
   (assets/controllers/select_controller.js). */
.sg-select { position: relative; }

/* The native control stays in the DOM (name, value, validation) but out of sight. The
   descendant selector keeps this ahead of the Tailwind utilities left on the no-JS fallback. */
.sg-select > .sg-select__native {
    position: absolute;
    bottom: 0;
    left: 12px;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.sg-select__button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ece7d9; /* line */
    border-radius: 11px;
    background: #fff;
    font: inherit;
    font-size: 15px;
    color: #1c1c1a; /* ink */
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.sg-select__button:hover:not(:disabled) { border-color: #d9d0bd; }
.sg-select__button:focus-visible,
.sg-select[data-open='true'] .sg-select__button {
    border-color: transparent;
    outline: none;
    box-shadow: 0 0 0 2px #f2ce3e; /* gold */
}
.sg-select__button:disabled { background: #f6f3ea; color: #a89f94; cursor: not-allowed; }

.sg-select__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-select__value--placeholder { color: #a89f94; /* muted2 */ }

.sg-select__chevron { flex-shrink: 0; color: #8a8178; transition: transform 0.18s ease; }
.sg-select[data-open='true'] .sg-select__chevron { transform: rotate(180deg); }

/* Compact variant (inline filters, table toolbars). */
.sg-select--sm .sg-select__button { padding: 9px 12px; border-radius: 10px; font-size: 13px; }
/* Pill variant (analytics header). */
.sg-select--pill .sg-select__button {
    padding: 8px 14px;
    border-radius: 9999px;
    background: #faf7ee; /* cream */
    font-size: 13.5px;
    font-weight: 500;
}

.sg-select__panel {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 180px;
    max-height: 264px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #ece7d9;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 40px -14px rgba(40, 25, 20, 0.4);
    animation: signum-fade-up 0.16s ease;
}
.sg-select__panel[hidden] { display: none; }
.sg-select--up .sg-select__panel { top: auto; bottom: calc(100% + 6px); }

.sg-select__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 9px 11px;
    border-radius: 9px;
    font-size: 14.5px;
    line-height: 1.35;
    color: #1c1c1a;
    cursor: pointer;
}
.sg-select__option[data-active='true'] { background: #faf7ee; }
.sg-select__option[aria-selected='true'] { font-weight: 600; }
.sg-select__option[aria-disabled='true'] { color: #a89f94; cursor: not-allowed; }
.sg-select__option--placeholder { color: #a89f94; }
.sg-select__option-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sg-select__check { flex-shrink: 0; color: #1c1c1a; opacity: 0; }
.sg-select__option[aria-selected='true'] .sg-select__check { opacity: 1; }

.sg-select__group + .sg-select__group { margin-top: 4px; }
.sg-select__group-label {
    padding: 8px 11px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #a89f94;
}

/* Signum file field — drop zone over a native <input type="file">
   (assets/controllers/file_upload_controller.js). */
.sg-file__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.sg-file__zone {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1.5px dashed #d9d0bd;
    border-radius: 14px;
    background: #fdfbf5;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.sg-file__zone:hover { border-color: #f2ce3e; background: #faf7ee; }
.sg-file__input:focus-visible + .sg-file__zone {
    border-color: transparent;
    box-shadow: 0 0 0 2px #f2ce3e;
}
.sg-file[data-dragging='true'] .sg-file__zone { border-color: #f2ce3e; background: #fbf1c9; }
.sg-file[data-filled='true'] .sg-file__zone { display: none; }
.sg-file--error .sg-file__zone { border-color: #a83a3a; }

.sg-file__icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f0ece1; /* tint */
    color: #6b625b;
}
.sg-file__text { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.sg-file__title { font-size: 14.5px; font-weight: 500; color: #1c1c1a; }
.sg-file__hint { font-size: 12.5px; color: #a89f94; }
.sg-file__browse {
    margin-left: auto;
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #ece7d9;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #1c1c1a;
}

.sg-file__selected {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #ece7d9;
    border-radius: 14px;
    background: #fff;
}
.sg-file__selected[hidden] { display: none; }
.sg-file__badge {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #1c1c1a;
    color: #f2ce3e;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.sg-file__meta { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.sg-file__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14.5px;
    font-weight: 500;
    color: #1c1c1a;
}
.sg-file__size { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12px; color: #a89f94; }
.sg-file__remove {
    display: flex;
    margin-left: auto;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    color: #8a8178;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.sg-file__remove:hover { background: #f4e2e0; color: #a83a3a; }

/* Signum toast (rendered by assets/signum.js). */
.signum-toast {
    position: fixed;
    bottom: 1.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.75rem;
    background: #1c1c1a;
    color: #f2ede4;
    padding: 0.875rem 1.375rem;
    font-size: 14px;
    box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5);
    animation: signum-toast-in 0.24s ease;
}
.signum-toast::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: #6fbf94;
}

/* Редактор справочного центра (assets/controllers/help_editor_controller.js).

   Текст внутри редактора оформлен ровно теми же правилами, что и опубликованная
   статья: обёртке проставлен класс `pub`, корню Quill контроллер добавляет
   `doc-content`, а styles/public.css подключён на странице формы — так типографика
   не дублируется числами здесь и не разъезжается с публичной страницей.
   Ниже — только обвязка вокруг текста: рамка, панель инструментов, поля. */
.help-editor {
    border: 1px solid #ece7d9; /* border-line */
    border-radius: 11px;
    overflow: hidden;
    background: var(--pub-bg);
    font-family: 'Schibsted Grotesk', 'Inter', system-ui, sans-serif;
}
.help-editor .ql-toolbar.ql-snow {
    border: 0;
    border-bottom: 1px solid var(--pub-line-soft);
    background: var(--pub-card);
    padding: 8px 10px;
    font-family: inherit;
}
.help-editor .ql-container.ql-snow { border: 0; font-family: inherit; font-size: inherit; }
.help-editor .ql-editor {
    min-height: 340px;
    padding: 30px max(24px, calc((100% - 74ch) / 2));
}
/* Меру строки (74ch из .pub .doc-content) держим отступами, а не max-width: иначе
   на широкой карточке справа осталась бы мёртвая зона, где не ставится курсор.

   Селектор намеренно специфичнее `.pub .doc-content` (0-3-0 против 0-2-0), а не
   равен ему по весу: при переходе на форму по ссылке Turbo дописывает public.css
   в конец head, то есть *после* app.css, и правило равного веса проиграло бы по
   порядку — колонка текста оказывалась бы обрезанной до 74ch до первой перезагрузки. */
.help-editor .ql-editor.doc-content { max-width: none; }
/* Quill подсвечивает активные кнопки синим — уводим в золото/чернила палитры. */
.help-editor .ql-toolbar.ql-snow .ql-stroke { stroke: rgba(20, 18, 14, 0.62); }
.help-editor .ql-toolbar.ql-snow .ql-fill { fill: rgba(20, 18, 14, 0.62); }
.help-editor .ql-toolbar.ql-snow .ql-picker { color: rgba(20, 18, 14, 0.72); }
.help-editor .ql-toolbar.ql-snow button:hover .ql-stroke,
.help-editor .ql-toolbar.ql-snow button:focus .ql-stroke,
.help-editor .ql-toolbar.ql-snow button.ql-active .ql-stroke { stroke: var(--pub-gold-deep); }
.help-editor .ql-toolbar.ql-snow button:hover .ql-fill,
.help-editor .ql-toolbar.ql-snow button:focus .ql-fill,
.help-editor .ql-toolbar.ql-snow button.ql-active .ql-fill { fill: var(--pub-gold-deep); }
.help-editor .ql-toolbar.ql-snow .ql-picker-label:hover,
.help-editor .ql-toolbar.ql-snow .ql-picker-label.ql-active,
.help-editor .ql-toolbar.ql-snow .ql-picker-item:hover,
.help-editor .ql-toolbar.ql-snow .ql-picker-item.ql-selected { color: var(--pub-gold-deep); }
.help-editor .ql-toolbar.ql-snow .ql-picker-label:hover .ql-stroke,
.help-editor .ql-toolbar.ql-snow .ql-picker-label.ql-active .ql-stroke { stroke: var(--pub-gold-deep); }
.help-editor .ql-snow .ql-picker-options {
    border: 1px solid var(--pub-line);
    border-radius: 10px;
    background: var(--pub-card);
    box-shadow: var(--pub-shadow-float);
}
/* Диалог вставки ссылки — тем же светлым карточным стилем. */
.help-editor .ql-snow .ql-tooltip {
    border: 1px solid var(--pub-line);
    border-radius: 10px;
    background: var(--pub-card);
    box-shadow: var(--pub-shadow-float);
    color: var(--pub-ink);
}
.help-editor .ql-snow .ql-tooltip input[type=text] {
    border: 1px solid var(--pub-line-mid);
    border-radius: 7px;
    padding: 4px 8px;
}
.help-editor .ql-snow .ql-tooltip a.ql-action,
.help-editor .ql-snow .ql-tooltip a.ql-remove { color: var(--pub-gold-text); }
