:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d8dee6;
  --accent: #1473e6;
  --accent-dark: #0d5fc3;
  --ok: #0f7b45;
  --client: #8a4b00;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.panel {
  width: min(980px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 18px 42px rgba(23, 32, 42, 0.10);
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 10px;
  font-size: 17px;
  letter-spacing: 0;
}

p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.45;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 8px;
}

label:not(:first-of-type) {
  margin-top: 14px;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 115, 230, 0.14);
}

button {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.secondary {
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 0 12px;
  background: #eef4ff;
  color: var(--accent-dark);
}

.secondary:hover {
  background: #dceaff;
}

.session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.session-card strong,
.session-card span {
  display: block;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.accounts {
  margin-top: 18px;
}

.login-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.account-option {
  display: block;
  width: 100%;
  min-height: auto;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.account-option:hover {
  border-color: var(--accent);
  background: #f8fbff;
}

.account-option strong,
.account-option span {
  display: block;
}

.account-option span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.result {
  display: none;
  margin-top: 18px;
  padding: 14px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-weight: 700;
}

.result.agent {
  color: var(--ok);
}

.result.client {
  color: var(--client);
}

.error {
  display: none;
  margin-top: 12px;
  color: #b42318;
  font-size: 14px;
  line-height: 1.4;
}

.status-block {
  margin-top: 18px;
  padding: 14px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.4;
}

.balance-card {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f0f7ff 0%, #eef4ff 100%);
}

.balance-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.balance-row strong {
  font-size: 22px;
  color: var(--accent-dark);
}

.balance-extra {
  margin-top: 4px;
  font-size: 12px;
}

.balance-extra:empty {
  display: none;
}

.widget-container {
  margin-top: 18px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

#ekosmotr-technical-inspection-widget {
  min-width: 900px;
}

@media (max-width: 700px) {
  main {
    padding: 12px;
  }

  .panel {
    padding: 18px;
  }

  #ekosmotr-technical-inspection-widget {
    min-width: 640px;
  }
}
