@import url("./design-system.css");

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(var(--rgb-border), 0.84);
  background: rgba(var(--rgb-white), 0.94);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  background: #020b1f url("../img/msgvpn-logo-mark.png") center / 86% auto no-repeat;
  color: transparent;
  box-shadow: var(--shadow-raised);
  font-weight: 900;
  font-size: 0;
}

.brand strong {
  display: block;
  color: var(--color-black);
  font-size: 20px;
  line-height: 1.1;
}

.brand small {
  display: block;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.site-nav {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.site-nav a {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: var(--color-blue-soft);
  color: var(--color-blue-dark);
}

.header-actions,
.hero-actions,
.section-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.site-profile-actions {
  flex-wrap: nowrap;
}

.icon-button,
.profile-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(var(--rgb-border), 0.9);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  color: var(--color-black);
  box-shadow: var(--shadow-button);
}

.icon-button {
  width: 44px;
  padding: 0;
}

.icon-button svg,
.profile-avatar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.planned-action {
  color: var(--color-muted);
  opacity: 0.72;
  cursor: not-allowed;
}

.profile-menu {
  position: relative;
}

.profile-menu summary {
  list-style: none;
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-trigger {
  gap: 10px;
  min-width: 190px;
  padding: 7px 12px 7px 8px;
  cursor: pointer;
  text-align: left;
}

.profile-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--color-blue-soft);
  color: var(--color-blue-dark);
}

.profile-caption {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.profile-caption strong,
.profile-caption small {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-caption strong {
  color: var(--color-black);
  font-size: 14px;
  font-weight: 900;
}

.profile-caption small {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 750;
}

.profile-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 4px;
  width: 236px;
  padding: 8px;
  border: 1px solid rgba(var(--rgb-border), 0.9);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.profile-menu-panel a,
.profile-menu-panel button,
.menu-item-disabled {
  display: flex;
  align-items: center;
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--color-black);
  cursor: pointer;
  font: inherit;
  font-weight: 820;
  text-align: left;
  text-decoration: none;
}

.profile-menu-panel a:hover,
.profile-menu-panel button:hover {
  background: var(--color-blue-soft);
  color: var(--color-blue-dark);
}

.profile-menu-panel form {
  margin: 0;
}

.menu-item-disabled {
  color: var(--color-muted);
  cursor: default;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(var(--rgb-black), 0.16);
  border-radius: var(--radius-button);
  box-shadow: var(--shadow-button);
  color: var(--color-black);
  font-weight: 850;
  text-decoration: none;
  transform: translateY(0);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: var(--shadow-button-pressed);
}

.btn:focus-visible {
  outline: 4px solid rgba(var(--rgb-blue), 0.18);
  outline-offset: 2px;
}

.btn-primary {
  border-color: var(--color-blue);
  background: var(--color-blue);
  color: var(--color-white);
}

.btn-secondary {
  background: var(--color-surface);
}

.btn-success {
  border-color: var(--color-green-dark);
  background: var(--color-green);
  color: var(--color-white);
}

.btn-ghost {
  box-shadow: none;
  background: transparent;
  color: var(--color-muted);
}

.section-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 76px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: 46px;
  min-height: calc(100vh - 150px);
  padding-top: 54px;
  padding-bottom: 58px;
}

.hero-logo {
  display: block;
  width: min(360px, 100%);
  height: auto;
  margin: 0 0 22px;
  border-radius: 16px;
  box-shadow: 0 16px 42px rgba(2, 11, 31, 0.22);
}

.hero-copy h1,
.section-heading h2,
.control-section h2,
.final-cta h2 {
  margin: 0;
  color: var(--color-black);
  letter-spacing: 0;
  line-height: 1.08;
}

.hero-copy h1 {
  max-width: 720px;
  font-size: 58px;
}

.hero-text {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--color-muted);
  font-size: 20px;
}

.hero-note {
  max-width: 560px;
  margin: var(--space-4) 0 0;
  color: var(--color-muted);
  font-weight: 760;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 16px;
  padding: 0 13px;
  border: 1px solid rgba(var(--rgb-green), 0.28);
  border-radius: var(--radius-pill);
  background: var(--color-green-soft);
  color: var(--color-green-dark);
  font-size: 13px;
  font-weight: 900;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 30px;
}

.hero-badges span,
.control-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-blue-dark);
  font-weight: 800;
}

.vpn-preview {
  position: relative;
  padding: 18px;
  border: 1px solid rgba(var(--rgb-border), 0.9);
  border-radius: 28px;
  background: var(--color-bg-deep);
  box-shadow: var(--shadow-card);
}

.preview-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--color-on-dark-muted);
  font-weight: 850;
}

.preview-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 0 6px rgba(var(--rgb-green), 0.16);
}

.preview-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(var(--rgb-white), 0.18);
  border-radius: 22px;
  background: var(--color-surface);
}

.preview-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--color-surface-green);
}

.preview-status span,
.preview-grid span {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.preview-status strong {
  color: var(--color-green-dark);
}

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

.preview-grid div {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface-raised);
}

.preview-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--color-black);
  font-size: 20px;
}

