/* Витрина портала клиентов ECOFACTOR — первый экран.
   Цвета и «стекло» — из принятого прототипа v2 (web-prototype/index.html): светлая тема по умолчанию,
   тёмная — по настройке устройства. Внешних шрифтов и картинок нет: политика содержимого разрешает только свои файлы. */

:root {
  --bg-page: #EAF2ED;
  --bg-card-grad: linear-gradient(155deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.56) 100%);
  --ink-1: #0F172A;
  --ink-2: #475569;
  --ink-3: #64748B;
  --line: rgba(255, 255, 255, 0.78);
  --line-strong: rgba(15, 38, 25, 0.16);
  --brand: #10B452;
  --brand-hover: #0B9643;
  --brand-text: #0A7434;
  --brand-on: #042410;
  --warn: #B45309;
  --warn-bg: rgba(254, 243, 199, 0.86);
  --warn-line: rgba(245, 158, 11, 0.52);
  --shadow-card: 0 12px 32px -10px rgba(13, 42, 27, 0.10), 0 2px 6px rgba(13, 42, 27, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.94);
  --mesh-a: rgba(16, 180, 82, 0.20);
  --mesh-b: rgba(56, 189, 248, 0.22);
  --mesh-c: rgba(251, 191, 36, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #060A11;
    --bg-card-grad: linear-gradient(155deg, rgba(25, 36, 54, 0.72) 0%, rgba(13, 19, 30, 0.56) 100%);
    --ink-1: #F1F5F9;
    --ink-2: #94A3B8;
    --ink-3: #64748B;
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.18);
    --brand-hover: #3AF185;
    --brand-text: #3AF185;
    --brand-on: #041F0E;
    --warn: #FBBF24;
    --warn-bg: rgba(120, 53, 15, 0.38);
    --warn-line: rgba(251, 191, 36, 0.40);
    --shadow-card: 0 12px 32px -10px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    --mesh-a: rgba(16, 180, 82, 0.16);
    --mesh-b: rgba(56, 189, 248, 0.12);
    --mesh-c: rgba(251, 191, 36, 0.07);
  }
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-1);
  background:
    radial-gradient(60vmax 60vmax at 12% 8%, var(--mesh-a), transparent 60%),
    radial-gradient(55vmax 55vmax at 92% 18%, var(--mesh-b), transparent 62%),
    radial-gradient(50vmax 50vmax at 70% 96%, var(--mesh-c), transparent 60%),
    var(--bg-page);
  background-attachment: fixed;
}

[hidden] {
  display: none !important;
}

.stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 440px;
  padding: 36px 32px 32px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--bg-card-grad);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
}

.brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--brand-text);
}

h1 {
  margin: 14px 0 8px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.lead {
  margin: 0 0 24px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.note {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--ink-3);
}

.button {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: var(--brand-on);
  background: var(--brand);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

.button:hover {
  background: var(--brand-hover);
}

.button:active {
  transform: translateY(1px);
}

.button:focus-visible,
select:focus-visible {
  outline: 3px solid var(--brand-text);
  outline-offset: 3px;
}

.button-quiet {
  margin-top: 24px;
  color: var(--ink-1);
  background: transparent;
  border: 1px solid var(--line-strong);
}

.button-quiet:hover {
  background: rgba(127, 127, 127, 0.10);
}

.alert {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: var(--ink-1);
  font-size: 14px;
}

.alert strong {
  display: block;
  color: var(--warn);
}

.spinner {
  width: 28px;
  height: 28px;
  margin: 28px auto 4px;
  border-radius: 50%;
  border: 3px solid var(--line-strong);
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 3s;
  }
  .button {
    transition: none;
  }
}

.foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
}

select {
  font: inherit;
  color: var(--ink-1);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 4px 8px;
}

select option {
  color: #0F172A;
  background: #FFFFFF;
}

@media (max-width: 420px) {
  .card {
    padding: 28px 22px 24px;
    border-radius: 20px;
  }
  h1 {
    font-size: 23px;
  }
}

