/* Attractum · базовые компоненты: логотип, кнопки, поля, метки.
   Подключается после tokens.css на главной, входе и в кабинете. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--surface); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: var(--tracking-tight); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--lavender-2); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--ink-4); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* Логотип */
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 650; letter-spacing: -.03em; color: var(--ink); line-height: 1; }
.logo-mark { width: 28px; height: 28px; flex: none; border-radius: 7px; }
.logo-word { transform: translateY(1px); }

/* Кнопки */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.btn:hover { --btn-bg: var(--surface-3); }
.btn:active { transform: scale(.975); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn[disabled], .btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-primary { --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: var(--ink); box-shadow: none; }
.btn-primary:hover { --btn-bg: var(--ink-2); --btn-bd: var(--ink-2); }
.btn-accent { --btn-bg: var(--accent); --btn-fg: #fff; --btn-bd: var(--accent); box-shadow: none; }
.btn-accent:hover { --btn-bg: var(--accent-hover); --btn-bd: var(--accent-hover); }
.btn-ghost { box-shadow: none; }
.btn-white { --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: #fff; box-shadow: none; }
.btn-white:hover { --btn-bg: var(--lavender-1); --btn-bd: var(--lavender-1); }
.btn-quiet { --btn-bd: transparent; box-shadow: none; }
.btn-quiet:hover { --btn-bd: transparent; }
.btn-ok { --btn-bg: var(--ok); --btn-fg: #fff; --btn-bd: var(--ok); box-shadow: none; }
.btn-ok:hover { --btn-bg: #0d6b4c; --btn-bd: #0d6b4c; }
.btn-danger { --btn-fg: var(--danger); }
.btn-danger:hover { --btn-bg: var(--danger-soft); --btn-bd: var(--danger-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: var(--r-sm); gap: 6px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15.5px; border-radius: 10px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: var(--r-sm); gap: 4px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-block { width: 100%; }

/* Поля */
.field { display: block; min-width: 0; }
.field-label, .field > .lbl, .field > span, .field > label > span { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.field-hint, .field > .hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-5); }
.input, .field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=password], .field input[type=number], .field input[type=date], .field input[type=url], .field select, .field textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-size: 14.5px; outline: none; box-shadow: var(--shadow-xs);
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.field textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input::placeholder, .field ::placeholder { color: var(--ink-5); }
.input:hover, .field :is(input, select, textarea):hover { border-color: var(--ink-5); }
.input:focus, .field :is(input, select, textarea):focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled, .field :is(input, select, textarea):disabled { background: var(--surface-2); color: var(--ink-5); }
.input-sm { height: 30px; font-size: 13px; border-radius: var(--r-sm); }
select.input, .field select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c6c78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }

/* Метки */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; background: var(--surface-3); color: var(--ink-3); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-4); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: ui-spin .7s linear infinite; }
@keyframes ui-spin { to { transform: rotate(360deg); } }

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