:root {
  --bg: #fafaf8;
  --surface: #fff;
  --accent: #7851A9;
  --accent-dark: #a87911;
  --text: #1c1917;
  --muted: #78716c;
  --border: #e7e5e4;
  --danger: #dc2626;
  --success: #15803d;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  max-width: 960px;
  margin: 0 auto;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--accent);
  font-size: 1.125rem;
}
.nav-logo img { width: 28px; height: 35px; }
.nav-right { display: flex; gap: 0.75rem; align-items: center; }

.lang-toggle {
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 0.375rem 0.625rem;
  border-radius: 6px;
}
.lang-toggle:hover { background: var(--border); }

.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
}
.hero img { width: 80px; height: 100px; }
.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  margin: 1rem 0 0.5rem;
  letter-spacing: -0.02em;
}
.hero .tagline {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 28rem;
  margin: 0 auto 2rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.08s, background 0.15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn[disabled], .btn[aria-busy="true"] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 3rem 0;
}
.steps-2 { grid-template-columns: repeat(2, 1fr); }
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.step-n {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  text-align: center;
  line-height: 1.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}
.step h3 { margin: 0 0 0.375rem; font-size: 1rem; font-weight: 600; }
.step p { margin: 0; font-size: 0.9rem; color: var(--muted); }

.pricing {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2.5rem 0 3rem;
}
.price {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
}
.price.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.price .badge {
  position: absolute;
  top: -10px;
  right: 1rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  font-weight: 600;
}
.price h3 { margin: 0 0 0.25rem; font-size: 1.25rem; }
.price .cost { font-size: 2rem; font-weight: 700; color: var(--accent); margin: 0.25rem 0; }
.price .cost small { font-size: 0.875rem; color: var(--muted); font-weight: 400; }
.price ul { margin: 1rem 0 0; padding-left: 1.125rem; color: var(--text); }
.price ul li { margin-bottom: 0.375rem; }

footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--muted);
  font-size: 0.875rem;
}
footer a { color: var(--muted); }

/* Account page */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.card h2 { margin: 0 0 1rem; font-size: 1.25rem; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.row + .row { margin-top: 0.75rem; }
.label { color: var(--muted); font-size: 0.875rem; }
.value { font-weight: 600; }

.plan-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
}
.plan-badge.free { background: var(--border); color: var(--muted); }
.plan-badge.pro  { background: var(--accent); color: #fff; }

.usage-bar {
  margin-top: 0.5rem;
  background: var(--border);
  border-radius: 999px;
  height: 0.5rem;
  overflow: hidden;
}
.usage-bar-fill {
  background: var(--accent);
  height: 100%;
  transition: width 0.3s;
}

.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.alert-info    { background: #fef3c7; color: #713f12; border: 1px solid #fde68a; }
.alert-success { background: #dcfce7; color: #14532d; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #7f1d1d; border: 1px solid #fecaca; }

.g-signin { display: flex; justify-content: center; margin: 1.25rem 0; }

.signout {
  background: transparent;
  color: var(--muted);
  padding: 0.625rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
.signout:hover { color: var(--danger); }

.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .steps { grid-template-columns: 1fr; }
  .pricing { grid-template-columns: 1fr; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}
