/* 2. Главная страница и вход. Порядок файлов менять нельзя: следующий перекрывает предыдущий. */
/* Главная: карточка входа с эффектом стекла */
html.dark body.page-home .login-card {
  background: rgba(15, 23, 42, 0.55) !important;
}

body.page-home .login-card {
  background: rgba(30, 41, 59, 0.45);
  border: var(--glass-border);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
}

body.page-home .login-card .form-field label {
  color: #94a3b8;
}

body.page-home .login-card input[type="text"],
body.page-home .login-card input[type="password"] {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.page-home .login-card input[type="text"]:focus,
body.page-home .login-card input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.2);
}

body.page-home .login-card .btn-login {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.page-home .login-card .btn-login:hover {
  background: linear-gradient(135deg, #22d3ee 0%, #237a55 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.3);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field {
  margin-bottom: 4px;
}

.form-field label {
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  color: var(--muted);
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 10px;
  height: 6px;
  margin-top: -3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394a3b8' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  pointer-events: none;
}

body.page-home select {
  margin-bottom: 0;
  background-color: var(--input-bg);
  border-color: rgba(148, 163, 184, 0.22);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.page-home select:focus,
body.page-home input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 183, 130, 0.2);
}

body.page-home input[type="text"],
body.page-home input[type="password"] {
  margin-bottom: 0;
  background-color: var(--input-bg);
  border-color: rgba(148, 163, 184, 0.22);
}

.btn-login {
  margin-top: 18px;
  padding: 16px 20px;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.btn-login.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

.tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.worker-tests-search {
  max-width: 520px;
  margin: 0 auto 24px;
  text-align: left;
}

.worker-tests-search__label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.worker-tests-search__row {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 48px;
  padding: 0 6px 0 14px;
  border-radius: 12px;
  border: 1px solid var(--input-border, #cbd5e1);
  background: var(--input-bg, #fff);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.worker-tests-search__row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 183, 130, 0.2);
}

.worker-tests-search input {
  flex: 1;
  min-width: 0;
  width: auto;
  box-sizing: border-box;
  min-height: 46px;
  padding: 10px 8px 10px 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text);
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.worker-tests-search input::-webkit-search-cancel-button,
.worker-tests-search input::-webkit-search-decoration,
.worker-tests-search input::-webkit-clear-button {
  display: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 0 !important;
  height: 0 !important;
  background: none !important;
}

.worker-tests-search input::-ms-clear,
.worker-tests-search input::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

.worker-tests-search input:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.worker-tests-search__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  opacity: 0.72;
  cursor: pointer;
}

.worker-tests-search__clear svg {
  width: 15px;
  height: 15px;
}

.worker-tests-search__clear:hover,
.worker-tests-search__clear:focus-visible {
  opacity: 1;
  color: #64748b;
  background: rgba(148, 163, 184, 0.14);
  outline: none;
}

html.dark .worker-tests-search__row {
  background: var(--bg);
  border-color: var(--border);
}

html.dark .worker-tests-search input,
html.dark .worker-tests-search input:focus {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

html.dark .worker-tests-search__clear:hover,
html.dark .worker-tests-search__clear:focus-visible {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.16);
}

.worker-tests-search__count {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.worker-tests-empty {
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
}

.test-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  width: 100%;
  padding: 20px 18px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.03);
  position: relative;
  overflow: hidden;
}

.test-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
}

.test-card-done {
  border-color: rgba(148, 163, 184, 0.35);
}

.test-card-locked {
  cursor: default;
}

.test-card-locked:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(148, 163, 184, 0.35);
}

.test-card-locked-reason {
  margin: 8px 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

.test-card-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.test-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.test-card-top .test-card-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.btn-icon-delete {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-icon-delete:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(248, 113, 113, 0.7);
  color: var(--danger-text);
}

.btn-icon-delete svg {
  pointer-events: none;
}

.test-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}


