/* Основа для всех страниц, включая полноэкранные редакторы:
   токены оформления (светлая и тёмная тема), атрибут hidden и общие
   элементы, которые рисует static/js/core.js — уведомления, плашки
   статусов и модальное окно. Стили самих страниц — в career.css и
   файлах приложений. */

/* Атрибут hidden всегда сильнее display из классов */
[hidden] {
  display: none !important;
}

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #edf0f6;
  --surface-3: #e4e9f2;
  --line: #e2e7f0;
  --line-2: #d2d9e6;
  --text: #161a22;
  --text-2: #3c434f;
  --muted: #6e7787;
  --faint: #99a2b2;
  --brand: #d62839;
  --brand-strong: #bc1f2f;
  --brand-text: #c81e2d;
  --brand-soft: #fce7e8;
  --on-brand: #ffffff;
  --green-text: #15935a;
  --green-soft: #e2f3ea;
  --amber-text: #b7770c;
  --amber-soft: #fbeeda;
  --red-text: #c81e2d;
  --red-soft: #fce7e8;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 18px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 36px rgba(16, 24, 40, 0.12);

  --font: 'Onest', system-ui, -apple-system, sans-serif;
}

[data-theme='dark'] {
  --bg: #0e1117;
  --surface: #161b23;
  --surface-2: #1d2330;
  --surface-3: #28303d;
  --line: #262d3a;
  --line-2: #333c4b;
  --text: #e8ebf1;
  --text-2: #b7bfcd;
  --muted: #838c9c;
  --faint: #5e6573;
  --brand: #e63e4b;
  --brand-strong: #ec5460;
  --brand-text: #ff8a92;
  --brand-soft: rgba(230, 62, 75, 0.17);
  --on-brand: #ffffff;
  --green-text: #5fcf97;
  --green-soft: rgba(43, 168, 106, 0.16);
  --amber-text: #f0c070;
  --amber-soft: rgba(215, 154, 58, 0.16);
  --red-text: #ff8a92;
  --red-soft: rgba(230, 62, 75, 0.17);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.52);
}

.cr-toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 36px));
}
.cr-toast {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  animation: cr-toast-in 0.2s ease;
}
.cr-toast-error {
  background: var(--red-soft);
  color: var(--red-text);
}
.cr-toast-ok {
  background: var(--green-soft);
  color: var(--green-text);
}
@keyframes cr-toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cr-spin {
  to {
    transform: rotate(360deg);
  }
}
.cr-busy {
  cursor: progress;
  pointer-events: none;
}
.cr-busy::before {
  content: '';
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: cr-spin 0.7s linear infinite;
}
.cr-busy:not(.cr-chip)::before {
  margin-right: 8px;
}

.cr-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.cr-tone-green {
  background: var(--green-soft);
  color: var(--green-text);
}
.cr-tone-amber {
  background: var(--amber-soft);
  color: var(--amber-text);
}
.cr-tone-red {
  background: var(--red-soft);
  color: var(--red-text);
}
.cr-tone-muted {
  background: var(--surface-2);
  color: var(--muted);
}
.cr-pill.is-outlined {
  box-shadow: inset 0 0 0 1px currentColor;
}

.cr-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
}
.cr-modal.open {
  display: flex;
}
.cr-modal-card {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.cr-modal-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.cr-modal-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.5;
}
.cr-modal-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.cr-modal-textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  line-height: 1.55;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.cr-modal-textarea:focus {
  border-color: var(--brand);
}
.cr-modal-input {
  width: 100%;
  height: 42px;
  margin-bottom: 6px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}
.cr-modal-input:focus {
  border-color: var(--brand);
}
.cr-modal-error {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--red-text);
}
.cr-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.cr-modal-actions > button {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
}
.cr-modal-btn-cancel {
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
}
.cr-modal-btn-cancel:hover {
  background: var(--surface-2);
}
.cr-modal-btn-primary {
  border: none;
  background: var(--brand);
  color: var(--on-brand);
}
.cr-modal-btn-primary:hover {
  background: var(--brand-strong);
}
.cr-modal-btn-primary:disabled {
  background: var(--surface-2);
  color: var(--faint);
  cursor: not-allowed;
}
