﻿:root {
  --bg: #f3f4f7;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --accent: #0ea5e9;
  --accent-dark: #0284c7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, #e0f2fe, transparent), var(--bg);
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
}

.card {
  width: min(820px, 100%);
  background: var(--card);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

.form-logo-wrap {
  display: flex;
  justify-content: flex-start;
  margin: 6px 0 14px 6px;
}

.form-logo {
  width: min(300px, 78%);
  height: auto;
  display: block;
}

h1 {
  margin: 0 0 8px 0;
}

.muted {
  margin: 0 0 20px 0;
  color: var(--muted);
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

#extra-fio-fields label {
  margin-top: 10px;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.contract-hint {
  position: relative;
  width: max-content;
  color: var(--accent);
  cursor: help;
}

.contract-popup {
  position: absolute;
  left: 0;
  top: 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.contract-hint:hover .contract-popup {
  opacity: 1;
  transform: translateY(0);
}

.contract-popup img {
  display: block;
  width: 360px;
  height: auto;
}

.jk-hint {
  position: relative;
  width: max-content;
  color: var(--accent);
  cursor: help;
}

.jk-popup {
  position: absolute;
  left: 0;
  top: 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.jk-hint:hover .jk-popup {
  opacity: 1;
  transform: translateY(0);
}

.jk-popup img {
  display: block;
  width: 360px;
  height: auto;
}

.act-hint {
  position: relative;
  width: max-content;
  color: var(--accent);
  cursor: help;
}

.act-popup {
  position: absolute;
  left: 0;
  top: 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.act-hint:hover .act-popup {
  opacity: 1;
  transform: translateY(0);
}

.act-popup img {
  display: block;
  width: 360px;
  height: auto;
}

input {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
}

input.input-invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.field-error {
  display: none;
  margin-top: 2px;
  font-size: 12px;
  color: #b91c1c;
}

button {
  margin-top: 10px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:hover { background: var(--accent-dark); }

.generate-warning {
  margin-top: 8px;
  font-size: 13px;
  color: #b91c1c;
}

.ghost {
  margin-top: 0;
  justify-self: start;
  background: transparent;
  color: var(--accent);
  border: 1px dashed var(--accent);
}

.ghost:hover {
  background: rgba(14, 165, 233, 0.08);
}

.warning {
  margin-top: 14px;
  padding: 16px 18px;
  border: 2px solid #ef4444;
  border-radius: 12px;
  background: #fff5f5;
}

.warning-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #b91c1c;
  margin-bottom: 10px;
}

.warning-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-weight: 800;
}

.warning ol {
  margin: 0 0 0 18px;
  padding: 0;
  color: #7f1d1d;
  font-size: 14px;
  line-height: 1.35;
}

.warning li + li {
  margin-top: 6px;
}

.home-hint {
  position: relative;
  width: max-content;
  color: var(--accent);
  cursor: help;
}

.home-popup {
  position: absolute;
  left: 0;
  top: 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.home-hint:hover .home-popup {
  opacity: 1;
  transform: translateY(0);
}

.home-popup img {
  display: block;
  width: 360px;
  height: auto;
}

.link-logs {
  margin-top: 24px;
}

.link-logs h2 {
  margin: 0 0 10px 0;
  font-size: 20px;
}

.logs-controls {
  display: flex;
  gap: 8px;
  margin: 0 0 12px 0;
}

.logs-controls form {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.logs-table th,
.logs-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  vertical-align: top;
}

.logs-table th {
  background: #f8fafc;
  text-align: left;
}

.logs-table a {
  color: #0369a1;
  word-break: break-all;
}

@media (max-width: 640px) {
  .card {
    padding: 20px 16px;
  }

  .form-logo {
    width: min(250px, 82%);
  }
}
