:root {
  color-scheme: dark;
  --bg: #090b14;
  --surface: #121625;
  --surface-raised: #191e32;
  --ink: #f4f4ff;
  --muted: #aeb7d1;
  --line: #303854;
  --violet: #c3b2ff;
  --cyan: #80f4ed;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: radial-gradient(ellipse at 90% 0, #23183e 0, transparent 38rem), var(--bg);
  color: var(--ink);
  font: 16px/1.55 "Segoe UI", system-ui, sans-serif;
}
.top, main, footer { width: min(1200px, calc(100% - 56px)); margin-inline: auto; }
.top { display: flex; align-items: center; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.logo { font-size: 32px; font-weight: 800; letter-spacing: -.08em; color: var(--ink); text-decoration: none; }
.logo span { color: var(--cyan); margin-left: 3px; }
nav { display: flex; gap: 6px; margin-left: auto; }
nav button, .quiet { background: transparent; color: var(--muted); }
nav button[aria-current] { background: var(--surface-raised); color: var(--ink); border-color: #575279; }
main { flex: 1; padding: clamp(28px, 5vw, 65px) 0 56px; }
.hero {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  min-height: 540px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(24px, 6vw, 80px);
  border: 1px solid #40365e;
  border-radius: 32px;
  background: radial-gradient(ellipse at 85% 40%, #382265, transparent 62%), linear-gradient(135deg, #151a2e, #121328 75%);
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(#a79ce019 1px, transparent 1px), linear-gradient(90deg, #a79ce019 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(100deg, transparent 12%, black 85%);
}
.hero h1 {
  max-width: 9ch;
  font-size: clamp(52px, 7vw, 96px);
  line-height: .92;
  letter-spacing: -.075em;
}
.hero h1 span { color: var(--violet); }
.hero p { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 40ch; margin: 27px 0 28px; }
.demo-card {
  min-width: 0;
  position: relative;
  padding: clamp(16px, 3vw, 30px);
  border: 1px solid #6f5e99;
  border-radius: 24px;
  background: linear-gradient(155deg, #221e3e, #101626);
  box-shadow: 0 24px 70px #060816aa, 0 0 50px #8250c529;
}
.hero .demo-title { display: flex; align-items: center; gap: 10px; margin: 0 0 24px; color: var(--muted); font-size: 15px; }
.demo-title::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px #80f4ed80; }
.example { display: grid; gap: 11px; }
.example .bubble { max-width: 90%; width: fit-content; padding: 10px 14px; border: 1px solid #504969; border-radius: 15px 15px 15px 4px; background: #28243f; animation: arrive .55s both; }
.example .bubble:nth-child(2) { justify-self: end; border-radius: 15px 15px 4px 15px; background: #19383e; border-color: #376268; animation-delay: .13s; }
.example-result { margin-top: 9px; padding: 15px; border: 1px solid #685995; border-radius: 14px; color: var(--muted); background: #1d1b36; animation: arrive .6s .27s both; }
.example-result strong { display: block; color: var(--violet); margin-bottom: 5px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(34px, 5vw, 61px); line-height: 1.05; letter-spacing: -.055em; margin-bottom: 24px; }
h2, legend { font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -.025em; }
.workspace { display: grid; grid-template-columns: 1.12fr 1fr; gap: 18px; align-items: start; }
.panel { padding: clamp(18px, 3vw, 32px); background: linear-gradient(145deg, #171c30, var(--surface) 65%); border: 1px solid var(--line); border-radius: 22px; min-width: 0; }
.results { border-top-color: #8671c2; }
#analysis:not([hidden]), #account:not([hidden]) { animation: arrive .32s ease-out both; }
.tariffs { margin-top: 18px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 12px; }
input:not([type=radio], [type=checkbox]), textarea, select {
  display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #0d1120; color: inherit; font: inherit;
}
::placeholder { color: #919ab7; }
textarea { resize: vertical; }
.mode { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 9px; }
.mode label { padding: 7px 12px; background: #1b2036; border: 1px solid var(--line); border-radius: 10px; }
.mode label:has(input:checked) { border-color: #8772bd; color: var(--violet); }
input[type=radio], input[type=checkbox] { accent-color: var(--violet); }
.primary, button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 15px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface-raised);
  color: var(--ink); cursor: pointer; font: inherit; font-weight: 650; text-decoration: none;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.primary { background: linear-gradient(120deg, #c8b6ff, #8cefe9); color: #111424; border-color: transparent; }
.primary:hover { box-shadow: 0 7px 24px #a593ee49; transform: translateY(-2px); }
button:not(.primary):hover { border-color: #8978ae; background: #262b42; }
button:disabled { opacity: .65; cursor: wait; transform: none; }
button.primary:disabled::after { content: ""; width: 12px; height: 12px; margin-left: 9px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
a { color: var(--cyan); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.hint { color: var(--muted); }
.output { white-space: pre-wrap; overflow-wrap: anywhere; }
.output:not(:empty) { margin-bottom: 18px; }
.output p { padding: 13px; background: #202843; border-radius: 10px; animation: arrive .27s ease-out; }
#notice { padding: 12px 16px; background: #143432; color: #c2fff3; border: 1px solid #2f6864; border-radius: 10px; }
#notice[data-error] { background: #3b2034; border-color: #79516c; color: #ffd4e7; }
.plan { border: 1px solid var(--line); background: #151a2c; border-radius: 15px; padding: 18px; margin-bottom: 12px; }
.plan h3, .plan p { margin: 0 0 8px; }
.plan h3 { color: var(--violet); }
.check { font-weight: 400; }
footer { display: flex; flex-wrap: wrap; gap: 12px 23px; padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted); }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 800px) {
  .hero, .workspace { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero h1 { max-width: none; }
  .demo-card { max-width: 540px; }
}
@media (max-width: 450px) {
  .top, main, footer { width: calc(100% - 28px); }
  .top { gap: 5px; }
  .top button { padding-inline: 8px; }
  .hero { padding: 21px; border-radius: 23px; }
  .hero h1 { font-size: clamp(39px, 11vw, 52px); }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.password-login { margin-top: 16px; max-width: 370px; }
.password-login summary { color: var(--cyan); cursor: pointer; width: fit-content; }
.password-login form { margin-top: 12px; }
#confirm-telegram { margin-left: 12px; }
