/* Orito Republic — базовая дизайн-система.
   Editorial fashion: светлый нейтральный фон, чёрные элементы, один акцентный цвет. */

@font-face { font-family: 'Orito'; src: url('../fonts/Poppins-Light.woff') format('woff');   font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Orito'; src: url('../fonts/Poppins-Regular.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Orito'; src: url('../fonts/Poppins-Medium.woff') format('woff');  font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Orito'; src: url('../fonts/Poppins-Bold.woff') format('woff');    font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* Один акцентный цвет — меняется здесь на брендовый Orito Republic */
  --accent: #FF3B00;
  --accent-soft: #FFEDE7;

  --ink: #0A0A0A;
  --ink-70: #454545;
  --ink-50: #767676;
  --ink-30: #A8A8A8;
  --line: #E2DED7;
  --line-strong: #C9C4BA;
  --bg: #F7F5F1;
  --surface: #FFFFFF;
  --surface-2: #F1EEE8;

  --ok: #1F7A44;
  --ok-soft: #E6F3EB;
  --warn: #A66300;
  --warn-soft: #FBF0DE;
  --danger: #C22B1F;
  --danger-soft: #FBE9E7;

  --r-sm: 4px;
  --r: 8px;
  --r-lg: 16px;

  --space: 8px;
  --maxw: 1240px;

  --shadow-sm: 0 1px 2px rgba(10,10,10,.06), 0 4px 12px rgba(10,10,10,.04);
  --shadow: 0 4px 12px rgba(10,10,10,.07), 0 24px 48px rgba(10,10,10,.06);

  --font: 'Orito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 300; letter-spacing: -0.02em; line-height: 1.06; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Типографика */
.display   { font-size: clamp(38px, 9vw, 92px); font-weight: 300; letter-spacing: -0.035em; line-height: .95; }
.h1        { font-size: clamp(30px, 6vw, 52px); font-weight: 300; letter-spacing: -0.03em; line-height: 1.02; }
.h2        { font-size: clamp(22px, 3.6vw, 30px); font-weight: 300; letter-spacing: -0.02em; }
.h3        { font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.body-lg   { font-size: 17px; color: var(--ink-70); }
.muted     { color: var(--ink-50); }
.small     { font-size: 13px; }
.eyebrow {
  font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .16em; color: var(--ink-50);
}
.mono-num { font-variant-numeric: tabular-nums; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px; border: 1px solid var(--ink); background: var(--ink); color: #fff;
  border-radius: 100px; cursor: pointer; text-decoration: none;
  font-size: 14px; font-weight: 500; letter-spacing: .02em;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; background: var(--ink); border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-accent:hover { background: var(--ink); border-color: var(--ink); }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }

/* Поля */
.field { display: block; margin: 0 0 22px; }
.field > label, .label {
  display: block; margin-bottom: 8px;
  font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .13em; color: var(--ink-50);
}
.input, .select, .textarea {
  width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line-strong);
  background: transparent; border-radius: 0; font-size: 17px; outline: none;
  transition: border-color .15s ease;
}
.input:focus, .select:focus, .textarea:focus { border-bottom-color: var(--ink); }
.input::placeholder, .textarea::placeholder { color: var(--ink-30); }
.textarea { resize: vertical; min-height: 108px; line-height: 1.5; padding-top: 8px; }
.select {
  appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230A0A0A' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 2px center;
}
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-bottom-color: var(--danger); }
.field-error { margin-top: 6px; font-size: 12px; color: var(--danger); }
.hint { margin-top: 6px; font-size: 12.5px; color: var(--ink-50); }
.req { color: var(--accent); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Чипы выбора */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: 100px;
  background: transparent; cursor: pointer; font-size: 13.5px; user-select: none;
  transition: all .13s ease; -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.accent[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }

/* Переключатель да/нет */
.toggle-group { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 100px; overflow: hidden; }
.toggle-group button {
  padding: 9px 20px; border: 0; background: transparent; cursor: pointer; font-size: 13.5px;
  transition: all .13s ease;
}
.toggle-group button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Чекбокс */
.check { display: flex; gap: 13px; align-items: flex-start; cursor: pointer; padding: 4px 0; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  flex: 0 0 auto; width: 21px; height: 21px; margin-top: 1px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
  display: grid; place-items: center; transition: all .13s ease; background: var(--surface);
}
.check input:checked + .box { background: var(--ink); border-color: var(--ink); }
.check input:checked + .box::after {
  content: ''; width: 10px; height: 6px; border-left: 1.8px solid #fff; border-bottom: 1.8px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check .check-text { font-size: 14.5px; line-height: 1.45; }

/* Бейджи статусов */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 100px;
  font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .09em;
  border: 1px solid var(--line-strong); background: var(--surface); white-space: nowrap;
}
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-new       { background: var(--accent); border-color: var(--accent); color: #fff; }
.badge-in_review { background: var(--warn-soft); border-color: #E8D5AE; color: var(--warn); }
.badge-approved, .badge-active { background: var(--ok-soft); border-color: #BFE0CD; color: var(--ok); }
.badge-rejected, .badge-consent_withdrawn { background: var(--danger-soft); border-color: #F0C7C2; color: var(--danger); }
.badge-more_info_required { background: var(--warn-soft); border-color: #E8D5AE; color: var(--warn); }
.badge-draft, .badge-archived, .badge-on_hold { background: var(--surface-2); color: var(--ink-50); }

/* Утилиты */
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .35s ease both; }

::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

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