/* ============================================================
   theme.css — Дизайн-система Fuel (палитра, типографика, кнопки, контролы)
   ============================================================ */

:root {
  --fuel-primary:        #FA5935;
  --fuel-primary-hover:  #E24F31;
  --fuel-primary-active: #C9442B;
  --fuel-primary-soft:   #FFE9E1;

  --fuel-text:           #322A0F;
  --fuel-text-muted:     #7A6F55;
  --fuel-bg:             #FAFAF7;
  --fuel-surface:        #FFFFFF;
  --fuel-border:         #EBEBEB;
  --fuel-gray-1:         #E6E5E5;
  --fuel-gray-2:         #C4C4C4;
  --fuel-gray-3:         #B9B9B9;

  --fuel-success:        #5D9E53;
  --fuel-danger:         #F31700;
  --fuel-warning:        #F7CF46;

  --status-unchanged-bg: #FFFFFF;
  --status-unchanged-fg: #7A6F55;
  --status-modified-bg:  #FFF3BF;
  --status-modified-fg:  #7A4F01;
  --status-added-bg:     #DDF1D8;
  --status-added-fg:     #3F7C36;
  --status-removed-bg:   #FFE0DC;
  --status-removed-fg:   #B11B05;
  --status-invalid-bg:   #FFB7AE;
  --status-invalid-fg:   #7F1D1D;

  --radius:    6px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 2px rgba(50,42,15,.08);
  --shadow-md: 0 6px 18px rgba(50,42,15,.10);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --header-height: 72px;

  font-family: "Golos UI", "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--fuel-text);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--fuel-bg);
  min-height: 100vh;
}

/* ---- Типографика ---- */
h1 { font-size: 26px; font-weight: 700; line-height: 1.3; color: var(--fuel-text); }
h2 { font-size: 20px; font-weight: 600; line-height: 1.35; color: var(--fuel-text); }
h3 { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--fuel-text); }
p  { line-height: 1.6; }

/* ---- Кнопки ---- */
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 120ms, border-color 120ms, color 120ms, box-shadow 120ms;
  white-space: nowrap;
  line-height: 1;
}

.button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(250,89,53,.35);
}

.button:disabled,
.button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.button-green {
  background: var(--fuel-primary);
  color: #fff;
}
.button-green:hover:not(:disabled) { background: var(--fuel-primary-hover); }
.button-green:active:not(:disabled) { background: var(--fuel-primary-active); }

.button-white {
  background: var(--fuel-surface);
  color: var(--fuel-text);
  border: 1px solid var(--fuel-gray-2);
}
.button-white:hover:not(:disabled) {
  background: #FAFAF7;
  border-color: var(--fuel-gray-3);
}

.button-link {
  background: transparent;
  color: var(--fuel-primary);
  padding-left: 0;
  padding-right: 0;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.button-link:hover:not(:disabled) { color: var(--fuel-primary-hover); }

.button--sm { padding: 6px 12px; font-size: 13px; }
.button--lg { padding: 13px 24px; font-size: 15px; }

/* ---- Контролы ---- */
.form-control {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--fuel-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--fuel-text);
  background: var(--fuel-surface);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
  width: 100%;
}
.form-control:hover { border-color: var(--fuel-gray-2); }
.form-control:focus {
  border-color: var(--fuel-primary);
  box-shadow: inset 0 0 0 1px var(--fuel-primary);
}

select.form-control { cursor: pointer; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--fuel-text);
  margin-bottom: var(--space-2);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--fuel-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  top: calc(36px + var(--space-4));
  right: var(--space-5);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  max-width: 380px;
}

.toast {
  background: var(--fuel-text);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toast-in 0.2s ease;
}
.toast-error { background: var(--fuel-danger); }
.toast-success { background: var(--fuel-success); }
.toast-warning { background: #92400E; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---- Tooltip ---- */
.tooltip-wrap {
  position: relative;
  display: inline-block;
}
.tooltip-body {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--fuel-text);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  width: 240px;
  line-height: 1.5;
  z-index: 500;
  pointer-events: none;
  white-space: normal;
  box-shadow: var(--shadow-md);
}
.tooltip-wrap:hover .tooltip-body,
.tooltip-wrap:focus-within .tooltip-body { display: block; }

.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--fuel-gray-2);
  font-size: 11px;
  font-weight: 600;
  color: var(--fuel-text-muted);
  cursor: default;
  line-height: 1;
  background: transparent;
  font-family: inherit;
}

/* ---- Модалка ---- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(50,42,15,.45);
  backdrop-filter: blur(3px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.modal-backdrop.open { display: flex; }

.modal-window {
  background: var(--fuel-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 480px;
  padding: var(--space-6);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: var(--fuel-text);
}
.modal-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fuel-text);
  margin-bottom: var(--space-4);
}
.modal-footer {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-5);
}