.preview-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.preview-actions span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(var(--rgb-black), 0.14);
  border-radius: var(--radius-button);
  background: var(--color-blue);
  color: var(--color-white);
  font-weight: 850;
}

.preview-actions span:last-child {
  background: var(--color-surface);
  color: var(--color-black);
}

.qr-preview {
  display: grid;
  grid-template-columns: repeat(4, 12px);
  gap: 5px;
  width: max-content;
  margin: 20px auto 0;
  padding: 12px;
  border-radius: 14px;
  background: var(--color-surface-soft);
}

.qr-preview span {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--color-blue-dark);
}

.qr-preview span:nth-child(3n) {
  background: var(--color-green);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading h2,
.control-section h2,
.final-cta h2 {
  font-size: 42px;
}

.steps-grid,
.device-grid,
.features-grid,
.pricing-grid {
  display: grid;
  gap: 18px;
}

.steps-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.device-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.features-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.step-card,
.device-card,
.feature-card,
.price-card {
  border: 1px solid rgba(var(--rgb-border), 0.9);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.step-card,
.device-card,
.feature-card {
  padding: 22px;
}

.step-card h3,
.device-card h3,
.feature-card h3,
.price-card h3 {
  margin: 16px 0 8px;
  color: var(--color-black);
  font-size: 22px;
}

.step-card p,
.device-card p,
.feature-card p,
.price-card p,
.control-section p,
.final-cta p {
  margin: 0;
  color: var(--color-muted);
}

.device-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.device-card .btn {
  margin-top: auto;
}

.feature-card {
  min-height: 158px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--color-blue-soft);
  color: var(--color-blue-dark);
  font-weight: 900;
}

.section-actions {
  margin-top: 24px;
}

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px;
}

.price-card.featured {
  border-color: rgba(var(--rgb-blue), 0.42);
  background: linear-gradient(180deg, var(--color-surface), var(--color-surface-soft));
}

.popular-badge {
  align-self: flex-start;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-green-soft);
  color: var(--color-green-dark);
  font-size: 13px;
  font-weight: 900;
}

.price-period,
.price-note {
  color: var(--color-muted);
}

.price-value {
  color: var(--color-black);
  font-size: 42px;
  line-height: 1;
}

.price-card ul {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
  padding-left: 20px;
  color: var(--color-text);
}

.price-card .btn {
  margin-top: auto;
}

.control-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 30px;
  align-items: center;
  padding: 42px;
  border: 1px solid rgba(var(--rgb-border), 0.9);
  border-radius: 28px;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.control-section p {
  margin-top: 16px;
  font-size: 18px;
}

.control-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.faq-list details {
  border: 1px solid rgba(var(--rgb-border), 0.9);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.faq-list summary {
  cursor: pointer;
  padding: 18px 20px;
  color: var(--color-black);
  font-weight: 900;
}

.faq-list summary:focus-visible {
  outline: 4px solid rgba(var(--rgb-blue), 0.18);
  outline-offset: 3px;
}

.faq-list p {
  margin: 0;
  padding: 0 20px 20px;
  color: var(--color-muted);
}

.final-cta {
  display: grid;
  justify-items: center;
  text-align: center;
  border: 1px solid rgba(var(--rgb-blue), 0.22);
  border-radius: 30px;
  background: var(--color-surface-soft);
}

.final-cta p {
  max-width: 620px;
  margin: 16px 0 26px;
  font-size: 18px;
}

.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 46px;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
}

.footer-logo {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
  margin: 0 0 12px;
  border-radius: 12px;
}

.site-footer strong {
  color: var(--color-black);
  font-size: 22px;
}

.site-footer p {
  margin: 4px 0 20px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 18px;
}

.site-footer a {
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--color-blue-dark);
}

.admin-link {
  color: var(--color-disabled);
  font-size: 13px;
}

@media (max-width: 1080px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
    overflow: visible;
    padding-bottom: 0;
  }

  .hero,
  .control-section {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 44px;
  }

  .steps-grid,
  .device-grid,
  .features-grid,
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .section-shell {
    width: min(100% - 28px, 1180px);
    padding: 52px 0;
  }

  .hero {
    min-height: auto;
    padding-top: 40px;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

  .hero-text {
    font-size: 17px;
  }

  .section-heading h2,
  .control-section h2,
  .final-cta h2 {
    font-size: 32px;
  }

  .steps-grid,
  .device-grid,
  .features-grid,
  .pricing-grid,
  .preview-grid,
  .preview-actions {
    grid-template-columns: 1fr;
  }

  .vpn-preview,
  .control-section,
  .final-cta {
    padding: 20px;
  }

  .header-actions,
  .hero-actions,
  .section-actions,
  .btn {
    width: 100%;
  }

  .site-profile-actions {
    justify-content: space-between;
  }

  .site-profile-actions .icon-button {
    flex: 0 0 44px;
  }

  .profile-trigger {
    min-width: 0;
    width: calc(100vw - 86px);
  }

  .profile-caption strong,
  .profile-caption small {
    max-width: calc(100vw - 170px);
  }

  .profile-menu-panel {
    width: min(236px, calc(100vw - 24px));
  }
}