/* Кабинет со списком станций. Градиент и прозрачность общие с экраном входа. */
.stage:has(.workspace:not([hidden])) {
  justify-content: flex-start;
  padding: clamp(18px, 3.5vw, 52px) clamp(12px, 4vw, 64px);
}
.workspace { width: min(100%, 1056px); }
.portal-bar, .station-tools { display: flex; align-items: center; gap: 20px; }
.portal-bar { margin: 0 4px 26px; }
.portal-bar .brand { margin: 0 auto 0 0; }
.account { min-width: 0; text-align: end; overflow-wrap: anywhere; }
.account strong, .account span { display: block; }
.account strong { font-size: 15px; }
.account span { font-size: 13px; color: var(--ink-2); }
.workspace .button-quiet {
  width: auto;
  margin: 0;
  padding: 9px 16px;
  border-radius: 12px;
  white-space: nowrap;
}
.station-panel { max-width: none; padding: 0; overflow: hidden; }
.station-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 39%);
  align-items: stretch;
  border-bottom: 1px solid var(--line-strong);
}
.station-heading {
  align-self: center;
  padding: clamp(18px, 3.5vw, 42px);
}
.station-heading h1 {
  margin: 0;
  font-size: clamp(29px, 4vw, 50px);
  letter-spacing: -.045em;
  line-height: 1.07;
}
.station-heading p { margin: 13px 0 0; color: var(--ink-2); }
.station-intro img { display: block; width: 100%; height: 100%; min-height: 156px; object-fit: cover; }
.station-content { padding: clamp(18px, 3.5vw, 42px); }
.station-tools { gap: 14px; align-items: end; justify-content: space-between; }
.station-search-field { display: grid; gap: 5px; width: min(100%, 390px); }
.station-tools label, .station-list thead { font-size: 13px; color: var(--ink-2); }
.station-tools input {
  width: 100%; min-width: 0; height: 43px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--bg-page); color: var(--ink-1); font: inherit;
}
.station-tools input::placeholder { color: var(--ink-2); }
.station-tools input:focus-visible { outline: 3px solid var(--brand-text); outline-offset: 3px; }
.station-tools :disabled { opacity: .6; cursor: default; }
.station-list { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 24px; }
.station-list th, .station-list td {
  text-align: start; vertical-align: top; overflow-wrap: anywhere;
  padding: 15px 10px 15px 0; border-top: 1px solid var(--line-strong);
}
.station-list thead th { border-top: 0; padding-block: 0 10px; font-weight: 500; }
.station-list :is(th, td):last-child { padding-inline-end: 0; }
.station-list th[scope="row"] { font-variant-numeric: tabular-nums; }
.station-list small, .station-list time {
  display: block; margin-top: 3px; color: var(--ink-2); font-size: 13px; font-weight: 400;
}
.connection { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.connection::before { content: ''; width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; }
.connection-online { color: var(--brand-text); }
.connection-offline { color: var(--warn); }
.connection-unknown { color: var(--ink-2); }
.connection-unknown::before { background: transparent; border: 1px solid currentColor; }

@media (max-width: 620px) {
  .portal-bar { gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
  .account { order: 1; width: 100%; text-align: start; }
  .station-intro { grid-template-columns: minmax(0, 1fr) minmax(0, 32%); }
  .station-intro img { min-height: 122px; }
  .station-tools { gap: 8px; }
  .workspace .button-quiet { padding-inline: 12px; }
  .station-list { font-size: 14px; }
  .station-list th, .station-list td { padding-inline-end: 6px; }
}

@media (max-width: 480px) {
  .station-intro img {
    width: calc(100% - 12px); height: auto; min-height: 0;
    align-self: center; border-radius: 12px;
  }
  .station-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .station-search-field { display: contents; }
  .station-tools label { grid-column: 1; grid-row: 1; }
  .station-tools input { grid-column: 1 / -1; grid-row: 2; }
  .station-tools .button { grid-column: 2; grid-row: 1; }
}
