:root {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #f4f8f6;
  --line: #dde7e2;
  --text: #183027;
  --muted: #6a7c74;
  --primary: #2f5b4d;
  --primary-dark: #24483d;
  --primary-soft: #e7f0ec;
  --success: #2f6d53;
  --radius: 18px;
  --shadow: 0 20px 55px rgba(29, 68, 55, .10);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 8%, rgba(47,91,77,.12), transparent 30%),
    radial-gradient(circle at 8% 88%, rgba(86,126,108,.08), transparent 24%),
    var(--bg);
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.siteHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 84px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brandMark {
  width: 42px;
  height: 42px;
  color: var(--primary);
  flex: 0 0 auto;
}

.brandMark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brandText {
  display: grid;
  gap: 2px;
}

.brandText strong {
  font-size: 21px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.045em;
}

.brandText span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

.headerActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.userBadge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 6px 10px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 5px 20px rgba(15,23,42,.05);
}

.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.userBadgeText {
  display: grid;
  gap: 1px;
}

.userBadgeText strong {
  font-size: 11px;
  line-height: 1.2;
}

.userBadgeText span {
  color: var(--muted);
  font-size: 9.5px;
}

.textButton {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.textButton:hover { color: var(--text); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
  gap: 54px;
  align-items: center;
  min-height: calc(100vh - 150px);
  padding: 58px 0 92px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 10px;
  border: 1px solid rgba(47,91,77,.13);
  border-radius: 999px;
  background: rgba(255,255,255,.74);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(47,91,77,.11);
}

h1 {
  max-width: 760px;
  margin: 0;
  color: #183027;
  font-size: clamp(42px, 5.2vw, 72px);
  line-height: .99;
  font-weight: 800;
  letter-spacing: -.06em;
}

.heroLead {
  max-width: 660px;
  margin: 24px 0 0;
  color: #5f7169;
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.55;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
}

.feature {
  min-height: 108px;
  padding: 15px;
  border: 1px solid rgba(227,232,239,.9);
  border-radius: 15px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(8px);
}

.featureIcon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
}

.featureIcon svg {
  width: 16px;
  height: 16px;
}

.feature strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.feature span {
  color: var(--muted);
  font-size: 10.5px;
}

.loginCard,
.dashboardCard {
  border: 1px solid rgba(221,227,235,.95);
  border-radius: 22px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.loginCard {
  padding: 28px;
}

.loginMark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 15px;
  background: var(--primary-soft);
  color: var(--primary);
}

.loginMark svg {
  width: 25px;
  height: 25px;
}

.loginCard h2,
.dashboardHead h1 {
  margin: 0;
  color: #183027;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.loginCard p {
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 12.5px;
}

.telegramSlot {
  min-height: 46px;
  display: flex;
  align-items: center;
}

.telegramWidgetClip {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #54a9eb;
  line-height: 0;
}

.telegramWidgetClip iframe {
  display: block !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
}

.loginHint {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  color: #74857d;
  font-size: 10.5px;
}

.loginHint strong {
  color: #5d7068;
}

.configNotice {
  padding: 13px 14px;
  border: 1px solid #f2d6a3;
  border-radius: 12px;
  background: #fff9ed;
  color: #72551e;
  font-size: 11px;
}

.pageMain {
  padding: 42px 0 82px;
}

.dashboardHead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.dashboardHead p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.clientGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.clientCard {
  display: grid;
  min-height: 184px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(15,23,42,.05);
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.clientCard:hover {
  transform: translateY(-2px);
  border-color: #cadbd3;
  box-shadow: 0 14px 35px rgba(15,23,42,.08);
}

.clientTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.clientIcon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}

.clientIcon svg {
  width: 20px;
  height: 20px;
}

.accessPill {
  padding: 5px 7px;
  border-radius: 999px;
  background: #eef3f1;
  color: #6e7f77;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.clientCard h2 {
  margin: 22px 0 0;
  font-size: 16px;
  letter-spacing: -.025em;
}

.clientMeta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  color: var(--muted);
  font-size: 10.5px;
}

.clientMeta b {
  color: var(--text);
}

.emptyState {
  padding: 34px;
  border: 1px dashed #cad8d1;
  border-radius: 18px;
  background: rgba(255,255,255,.66);
  text-align: center;
}

.emptyState h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.emptyState p {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.telegramId {
  display: inline-block;
  margin-top: 14px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #edf3f0;
  color: #5d7068;
  font: 600 10px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.siteFooter {
  padding: 24px 0 34px;
  color: #809088;
  font-size: 10px;
}

.siteFooter .shell {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(216,223,232,.85);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 38px;
  }

  .loginCard {
    max-width: 520px;
  }

  .clientGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 26px, 1180px);
  }

  .siteHeader {
    min-height: 72px;
  }

  .brandText span {
    display: none;
  }

  .userBadgeText {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 38px 0 70px;
  }

  h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .features {
    grid-template-columns: 1fr;
  }

  .feature {
    min-height: 0;
  }

  .loginCard {
    padding: 22px;
  }

  .dashboardHead {
    align-items: flex-start;
    flex-direction: column;
  }

  .clientGrid {
    grid-template-columns: 1fr;
  }

  .siteFooter .shell {
    flex-direction: column;
    gap: 6px;
  }
}


.homeFlash {
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid #d7e2dc;
  border-radius: 12px;
  background: #f4f8f5;
  color: #2f5b4d;
  font-size: 12px;
  font-weight: 700;
}

.homeFlash.error {
  border-color: #ead4d1;
  background: #fff6f4;
  color: #9f3a31;
}

.onboarding {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 42px;
  align-items: center;
  min-height: calc(100vh - 210px);
}

.onboarding h1 {
  max-width: 650px;
}

.onboarding > div > p {
  max-width: 620px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.onboardingCard {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}

.formLabel {
  display: block;
  margin-bottom: 7px;
  color: #5f6c7f;
  font-size: 11px;
  font-weight: 700;
}

.formInput {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
}

.formInput:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47,91,77,.10);
}

.actionButton {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.actionButton.primary {
  background: var(--primary);
  color: #fff;
}

.actionButton.primary:hover {
  background: var(--primary-dark);
}

.formHint {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 10.5px;
}

@media (max-width: 800px) {
  .onboarding {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: auto;
  }
}


.languageForm {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.languageSwitch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(47,91,77,.14);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.languageOption {
  min-width: 36px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #75827c;
  font: 800 10px/1 Inter, system-ui, sans-serif;
  letter-spacing: .025em;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.languageOption:hover {
  background: rgba(47,91,77,.07);
  color: var(--primary);
}

.languageOption.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 3px 8px rgba(47,91,77,.18);
  cursor: default;
}

.languageOption:focus-visible {
  outline: 2px solid rgba(47,91,77,.32);
  outline-offset: 2px;
}
