/* Малахитовая Тайга · SSO — один экран, две темы (forest / paper) */

@font-face {
  font-family: "Golos Text";
  src: url("/assets/fonts/GolosText-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Golos Text";
  src: url("/assets/fonts/GolosText-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Golos Text";
  src: url("/assets/fonts/GolosText-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Russo One";
  src: url("/assets/fonts/RussoOne-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --tg-deep: #06251f;
  --tg-forest: #073f35;
  --tg-pine: #0a2f27;
  --tg-moss: #123b31;
  --tg-paper: #f4f6ed;
  --tg-mint: #b8f3cd;
  --tg-malachite: #3fbf8f;
  --tg-malachite-deep: #176857;
  --tg-muted-dark: #8aa79a;
  --tg-muted-light: #546b60;
  --tg-line-dark: rgba(184, 243, 205, 0.14);
  --tg-line-light: #ccd6ca;
  --tg-danger: #e06b5f;
  --tg-warn: #e5b45a;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-ui: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Russo One", var(--font-ui);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 200ms;
}

/* forest (по умолчанию) */
html[data-theme="forest"] {
  --bg: var(--tg-deep);
  --bg-2: var(--tg-forest);
  --surface: rgba(10, 47, 39, 0.78);
  --surface-solid: #0a2f27;
  --surface-2: rgba(184, 243, 205, 0.06);
  --text: #eaf3ec;
  --text-strong: #ffffff;
  --muted: var(--tg-muted-dark);
  --line: var(--tg-line-dark);
  --line-strong: rgba(184, 243, 205, 0.26);
  --accent: var(--tg-mint);
  --accent-2: var(--tg-malachite);
  --btn-bg: linear-gradient(135deg, #c9ffe0, #8fe3b4);
  --btn-ink: #06251f;
  --btn-shadow: 0 10px 30px rgba(63, 191, 143, 0.28);
  --field-bg: rgba(6, 37, 31, 0.55);
  --field-bg-focus: rgba(6, 37, 31, 0.82);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.24), 0 24px 60px rgba(2, 20, 16, 0.45);
  --ring: rgba(184, 243, 205, 0.45);
  --aurora-opacity: 0.55;
  --grain-opacity: 0.05;
  --banner-error-bg: rgba(224, 107, 95, 0.14);
  --banner-error-line: rgba(224, 107, 95, 0.45);
  --banner-ok-bg: rgba(63, 191, 143, 0.14);
  --banner-ok-line: rgba(63, 191, 143, 0.45);
}

/* paper */
html[data-theme="paper"] {
  --bg: var(--tg-paper);
  --bg-2: #e9eee1;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-2: rgba(23, 104, 87, 0.06);
  --text: #103e34;
  --text-strong: #06251f;
  --muted: var(--tg-muted-light);
  --line: var(--tg-line-light);
  --line-strong: #9fb3a4;
  --accent: var(--tg-malachite-deep);
  --accent-2: var(--tg-malachite);
  --btn-bg: linear-gradient(135deg, #1f8a6f, #176857);
  --btn-ink: #f4f6ed;
  --btn-shadow: 0 10px 26px rgba(23, 104, 87, 0.24);
  --field-bg: #ffffff;
  --field-bg-focus: #ffffff;
  --shadow: 0 1px 2px rgba(16, 62, 52, 0.06), 0 22px 50px rgba(16, 62, 52, 0.12);
  --ring: rgba(23, 104, 87, 0.32);
  --aurora-opacity: 0.16;
  --grain-opacity: 0.03;
  --banner-error-bg: #fbe9e6;
  --banner-error-line: #e8b2aa;
  --banner-ok-bg: #e6f4ee;
  --banner-ok-line: #a8d6c5;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

a {
  color: inherit;
}

.link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.link:hover {
  border-color: currentColor;
}

button {
  font: inherit;
  color: inherit;
}

/* ── фон ─────────────────────────────────────────────────────────────── */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(63, 191, 143, 0.12), transparent 62%),
    radial-gradient(900px 600px at 100% 0%, rgba(184, 243, 205, 0.08), transparent 55%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 120%);
}

.aurora {
  position: absolute;
  inset: -20%;
  filter: blur(70px);
  opacity: var(--aurora-opacity);
  mix-blend-mode: screen;
  transition: opacity var(--dur) var(--ease);
}
.aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}
.aurora i:nth-child(1) {
  width: 46vw;
  height: 46vw;
  left: -6%;
  top: 2%;
  background: radial-gradient(circle at 35% 35%, #2fd08a, #0b5b46 68%);
  animation: aurora-a 19s ease-in-out infinite alternate;
}
.aurora i:nth-child(2) {
  width: 38vw;
  height: 38vw;
  right: 2%;
  top: 14%;
  background: radial-gradient(circle at 40% 40%, #7ff0c0, #166b52 70%);
  animation: aurora-b 23s ease-in-out infinite alternate;
}
.aurora i:nth-child(3) {
  width: 30vw;
  height: 30vw;
  left: 34%;
  bottom: -12%;
  background: radial-gradient(circle at 45% 45%, #c9ffe4, #1c7a5e 72%);
  animation: aurora-c 27s ease-in-out infinite alternate;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: var(--grain-opacity);
  background-image: radial-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
}

@keyframes aurora-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6vw, 4vh, 0) scale(1.12); }
}
@keyframes aurora-b {
  from { transform: translate3d(0, 0, 0) scale(1.05); }
  to { transform: translate3d(-5vw, 6vh, 0) scale(0.95); }
}
@keyframes aurora-c {
  from { transform: translate3d(0, 0, 0) scale(0.95); }
  to { transform: translate3d(4vw, -4vh, 0) scale(1.08); }
}

/* ── шапка ───────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
  text-decoration: none;
}
.brand__logo {
  display: block;
  height: 46px;
  width: auto;
}
.brand__logo--paper {
  display: none;
}
html[data-theme="paper"] .brand__logo--forest {
  display: none;
}
html[data-theme="paper"] .brand__logo--paper {
  display: block;
}

.topbar__right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.topbar__host {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.theme-toggle:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.theme-toggle__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(63, 191, 143, 0.16);
}

/* ── раскладка ───────────────────────────────────────────────────────── */

.page {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px, 6vh, 64px) 24px 40px;
}
.page--single {
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(42px, 6.4vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}

.hero__lead {
  max-width: 46ch;
  margin: 24px 0 0;
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--muted);
}

.hero__list {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}
.hero__list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text);
}
.hero__mark {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(63, 191, 143, 0.14);
}
.hero__note {
  max-width: 44ch;
  margin: 28px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ── панель ──────────────────────────────────────────────────────────── */

.panel {
  position: relative;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  animation: panel-in 420ms var(--ease) both;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.panel__head {
  margin-bottom: 20px;
}
.panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.1;
  color: var(--text-strong);
}
.panel__foot {
  margin: 18px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* ── вкладки ─────────────────────────────────────────────────────────── */

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
}
.tab {
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.tab:hover {
  color: var(--text);
}
.tab[aria-selected="true"] {
  background: rgba(184, 243, 205, 0.16);
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px rgba(184, 243, 205, 0.22);
}
html[data-theme="paper"] .tab[aria-selected="true"] {
  background: var(--tg-malachite-deep);
  color: var(--tg-paper);
  box-shadow: none;
}

/* ── формы ───────────────────────────────────────────────────────────── */

.form {
  display: grid;
  gap: 16px;
}
.form[hidden] {
  display: none;
}
.panel-form.is-active {
  display: block;
}

.field {
  display: grid;
  gap: 8px;
}
.label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.input-wrap {
  position: relative;
  display: block;
}
.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field-bg);
  color: var(--text-strong);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.3;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}
