:root {
  --bg: #06070c;
  --text: #f4f6fb;
  --muted: rgba(226, 232, 255, .64);
  --faint: rgba(226, 232, 255, .4);
  --line: rgba(255, 255, 255, .12);
  --glass: rgba(255, 255, 255, .055);
  --field: rgba(255, 255, 255, .06);
  --accent: #c4b5fd;
  --err: #fb7185;
  --iri: linear-gradient(100deg, #9be7ff 0%, #c4b5fd 30%, #f9a8d4 55%, #fde68a 75%, #9be7ff 100%);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; -webkit-tap-highlight-color: transparent;
  padding-bottom: 96px;
}
h1, h2 { margin: 0; letter-spacing: -.03em; line-height: 1.1; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: #c4b5fd; color: var(--bg); }

.wrap { width: min(760px, 100% - 32px); margin-inline: auto; }

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg i { position: absolute; border-radius: 50%; filter: blur(100px); opacity: .4; }
.bg i:nth-child(1) { width: 60vmax; height: 60vmax; left: -20vmax; top: -24vmax; background: #2b6fff; }
.bg i:nth-child(2) { width: 50vmax; height: 50vmax; right: -22vmax; top: 20vh; background: #8b5cf6; opacity: .32; }
.bg i:nth-child(3) { width: 44vmax; height: 44vmax; left: 10vw; bottom: -30vmax; background: #ec4899; opacity: .2; }

.iri { background: var(--iri); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 0 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.logo svg { width: 24px; height: 24px; fill: #c4b5fd; filter: drop-shadow(0 0 10px rgba(196, 181, 253, .6)); }
.saved { font-size: 13px; color: var(--faint); transition: opacity .4s; }

.main { display: grid; gap: 18px; padding-top: 28px; }
.intro { padding: 10px 0 14px; }
.label { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.intro h1 { font-size: clamp(32px, 6.4vw, 52px); font-weight: 800; }
.lead { margin-top: 14px; color: var(--muted); font-size: 16.5px; max-width: 62ch; }
.hint { margin-top: 12px; font-size: 14px; color: var(--faint); }

.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: 26px; padding: 26px;
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.card__title { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.card__title span {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: var(--iri); color: var(--bg); font-size: 15px; font-weight: 800; letter-spacing: 0;
}

.tariffs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tariff {
  text-align: left; cursor: pointer; padding: 16px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--field); display: grid; gap: 4px; transition: border-color .25s, background .25s, transform .25s var(--ease);
}
.tariff b { font-size: 16px; }
.tariff span { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.tariff em { font-style: normal; font-size: 14px; font-weight: 700; margin-top: 6px; }
.tariff:hover { border-color: rgba(255, 255, 255, .28); }
.tariff[aria-checked="true"] { border-color: transparent; background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--iri) border-box; border: 1.5px solid transparent; }
.tariff[aria-checked="true"] em { background: var(--iri); -webkit-background-clip: text; background-clip: text; color: transparent; }

.form { display: grid; gap: 18px; }
.form:empty { display: none; }
.fields { display: grid; gap: 22px; }

.f { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.f[hidden] { display: none; }
.f__l { font-weight: 600; font-size: 15.5px; padding: 0; }
legend.f__l { float: left; width: 100%; }
.f__l i { font-style: normal; color: var(--accent); margin-left: 4px; }
.f__h { font-size: 13.5px; color: var(--faint); margin-top: -4px; }

.in {
  width: 100%; min-height: 50px; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--field); outline: none; font-size: 16px; transition: border-color .2s, background .2s, box-shadow .2s;
}
textarea.in { min-height: 96px; resize: vertical; line-height: 1.5; }
.in::placeholder { color: rgba(226, 232, 255, .3); }
.in:focus { border-color: rgba(196, 181, 253, .7); background: rgba(255, 255, 255, .09); box-shadow: 0 0 0 4px rgba(196, 181, 253, .14); }
.f--err .in, .f--err .chips { border-color: var(--err); box-shadow: 0 0 0 4px rgba(251, 113, 133, .14); border-radius: 14px; }
.f--err .f__l { color: var(--err); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  cursor: pointer; padding: 10px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--field);
  font-size: 14.5px; line-height: 1.3; text-align: left; transition: background .2s, border-color .2s, color .2s;
}
.chip:hover { border-color: rgba(255, 255, 255, .3); }
.chip[aria-checked="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.chip[aria-checked="true"]::before { content: "✓ "; }
.other { margin-top: 2px; }

.colors { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sw { position: relative; width: 52px; height: 52px; }
.sw input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sw i { display: block; width: 100%; height: 100%; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); box-shadow: inset 0 0 0 3px var(--bg); pointer-events: none; }
.sw button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); font-size: 13px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.add {
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, .28); background: none; font-size: 14.5px; color: var(--muted); justify-self: start;
}
.add:hover { color: var(--text); border-color: rgba(255, 255, 255, .5); }
.add--round { width: 52px; height: 52px; padding: 0; justify-content: center; font-size: 22px; }

.rows { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 26px 1fr 44px; gap: 8px; align-items: start; }
.row__n { padding-top: 14px; font-size: 13px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.row__c { display: grid; gap: 8px; grid-template-columns: var(--cols, 1fr); }
.row__x { width: 44px; height: 50px; border-radius: 14px; border: 1px solid var(--line); background: none; color: var(--faint); font-size: 20px; cursor: pointer; }
.row__x:hover { color: var(--err); border-color: var(--err); }

.btn {
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 13px 22px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--field); font-weight: 600; font-size: 15.5px;
  color: var(--text); text-decoration: none; transition: transform .25s var(--ease), background .2s;
}
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn:active { transform: scale(.97); }
.btn--main { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--main:hover { background: #fff; }
.btn--sm { min-height: 44px; padding: 10px 20px; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.files { margin-top: 22px; padding: 18px; border-radius: 18px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.files:empty { display: none; }
.files b { display: block; font-size: 15px; margin-bottom: 10px; }
.files ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.files li { position: relative; padding-left: 22px; font-size: 14.5px; color: var(--muted); }
.files li::before { content: ""; position: absolute; left: 3px; top: 8px; width: 8px; height: 8px; transform: rotate(45deg); border-radius: 2px; background: var(--iri); }
.tools { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; }
.link { cursor: pointer; background: none; border: 0; padding: 6px 0; font-size: 14px; color: var(--faint); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: rgba(6, 7, 12, .78); border-top: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.bar__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bar__p { flex: 1; display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 8px; row-gap: 6px; max-width: 320px; }
.bar__p b { font-size: 17px; }
.bar__p span { font-size: 13.5px; color: var(--muted); }
.bar__p i { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.bar__p em { display: block; height: 100%; width: 0; background: var(--iri); border-radius: 4px; transition: width .5s var(--ease); }

.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 20; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 14.5px; font-weight: 600;
  transition: opacity .3s, transform .3s var(--ease); text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .card { padding: 20px 16px; border-radius: 22px; }
  .card__title { font-size: 19px; }
  .tariffs { grid-template-columns: 1fr; }
  .tariff { grid-template-columns: 1fr auto; align-items: baseline; padding: 14px 16px; }
  .tariff span { grid-column: 1 / -1; grid-row: 2; }
  .tariff em { margin-top: 0; grid-column: 2; grid-row: 1; }
  .row__c { grid-template-columns: 1fr; }
  .row { grid-template-columns: 20px 1fr 44px; }
  .actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
