:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --ink: #101820;
  --muted: #5d6872;
  --line: rgba(16, 24, 32, 0.13);
  --card: rgba(255, 255, 255, 0.96);
  --green: #1f8a70;
  --green-dark: #12614f;
  --blue: #22577a;
  --red: #b42318;
  --amber: #f4b942;
  --shadow: 0 18px 50px rgba(16, 24, 32, 0.12);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(34, 87, 122, 0.13), transparent 330px),
    var(--bg);
  letter-spacing: 0;
}

body.is-busy {
  cursor: progress;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 18px 16px 108px;
}

.hero {
  padding: 18px 0 12px;
}

.brand-row {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: stretch;
}

.brand-row > div {
  display: flex;
  min-height: 54px;
  flex-direction: column;
  justify-content: space-between;
  padding: 1px 0;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 10px 24px rgba(31, 138, 112, 0.28);
  font-weight: 900;
}

.brand-home {
  color: inherit;
  text-decoration: none;
}

.brand-home:focus-visible {
  outline: 3px solid rgba(39, 212, 146, 0.45);
  outline-offset: 4px;
}

.eyebrow {
  margin: 0;
  color: var(--green-dark);
  font-size: 21px;
  line-height: 1;
  font-weight: 900;
  text-transform: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 400px;
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-carousel {
  position: relative;
  width: 100%;
  max-width: 430px;
  aspect-ratio: 16 / 9;
  margin: 18px auto 16px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  touch-action: pan-y;
}

.hero-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 320ms ease;
  will-change: transform;
}

.hero-visual {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.hero-carousel-control {
  display: none;
}

.hero-carousel-prev {
  left: 10px;
}

.hero-carousel-next {
  right: 10px;
}

.hero-carousel-dots {
  position: absolute;
  right: 0;
  bottom: 10px;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 7px;
}

.hero-carousel-dots button {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: rgba(16, 24, 32, 0.26);
  cursor: pointer;
}

.hero-carousel-dots button[aria-current="true"] {
  width: 20px;
  background: var(--green);
}

.lead {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.hero-actions {
  display: grid;
  gap: 10px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 10px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.2;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.plan-list,
.info-grid,
.app-links {
  display: grid;
  gap: 10px;
}

.plan-card,
.checkout-form,
.info-block,
.app-links a,
.restore-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 8px 26px rgba(16, 24, 32, 0.06);
}

.restore-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 18px 0 4px;
  padding: 14px;
}

.restore-card h2 {
  margin-bottom: 4px;
  font-size: 17px;
}

.restore-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.restore-card-stack {
  grid-template-columns: 1fr;
}

.recover-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.recover-form input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.recover-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 138, 112, 0.14);
}

.plan-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  border-color: var(--line);
  cursor: pointer;
}

.plan-card strong,
.plan-card b {
  display: block;
  font-size: 18px;
}

.plan-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.plan-card em {
  display: inline-flex;
  margin-bottom: 7px;
  border-radius: 999px;
  padding: 4px 8px;
  color: #312200;
  background: var(--amber);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.plan-card.is-selected {
  border-color: rgba(31, 138, 112, 0.62);
  outline: 2px solid rgba(31, 138, 112, 0.16);
}

.plan-card-featured {
  background: linear-gradient(180deg, rgba(31, 138, 112, 0.08), rgba(255, 255, 255, 0.96));
}

.plan-card-discount {
  background: linear-gradient(180deg, rgba(34, 87, 122, 0.08), rgba(255, 255, 255, 0.96));
}

.plan-card-discount em {
  color: #fff;
  background: var(--blue);
}

.checkout-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.checkout-form label {
  display: grid;
  gap: 7px;
}

.checkout-form label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.checkout-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.checkout-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 138, 112, 0.14);
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

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

.button-primary:disabled {
  background: #7aa99c;
  cursor: progress;
}

.button-secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
}

.button-telegram {
  color: #fff;
  background: #229ed9;
  box-shadow: 0 10px 24px rgba(34, 158, 217, 0.18);
}

.form-note,
.form-error {
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.42;
}

.form-note {
  color: var(--muted);
}

.form-error {
  color: var(--red);
  font-weight: 800;
}

.form-note.is-error {
  color: var(--red);
  font-weight: 800;
}

.info-block {
  padding: 15px;
}

.info-block h2 {
  margin-bottom: 6px;
  font-size: 17px;
}

.info-block p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.app-links {
  grid-template-columns: 1fr;
}

.app-links a {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
}

.app-links a::after {
  content: ">";
  color: var(--muted);
}

.sticky-buy {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  width: min(492px, calc(100% - 28px));
  margin: 0 auto;
  border: 1px solid rgba(16, 24, 32, 0.15);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 42px rgba(16, 24, 32, 0.18);
  backdrop-filter: blur(16px);
}

.sticky-buy div {
  display: grid;
  gap: 2px;
}

.sticky-buy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.sticky-buy strong {
  font-size: 18px;
}

.sticky-buy .button {
  min-width: 128px;
}

.result-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--green-dark);
  background: rgba(31, 138, 112, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.vpn-link-box {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.vpn-link-list {
  display: grid;
  gap: 12px;
}

.vpn-link-item {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.vpn-link-item:first-child {
  padding-top: 0;
  border-top: 0;
}

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

.vpn-link-head strong,
.vpn-link-head small {
  display: block;
}

.vpn-link-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.vpn-link-head b {
  color: var(--green-dark);
  font-size: 13px;
  white-space: nowrap;
}

.vpn-link-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.vpn-link-actions .button {
  min-height: 46px;
  padding: 0 8px;
  font-size: 13px;
  line-height: 1.08;
  white-space: normal;
}

.button-danger {
  border-color: rgba(178, 63, 63, 0.28);
  color: #8a2525;
  background: rgba(255, 247, 244, 0.88);
}

.renew-options {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(31, 138, 112, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: rgba(31, 138, 112, 0.06);
}

.renew-options[hidden] {
  display: none;
}

.renew-options p {
  margin: 0;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.renew-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.renew-option {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.renew-option strong,
.renew-option span {
  font-size: 13px;
  line-height: 1.1;
}

.renew-option span {
  color: var(--green-dark);
  font-weight: 900;
  white-space: nowrap;
}

.renew-option:disabled {
  color: var(--muted);
  cursor: progress;
}

.config-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
}

.muted-text {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

@media (min-width: 560px) {
  .page-shell {
    padding-top: 28px;
  }

  h1 {
    font-size: 22px;
  }
}

@media (max-width: 370px) {
  .restore-card,
  .recover-form,
  .result-actions {
    grid-template-columns: 1fr;
  }

  .button {
    white-space: normal;
  }

}