.input:hover {
  border-color: var(--line-strong);
}
.input:focus-visible {
  border-color: var(--accent);
  background: var(--field-bg-focus);
  box-shadow: 0 0 0 3px var(--ring);
}
.input-wrap .input {
  padding-right: 92px;
}
.reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.reveal:hover {
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.btn--primary {
  background: var(--btn-bg);
  color: var(--btn-ink);
  box-shadow: var(--btn-shadow);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(63, 191, 143, 0.34);
}
.btn--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}
.btn--ghost:hover {
  border-color: var(--line-strong);
}
.btn--sm {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13.5px;
  border-radius: 10px;
}
.btn[disabled] {
  opacity: 0.62;
  cursor: progress;
}
.btn:focus-visible,
.theme-toggle:focus-visible,
.tab:focus-visible,
.link:focus-visible,
.reveal:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.form .btn--primary {
  margin-top: 4px;
}
.form .btn--primary.is-loading .btn__label {
  opacity: 0.7;
}

.hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.hint .link,
.link-button {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.hint .link:hover,
.link-button:hover {
  border-color: currentColor;
}

/* ── баннеры ─────────────────────────────────────────────────────────── */

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.45;
}
.banner p {
  margin: 0;
  flex: 1 1 220px;
}
.banner__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: currentColor;
}
.banner--error {
  border-color: var(--banner-error-line);
  background: var(--banner-error-bg);
  color: var(--text-strong);
}
.banner--error .banner__dot {
  background: var(--tg-danger);
}
.banner--ok {
  border-color: var(--banner-ok-line);
  background: var(--banner-ok-bg);
  color: var(--text-strong);
}
.banner--ok .banner__dot {
  background: var(--tg-malachite);
}
.banner__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── подвал ──────────────────────────────────────────────────────────── */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px 26px;
  font-size: 12.5px;
  color: var(--muted);
}

.noscript {
  display: none;
}

/* ── адаптив ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 28px;
    padding-top: 28px;
  }
  .hero__list {
    display: none;
  }
  .hero__note {
    display: none;
  }
  .display {
    font-size: clamp(38px, 9vw, 54px);
  }
  .topbar {
    padding: 16px 18px 0;
  }
  .topbar__host {
    display: none;
  }
  .page,
  .footer {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 420px) {
  .brand__logo {
    height: 38px;
  }
  .panel {
    padding: 20px 18px;
    border-radius: var(--radius-lg);
  }
  .tabs {
    gap: 2px;
    padding: 3px;
  }
  .tab {
    padding: 8px 6px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
