/* GrexStack — базовые токены и компоненты (визуальный язык Guardora / orbit) */
:root {
  --bg: #f5f6f0;
  --surface: #fff;
  --surface-2: #f0f3e9;
  --field: #f6f8f1;
  --text: #202e24;
  --text-dim: #65725f;
  --text-faint: #73816e;
  --border: #dfe5d8;
  --border-strong: #c6d1bd;
  --field-border: #d6dfcc;
  --accent: #daf69b;
  --accent-hi: #e7ffbb;
  --accent-line: #c7e287;
  --accent-deep: #8eaf41;
  --accent-ink: #1a2b12;
  --link: #536d30;
  --focus: #6b8c38;
  --dark: #14251b;
  --dark-2: #17281e;
  --dark-line: #30442b;
  --on-dark: #eaf5db;
  --on-dark-dim: #b3c0aa;
  --on-dark-faint: #8fa583;
  --lime: #d9efa9;
  --danger: #b2172b;
  --danger-bg: #fff0f1;
  --ok: #3f6129;
  --ok-bg: #edf5e0;
  --radius: 13px;
  --radius-sm: 10px;
  --font: "Inter", "Helvetica Neue", Arial, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: .01em;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
/* На тёмных панелях кольцо фокуса светлое, иначе его не видно */
.lp-hero, .lp-plan--hot, .lp-config__sum, .lp-console, .auth__panel--action { --focus: #d9efa9; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 300; padding: 12px 16px; border-radius: 10px;
  background: var(--surface); color: var(--dark); font-weight: 600; transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* SVG-спрайт с градиентом логотипа: не display:none, иначе градиенты не рисуются */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 44px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 600; letter-spacing: .02em; line-height: 1.2; white-space: nowrap;
  text-decoration: none; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background .2s, border-color .2s, box-shadow .2s, color .2s, transform .2s;
}
.btn:hover { background: #f7f9f2; border-color: #b7c6aa; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { border-color: var(--accent-line); background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 1px 0 #fff7, 0 6px 18px #99b24214; }
.btn.primary:hover { background: var(--accent-hi); box-shadow: 0 10px 26px #a4c45b30; }
.btn.dark { border-color: #192d1c; background: #192d1c; color: #ecf7da; }
.btn.dark:hover { background: #2d4826; border-color: #2d4826; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: #20302408; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 12px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn .arr { font-weight: 500; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid #1a2b1240; border-top-color: var(--accent-ink); border-radius: 50%; animation: gs-spin .7s linear infinite;
}
.btn.dark.busy::after { border-color: #ecf7da40; border-top-color: #ecf7da; }
.btn.busy:disabled { opacity: 1; cursor: wait; }

/* ---------- Поля ---------- */
label.field { display: block; margin-bottom: 18px; }
label.field > span:first-child, .field-label { display: block; margin-bottom: 8px; font-size: 12px; color: #5e6f56; letter-spacing: .02em; }
.field-opt { color: var(--text-faint); font-weight: 400; }
input, select, textarea {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 10px;
  background: var(--field); border: 1px solid var(--field-border); color: var(--text);
  font-size: 14px; outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #8f9b88; }
input:hover, textarea:hover { border-color: #c3cfb7; }
input:focus, select:focus, textarea:focus { background: #fff; border-color: #9fbf6c; box-shadow: 0 0 0 4px #a5cb6926; }
input[aria-invalid="true"] { border-color: #e38b96; background: #fffafa; }
input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px #e38b9626; }
input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #f3f8e6 inset; -webkit-text-fill-color: var(--text); }
.field-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-dim); }

.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 52px; }
.pass-toggle {
  position: absolute; top: 0; right: 0; width: 50px; height: 48px; padding: 0; border: 0; border-radius: 0 10px 10px 0;
  display: grid; place-items: center; background: transparent; color: #7d8a75; cursor: pointer;
}
.pass-toggle:hover { color: var(--text); }
.pass-toggle svg { width: 20px; height: 20px; }

/* Чекбокс (как checks.css в Guardora) */
.check { display: flex; align-items: flex-start; gap: 11px; font-size: 13px; line-height: 1.55; color: var(--text-dim); cursor: pointer; }
.check input[type="checkbox"] {
  flex: none; width: 20px; height: 20px; min-width: 20px; margin: 1px 0 0; padding: 0;
  border: 2px solid #aeb8b6; border-radius: 5px; background: var(--surface) center / 100% 100% no-repeat;
  box-shadow: none; cursor: pointer; transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.check input[type="checkbox"]:hover { border-color: #7c8886; }
.check input[type="checkbox"]:focus { box-shadow: none; }
.check input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 3px #c2e22c73; }
.check input[type="checkbox"]:checked {
  border-color: var(--accent-deep); background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.6 8.3l2.9 2.9 5.9-6.1' fill='none' stroke='%231a2b12' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.check input[type="checkbox"][aria-invalid="true"] { border-color: #e38b96; }
.check a { font-weight: 600; }

/* ---------- Сообщения ---------- */
.note { display: none; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.6; margin-bottom: 18px; }
.note.show { display: block; animation: gs-note .22s ease; }
.note.err { background: var(--danger-bg); color: var(--danger); }
.note.ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Общие элементы бренда ---------- */
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font: 11px/1.4 var(--mono); letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-dim); }
.eyebrow i { flex: none; width: 5px; height: 5px; border-radius: 50%; background: #dcf7a6; box-shadow: 0 0 15px #dcf7a6; }

.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--text); font-size: 22px; font-weight: 700; letter-spacing: -.7px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--dark); box-shadow: inset 0 1px 0 #ffffff14; }
.brand__mark svg { width: 25px; height: 25px; }

/* 3D-«стек» серверов: общий примитив для главной и страниц входа */
.gs-stack {
  --w: 190px; --h: 40px; --d: 110px; --gap: 12px;
  position: relative; width: var(--w); height: calc(var(--n, 4) * var(--h) + (var(--n, 4) - 1) * var(--gap));
  transform-style: preserve-3d; transform: rotateX(-18deg) rotateY(-34deg);
  transition: height .8s var(--ease);
}
.gs-blade { position: absolute; left: 0; top: calc(var(--i) * (var(--h) + var(--gap))); width: var(--w); height: var(--h); transform-style: preserve-3d; transition: top .8s var(--ease), transform .8s var(--ease); }
.gs-face { position: absolute; display: block; border: 1px solid #b7d19380; backface-visibility: hidden; }
.gs-face--front {
  inset: 0; display: flex; align-items: center; gap: 7px; padding: 0 13px; border-radius: 6px;
  background: linear-gradient(120deg, #d4e7a9, #94b767); transform: translateZ(calc(var(--d) / 2));
  box-shadow: inset 0 2px 0 #eeffd070, 0 0 30px #badb5810; transition: background .8s;
}
.gs-face--right { top: 0; width: var(--d); height: var(--h); left: calc((var(--w) - var(--d)) / 2); background: linear-gradient(90deg, #6c894f, #90af6b); transform: rotateY(90deg) translateZ(calc(var(--w) / 2)); }
.gs-face--top { left: 0; width: var(--w); height: var(--d); top: calc((var(--h) - var(--d)) / 2); border-radius: 5px; background: linear-gradient(145deg, #edffc7, #b5d887); transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); }
.gs-blade__id { font: 600 9px var(--mono); letter-spacing: .8px; color: #3f5a27; }
.gs-blade__vents { flex: 1; height: 10px; margin: 0 4px; border-radius: 2px; background: repeating-linear-gradient(90deg, #5d7a3d55 0 3px, transparent 3px 6px); }
.gs-led { flex: none; width: 5px; height: 5px; border-radius: 50%; background: #ebffc7; box-shadow: 0 0 8px #f0ffca; animation: gs-led 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
.gs-led + .gs-led { animation-delay: calc(var(--i) * -.6s - 1.1s); }

@keyframes gs-spin { to { transform: rotate(360deg); } }
@keyframes gs-note { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes gs-led { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes gs-orbit { from { transform: rotateX(64deg) rotateY(-26deg) rotateZ(0); } to { transform: rotateX(64deg) rotateY(-26deg) rotateZ(360deg); } }
@keyframes gs-spin-y { from { transform: rotateZ(-17deg) rotateY(0); } to { transform: rotateZ(-17deg) rotateY(360deg); } }

/* Кнопка «Отключить анимации» + системная настройка уменьшения движения */
.motion-toggle { padding: 0; min-height: 0; border: 0; background: transparent; color: var(--text-dim); font-size: 12px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.motion-toggle:hover { color: var(--text); }
.anim-paused *, .offscreen, .offscreen * { animation-play-state: paused !important; }
[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* iOS не увеличивает страницу при фокусе, если шрифт поля ≥ 16px */
@media (max-width: 720px), (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
}

/* Не разрывать слово с дефисом при переносе строки */
.nobr { white-space: nowrap; }
