* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --text: #fff;
  --text-sub: #888;
  --text-legal: #555;
  --card-bg: #141414;
  --card-border: rgba(128,128,128,0.15);
  --card-pop: #1a1a2e;
  --accent: #6b9eff;
  --accent-bg: rgba(107,158,255,0.1);
  --btn-primary: #f4f4f5;
  --btn-primary-text: #1B2A4A;
  --btn-outline: transparent;
  --btn-outline-text: #ccc;
  --btn-outline-border: rgba(128,128,128,0.3);
  --badge-bg: rgba(107,158,255,0.15);
  --badge-text: #6b9eff;
  --check: #4ade80;
  --link: #6b9eff;
  --divider: rgba(128,128,128,0.12);
  --tag-bg: rgba(107,158,255,0.12);
  --tag-text: #6b9eff;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fff;
    --text: #1a1a1a;
    --text-sub: #666;
    --text-legal: #999;
    --card-bg: #fafafa;
    --card-border: rgba(0,0,0,0.08);
    --card-pop: #f0f4ff;
    --accent: #2563eb;
    --accent-bg: rgba(37,99,235,0.06);
    --btn-primary: #1B2A4A;
    --btn-primary-text: #fff;
    --btn-outline: transparent;
    --btn-outline-text: #333;
    --btn-outline-border: rgba(0,0,0,0.15);
    --badge-bg: rgba(37,99,235,0.1);
    --badge-text: #2563eb;
    --check: #16a34a;
    --link: #2563eb;
    --divider: rgba(0,0,0,0.06);
    --tag-bg: rgba(37,99,235,0.08);
    --tag-text: #2563eb;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 0 16px 60px;
}

.test-banner {
  background: #fbbf24;
  color: #1a1a1a;
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  margin: 0 -16px 32px;
  letter-spacing: 0.2px;
}

.test-banner .test-icon {
  margin-right: 6px;
}

.test-banner strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 1px;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin-bottom: 12px;
}

h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 8px;
}

/* Period toggle */
.period-toggle {
  display: inline-flex;
  gap: 4px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 3px;
  margin: 20px 0 32px;
}

.period-btn {
  padding: 8px 20px;
  border-radius: 18px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-sub);
  transition: all 0.15s;
}

.period-btn.active {
  background: var(--btn-primary);
  color: var(--btn-primary-text);
}

.save-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}

/* Cards grid */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: left;
}

@media (max-width: 768px) {
  .cards {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.card.popular {
  border-color: var(--accent);
  background: var(--card-pop);
}

.popular-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}

.plan-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.plan-desc {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 16px;
  min-height: 32px;
}

.price {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 2px;
}

.price .currency {
  font-size: 18px;
  font-weight: 600;
}

.price .period {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-sub);
}

.price-annual {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 16px;
  min-height: 16px;
}

.plan-btn {
  display: block;
  width: 100%;
  padding: 11px 0;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.15s;
  border: none;
  margin-bottom: 16px;
}

.plan-btn:hover { opacity: 0.85; }
.plan-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.plan-btn.primary {
  background: var(--btn-primary);
  color: var(--btn-primary-text);
}

.plan-btn.outline {
  background: var(--btn-outline);
  color: var(--btn-outline-text);
  border: 1.5px solid var(--btn-outline-border);
}

.features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.features li {
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.features li::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 1px;
  background: var(--check);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 20px 0;
}

/* Footer */
.footer {
  margin-top: 40px;
  text-align: center;
}

.footer p {
  font-size: 12px;
  color: var(--text-legal);
  margin-bottom: 4px;
}

.footer a {
  color: var(--link);
  text-decoration: none;
}

.footer a:hover { text-decoration: underline; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #ef4444;
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 100;
}

.toast.show {
  opacity: 1;
}

/* Loading */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

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