* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #647086;
  --line: #dde3ee;
  --panel: #ffffff;
  --soft: #f5f7fb;
  --brand: #667eea;
  --brand-2: #764ba2;
  --green: #168353;
  --yellow: #ffd54a;
  --red: #c7394a;
  --shadow: 0 18px 50px rgba(26, 34, 55, .13);
  --radius: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(102, 126, 234, .92), rgba(118, 75, 162, .9)),
    radial-gradient(circle at top left, rgba(255, 255, 255, .28), transparent 32rem);
}

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

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.08rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  font-weight: 900;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 18px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
}

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

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 24px rgba(102, 126, 234, .22);
}

.btn-light {
  color: var(--brand);
  background: #fff;
  box-shadow: 0 12px 24px rgba(30, 34, 50, .14);
}

.btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, .36);
  background: rgba(255, 255, 255, .08);
}

.btn-subtle {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, .96fr);
  align-items: center;
  gap: 44px;
  padding: 30px 0 56px;
  color: #fff;
}

.hero-copy h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.45rem, 6vw, 5.25rem);
  line-height: .95;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 660px;
  margin: 22px 0 0;
  font-size: clamp(1.02rem, 2vw, 1.28rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, .88);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-panel,
.panel {
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 22px;
}

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

.signal {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.signal strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.02rem;
}

.signal span {
  color: var(--muted);
  line-height: 1.45;
  font-size: .93rem;
}

.section {
  padding: 56px 0;
}

.section-heading {
  margin: 0 0 24px;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  line-height: 1.1;
}

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

.panel {
  padding: 28px;
}

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

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

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 22px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff5cc;
  color: #765700;
  border: 1px solid #ffe78a;
  font-size: .78rem;
  font-weight: 850;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.plan-card.recommended {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 213, 74, .3);
}

.plan-name {
  margin: 8px 0 0;
  font-size: 1.55rem;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.price strong {
  color: var(--brand);
  font-size: 2.35rem;
}

.old-price {
  color: #8a93a6;
  text-decoration: line-through;
}

.feature-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  gap: 10px;
  color: #334059;
}

.feature-list li::before {
  content: "✓";
  color: var(--green);
  font-weight: 900;
}

.feature-list li.disabled {
  color: #9aa4b6;
}

.feature-list li.disabled::before {
  content: "×";
  color: #9aa4b6;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-row label {
  font-weight: 750;
  color: #334059;
}

.input,
input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 3px solid rgba(102, 126, 234, .18);
  border-color: var(--brand);
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
  cursor: pointer;
}

.choice.selected {
  border-color: var(--brand);
  background: #f3f5ff;
}

.alert {
  display: none;
  margin-bottom: 16px;
  padding: 13px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 650;
}

.alert-success {
  display: block;
  color: #105b39;
  background: #e7f7ef;
  border-color: #bfe8d3;
}

.alert-error {
  display: block;
  color: #8a2030;
  background: #fdecef;
  border-color: #f6c7d0;
}

.alert-info {
  display: block;
  color: #17456e;
  background: #edf5ff;
  border-color: #c6dcf8;
}

.dashboard-body {
  background: #f3f6fb;
}

.dash-header {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.dash-bar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.dash-main {
  padding: 26px 0 44px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-value {
  margin-top: 10px;
  font-size: 2rem;
  font-weight: 850;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  overflow-x: auto;
}

.tab {
  min-height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

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

.product-list {
  display: grid;
  gap: 10px;
}

.product-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.product-row img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 4px solid #e7ebf3;
  border-top-color: var(--brand);
  animation: spin .9s linear infinite;
}

.loading,
.empty-state {
  padding: 42px 18px;
  text-align: center;
  color: var(--muted);
}

.price-result {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.breakdown-item.total {
  border-color: rgba(102, 126, 234, .35);
  background: #f5f6ff;
  font-size: 1.05rem;
  font-weight: 850;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 0;
}

.auth-card {
  width: min(520px, calc(100% - 32px));
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .hero,
  .grid-2,
  .grid-3,
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .dash-bar,
  .section-header,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions,
  .hero-actions {
    width: 100%;
  }

  .nav-actions .btn,
  .hero-actions .btn {
    flex: 1;
  }
}

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

  .panel,
  .hero-panel {
    padding: 18px;
  }

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

  .product-row {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .product-row .price-tag {
    grid-column: 2;
  }
}