.test-card-score-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.test-card-metric {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 4.75rem;
  padding: 6px 12px 5px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.test-card-metric-value {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.test-card-metric-label {
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: capitalize;
}

.test-card-metric--time-limit {
  border-color: rgba(76, 183, 130, 0.35);
  background: rgba(76, 183, 130, 0.08);
}

.test-card-metric--time-limit .test-card-metric-value {
  color: #0369a1;
}

.test-card-metric--unlimited {
  min-width: 5.25rem;
}

.test-card-metric--unlimited .test-card-metric-value {
  font-size: 1.25rem;
  line-height: 1;
}

.test-card-metric--unlimited .test-card-metric-label {
  text-transform: none;
  font-size: 0.62rem;
  max-width: 4.5rem;
  text-align: center;
  white-space: normal;
}

.test-card-metric--retake {
  min-width: 0;
  width: 100%;
  padding: 8px 10px 7px;
  text-align: center;
}

.test-card-metric--retake .test-card-metric-label {
  order: 1;
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: normal;
}

.test-card-metric--retake .test-card-metric-value {
  order: 2;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.15;
}

.test-card-metric--retake-pass {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.1);
}

.test-card-metric--retake-pass .test-card-metric-value {
  color: #15803d;
}

.test-card-metric--retake-fail {
  border-color: rgba(251, 146, 60, 0.35);
  background: rgba(251, 146, 60, 0.1);
}

.test-card-metric--retake-fail .test-card-metric-value {
  color: #c2410c;
}

.test-card-metric--threshold {
  border-color: rgba(46, 139, 98, 0.35);
  background: rgba(46, 139, 98, 0.1);
}

.test-card-metric--threshold .test-card-metric-value {
  color: #17563c;
}

.test-card-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.test-card-status {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.test-card-status-pass {
  background: #4ade80;
  color: #14532d;
  border: 1px solid #16a34a;
  box-shadow: 0 1px 5px rgba(34, 197, 94, 0.35);
}

.test-card-status-fail {
  background: #f87171;
  color: #7f1d1d;
  border: 1px solid #dc2626;
  box-shadow: 0 1px 5px rgba(239, 68, 68, 0.35);
}

.test-card-status-inactive {
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

button.test-card-status-toggle {
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

button.test-card-status-toggle:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

button.test-card-status-toggle:disabled {
  opacity: 0.6;
  cursor: wait;
}

.test-card-status-new {
  background: rgba(76, 183, 130, 0.12);
  color: #0369a1;
  border-color: rgba(76, 183, 130, 0.4);
}

.test-card-priority,
button.test-card-priority-toggle {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

button.test-card-priority-toggle {
  margin: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

button.test-card-priority-toggle:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

button.test-card-priority-toggle:disabled {
  opacity: 0.6;
  cursor: wait;
}

.test-card-priority--required {
  background: #fef3c7;
  border: 1px solid rgba(217, 119, 6, 0.5);
  color: #b45309;
}

.test-card-priority--additional {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.45);
  color: #475569;
}

.test-card-desc {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
}

.test-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.test-card-meta strong {
  color: var(--text);
  font-weight: 600;
}

.test-card-results-btn {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 4px 0 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(76, 183, 130, 0.35);
  background: rgba(76, 183, 130, 0.12);
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.test-card-results-btn:hover,
.test-card-results-btn:focus-visible {
  background: rgba(76, 183, 130, 0.2);
  border-color: rgba(76, 183, 130, 0.55);
  outline: none;
}

.test-card-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.test-card-start-btn {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.16);
  color: #14532d;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.test-card-start-btn:hover,
.test-card-start-btn:focus-visible {
  background: rgba(34, 197, 94, 0.26);
  border-color: rgba(34, 197, 94, 0.65);
  outline: none;
}

.test-card-attempts-hint {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.test-card-retake-notice--locked {
  margin-bottom: 0;
}

.test-card-done--fail .test-card-locked-reason,
.test-card-done--fail-muted .test-card-locked-reason {
  color: #991b1b;
  font-weight: 600;
}

.worker-review-dialog {
  width: min(720px, 94vw);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
}

.worker-review-loading,
.worker-review-summary {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

.attempt-review-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 0 0 12px;
  font-size: 0.92rem;
  line-height: 1.4;
}

.attempt-review-facts dt {
  color: var(--muted);
}

.attempt-review-facts dd {
  margin: 0;
  color: var(--text);
}

.attempt-review-verdict {
  font-weight: 700;
}

.attempt-review-verdict--pass {
  color: #047857;
}

.attempt-review-verdict--fail {
  color: #b91c1c;
}

.attempt-review-verdict--reset {
  color: #92400e;
}

.attempt-review-annulled,
.attempt-review-warning {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: rgba(245, 158, 11, 0.08);
  font-size: 0.9rem;
  line-height: 1.4;
}

.attempt-review-annulled .attempt-review-facts {
  margin: 0 0 6px;
}

.attempt-review-annulled__title {
  margin: 0 0 6px;
  font-weight: 700;
  color: #92400e;
}

.attempt-review-annulled__note,
.attempt-review-warning p {
  margin: 0;
  color: var(--muted);
}

.attempt-review-warning p + p {
  margin-top: 4px;
}

.worker-review-list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(56vh, 520px);
}

.worker-review-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2, #f8fafc);
}

.worker-review-item.is-correct {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.worker-review-item.is-wrong {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.07);
}

.worker-review-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.worker-review-item__num {
  font-weight: 700;
}

.worker-review-item__mark {
  font-size: 0.82rem;
  font-weight: 700;
}

.worker-review-item.is-correct .worker-review-item__mark {
  color: #047857;
}

.worker-review-item.is-wrong .worker-review-item__mark {
  color: #b91c1c;
}

.worker-review-item__q {
  margin: 0 0 8px;
  line-height: 1.45;
  color: var(--text);
}

.worker-review-item__note {
  margin: -4px 0 8px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
}

.worker-review-item__line {
  margin: 0 0 6px;
  line-height: 1.4;
  color: var(--text);
}

.worker-review-item__line span {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
}

.worker-review-empty {
  color: var(--muted);
  padding: 8px 0;
}

html.dark .test-card-results-btn {
  background: rgba(76, 183, 130, 0.14);
  border-color: rgba(76, 183, 130, 0.35);
  color: #e2e8f0;
}

html.dark .worker-review-item.is-correct .worker-review-item__mark {
  color: #4ade80;
}

html.dark .worker-review-item.is-wrong .worker-review-item__mark {
  color: #f87171;
}

html.dark .attempt-review-verdict--pass {
  color: #4ade80;
}

html.dark .attempt-review-verdict--fail {
  color: #f87171;
}

html.dark .attempt-review-verdict--reset,
html.dark .attempt-review-annulled__title {
  color: #fbbf24;
}

.test-card-static {
  cursor: default;
  display: flex;
  flex-direction: column;
}

.test-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.programs-main {
  width: min(680px, 100%);
  margin: 0;
}

.programs-main h1 {
  margin: 0 0 20px;
  font-size: 1.75rem;
  line-height: 1.2;
}

.programs-card {
  padding: 28px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: var(--surface, #fff);
}

.programs-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.programs-card h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  line-height: 1.2;
}

.programs-card__top p,
.programs-meta {
  margin: 0;
  color: var(--ink-text-muted, #64748b);
  line-height: 1.45;
}

.programs-card .programs-download {
  width: auto;
  flex: 0 0 auto;
  min-width: 148px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 12px;
}

.programs-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.programs-facts li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
}

.programs-facts span {
  color: var(--ink-text-muted, #64748b);
  font-size: 0.78rem;
  line-height: 1.2;
}

.programs-facts strong {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
}

.programs-steps {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.programs-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  line-height: 1.4;
}

.programs-steps li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 999px;
  background: rgba(45, 184, 122, 0.16);
  color: var(--accent, #2db87a);
  font-size: 0.85rem;
  font-weight: 700;
}

html.dark .programs-card {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--ink-text-main, #e2e8f0);
}

html.dark .programs-facts li {
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 640px) {
  .programs-card__top,
  .programs-facts {
    display: grid;
    grid-template-columns: 1fr;
  }

  .programs-download {
    width: 100%;
  }
}



