@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Unbounded:wght@500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #161b23;
  --bg-deep: #11161e;
  --card: rgba(31, 37, 48, 0.86);
  --card-strong: rgba(35, 42, 54, 0.94);
  --line: rgba(148, 163, 184, 0.2);
  --line-strong: rgba(148, 163, 184, 0.34);
  --text: #f8fafc;
  --muted: #9aa5b5;
  --cyan: #22d3ee;
  --teal: #2dd4bf;
  --green: #34d399;
  --red: #fb7185;
  --yellow: #facc15;
  --blue: #60a5fa;
  --orange: #fb923c;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  --font-ui: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: Unbounded, Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-ui);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background-color: #161b23;
  background:
    linear-gradient(to right, rgba(128, 128, 128, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(128, 128, 128, 0.05) 1px, transparent 1px),
    #161b23;
  background-attachment: fixed;
  background-size: 60px 60px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 25% 40%, rgba(151, 117, 250, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 50% at 85% 85%, rgba(34, 211, 238, 0.06), transparent 50%);
}

button,
select,
a {
  font: inherit;
}

button {
  color: inherit;
}

.app {
  min-height: 100vh;
}

.container {
  width: min(590px, calc(100% - 28px));
  margin: 0 auto;
}

.header-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(22, 27, 35, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (min-width: 768px) {
  .header-wrapper {
    border-radius: 0 0 16px 16px;
  }
}

.header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  user-select: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--cyan);
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.22));
}

.brand-icon svg {
  width: 32px;
  height: 32px;
}

.brand-icon path:first-child {
  fill: rgba(34, 211, 238, 0.14);
  stroke: rgba(34, 211, 238, 0.65);
}

.brand-icon path:last-child {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand span:last-child {
  overflow: hidden;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button-row {
  flex-wrap: wrap;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: #dbe4ef;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.icon-button:hover {
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.08);
  color: #fff;
}

.icon-button.accent {
  color: var(--cyan);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.icon-button path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button.accent path {
  fill: currentColor;
  stroke: none;
}

.main {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 24px;
  padding: 26px 0 44px;
  animation: fadeIn 0.5s ease-in-out;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(34, 211, 238, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 18px rgba(34, 211, 238, 0.06);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: transparent;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.subscription-card,
.install-card {
  padding: 26px;
}

.profile-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.status-badge,
.step-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(45, 212, 191, 0.45);
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.14);
  color: #67f5df;
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.12);
}

.status-badge svg {
  width: 22px;
  height: 22px;
}

.status-badge path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-badge.warning {
  border-color: rgba(251, 146, 60, 0.5);
  background: rgba(251, 146, 60, 0.14);
  color: var(--orange);
}

.status-badge.error {
  border-color: rgba(251, 113, 133, 0.5);
  background: rgba(251, 113, 133, 0.14);
  color: var(--red);
}

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

h1 {
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy {
  min-width: 0;
}

.profile-copy p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

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

.info-block {
  min-height: 52px;
  padding: 10px;
  border: 1px solid;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.info-label {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.mini-icon {
  width: 14px;
  color: currentColor;
  text-align: center;
}

.info-block strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-block.blue {
  border-color: rgba(34, 139, 230, 0.24);
  background: linear-gradient(135deg, rgba(34, 139, 230, 0.12), rgba(28, 126, 214, 0.05));
}

.info-block.green {
  border-color: rgba(64, 192, 87, 0.24);
  background: linear-gradient(135deg, rgba(64, 192, 87, 0.12), rgba(55, 178, 77, 0.05));
}

.info-block.red {
  border-color: rgba(250, 82, 82, 0.24);
  background: linear-gradient(135deg, rgba(250, 82, 82, 0.12), rgba(224, 49, 49, 0.05));
}

.info-block.yellow {
  border-color: rgba(250, 176, 5, 0.24);
  background: linear-gradient(135deg, rgba(250, 176, 5, 0.12), rgba(245, 159, 0, 0.05));
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

h2 {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}

.platform-select {
  position: relative;
  height: 32px;
  min-width: 122px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.platform-trigger {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.platform-trigger span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-chevron {
  color: #7f8a9b;
  transition: transform 160ms ease;
}

.platform-select.open .select-chevron {
  transform: rotate(180deg);
}

.platform-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 30;
  min-width: 154px;
  display: none;
  overflow: hidden;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(22, 27, 35, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.platform-select.open .platform-menu {
  display: grid;
}

.platform-option {
  min-height: 31px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #aab3c1;
  text-align: left;
  cursor: pointer;
  padding: 0 10px;
}

.platform-option:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.platform-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.platform-option.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.16), rgba(34, 211, 238, 0.04));
  color: #66d9e8;
}

.client-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.client-tab {
  position: relative;
  min-height: 40px;
  display: flex;
  align-items: center;
  flex: 1 1 150px;
  gap: 8px;
  overflow: hidden;
  padding: 0 48px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: #cdd6e3;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.client-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  border-left-color: rgba(255, 255, 255, 0.25);
}

.client-tab.active {
  border-color: rgba(34, 211, 238, 0.2);
  border-left-color: #22b8cf;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.12), rgba(34, 211, 238, 0.04));
  color: #66d9e8;
  box-shadow: inset 4px 0 12px -4px rgba(34, 211, 238, 0.3), 0 0 12px rgba(34, 211, 238, 0.1);
}

.tab-dot {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 0 0 6px rgba(239, 191, 4, 0.6);
}

.client-tab strong {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.22);
  font-size: 30px;
  font-weight: 900;
  pointer-events: none;
  opacity: 0.25;
  transition: opacity 0.3s ease;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 40%, black 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 40%, black 100%);
}

.client-tab:hover strong,
.client-tab.active strong {
  opacity: 0.3;
}

.timeline {
  display: grid;
  gap: 10px;
}

.step-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.step-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(34, 211, 238, 0.22);
}

.step-icon {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.12);
  font-size: 18px;
  font-weight: 900;
}

h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

.step-card p,
.modal-panel p {
  max-width: 440px;
  margin-top: 9px;
  color: #c3ccd9;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.48;
}

.primary-button,
.secondary-button {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 13px;
  padding: 7px 12px;
  border: 0;
  border-radius: 7px;
  background: rgba(8, 145, 178, 0.55);
  color: #7ddff0;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  background: rgba(8, 145, 178, 0.72);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.16);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: #d7dee8;
}

.wide {
  width: 100%;
}

.counter {
  min-width: 28px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.15);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  max-width: min(420px, calc(100% - 28px));
  padding: 10px 14px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(34, 211, 238, 0.36);
  border-radius: 9px;
  background: rgba(17, 22, 30, 0.96);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 18px;
}

.modal.open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(360px, 100%);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(22, 27, 35, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.qr-box {
  min-height: 240px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #10151d;
  color: var(--muted);
  overflow-wrap: anywhere;
  text-align: center;
  font-size: 12px;
}

.qr-box img {
  width: min(220px, 100%);
  height: auto;
  display: block;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 16px rgba(45, 212, 191, 0.12);
  }
  50% {
    box-shadow: 0 0 28px rgba(45, 212, 191, 0.24);
  }
}

@media (prefers-reduced-motion: reduce) {
  .main,
  .status-badge,
  .step-icon {
    animation: none;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 18px, 590px);
  }

  .header {
    min-height: 58px;
  }

  .brand span:last-child {
    font-size: 17px;
  }

  .subscription-card,
  .install-card {
    padding: 16px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .client-tab {
    flex-basis: 100%;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .platform-select {
    width: 100%;
  }

  .step-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}
