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

:root {
  --bg: #fafafa;
  --ink: #111;
  --ink-2: #444;
  --ink-3: #888;
  --panel: #fff;
  --line: #e5e5e5;
  --accent: #111;
  --accent-soft: #f5f5f5;
  --danger: #e11;
  --danger-soft: #fef2f2;
  --good: #22c55e;
  --radius: 10px;
}

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

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Nav ─── */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  border-bottom: 1px solid var(--line);
}

.logo {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-links a, .nav-links button {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: background 0.12s, color 0.12s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-links a:hover, .nav-links button:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

/* ─── Buttons ─── */
.btn, button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.12s, transform 0.1s;
  line-height: 1;
}

.btn:hover, button[type="submit"]:hover { opacity: 0.85; }
.btn:active, button[type="submit"]:active { transform: scale(0.98); }

.btn-primary, button[type="submit"] {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost {
  background: none;
  color: var(--ink-3);
  padding: 6px 10px;
  font-size: 0.82rem;
}

/* ─── Cards ─── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

/* ─── Forms ─── */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  background: var(--panel);
  color: var(--ink);
  transition: border-color 0.12s;
}

input::placeholder, textarea::placeholder { color: #bbb; }

input:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
}

textarea {
  min-height: 200px;
  resize: vertical;
  line-height: 1.65;
}

/* ─── Auth ─── */
.auth-wrap {
  max-width: 380px;
  margin: 80px auto;
}

.auth-wrap h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-wrap .sub {
  color: var(--ink-3);
  font-size: 0.85rem;
  margin-top: 4px;
  margin-bottom: 24px;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--ink-3);
}

.auth-footer a { font-weight: 600; color: var(--ink); }
.auth-footer a:hover { text-decoration: underline; }

/* ─── Banner ─── */
.inline-banner {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-banner.error {
  background: var(--danger-soft);
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.banner-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
}

.hidden { display: none !important; }

/* ─── Hero ─── */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero p {
  color: var(--ink-3);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ─── Steps ─── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 80px;
}

.step {
  background: var(--panel);
  padding: 32px 24px;
}

.step-num {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.step h3 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.step p {
  font-size: 0.82rem;
  color: var(--ink-3);
  line-height: 1.55;
}

/* ─── Dashboard ─── */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 32px 0 24px;
}

.dash-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.meta-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--panel);
}

/* ─── Intensity ─── */
.intensity-group {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}

.intensity-btn {
  flex: 1;
  padding: 12px 8px;
  background: var(--panel);
  border: none;
  border-right: 1px solid var(--line);
  cursor: pointer;
  text-align: center;
  transition: background 0.1s;
  font-family: inherit;
}

.intensity-btn:last-child { border-right: none; }
.intensity-btn:hover { background: var(--accent-soft); }

.intensity-btn.active {
  background: var(--accent);
  color: #fff;
}

.intensity-btn.active strong, .intensity-btn.active small { color: #fff; }

.intensity-btn strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.intensity-btn small {
  font-size: 0.72rem;
  color: var(--ink-3);
}

/* ─── Two Column ─── */
.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.col-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* ─── Output ─── */
.output-box {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 200px;
  line-height: 1.7;
  white-space: pre-wrap;
  font-size: 0.88rem;
}

.output-box.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 0.82rem;
}

/* ─── Stats ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--panel);
  padding: 16px;
  text-align: center;
}

.stat-box .value {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-box .label {
  color: var(--ink-3);
  font-size: 0.72rem;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Actions ─── */
.action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-copy {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  font-family: inherit;
  transition: opacity 0.12s;
}

.btn-copy:hover { opacity: 0.85; }

/* ─── Changes ─── */
.changes-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 24px;
  background: var(--panel);
}

.changes-box h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.changes-box ul {
  padding-left: 18px;
  color: var(--ink-2);
}

.changes-box li {
  margin-bottom: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ─── Pricing ─── */
.page-header {
  text-align: center;
  padding: 48px 0 8px;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-header p {
  color: var(--ink-3);
  font-size: 0.92rem;
  margin-top: 8px;
}

.plan-table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 32px 0 80px;
}

.plan-card {
  padding: 32px 24px;
  background: var(--panel);
  text-align: center;
}

.plan-card.featured { background: var(--accent-soft); }

.plan-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.plan-price {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 16px 0 4px;
  letter-spacing: -0.03em;
}

.plan-price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-3);
}

.plan-features {
  list-style: none;
  margin: 20px 0 24px;
  text-align: left;
}

.plan-features li {
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}

.plan-features li:last-child { border: none; }

/* ─── History ─── */
.history-list {
  list-style: none;
  display: grid;
  gap: 8px;
  margin-bottom: 40px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 20px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.12s;
}

.history-item:hover { border-color: #ccc; }

.history-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.75rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.history-preview {
  font-size: 0.85rem;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ─── Modal ─── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  max-width: 680px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

/* ─── Loading ─── */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--ink-3);
  font-size: 0.85rem;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.7s linear infinite;
}

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

/* ─── Footer ─── */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.78rem;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 1.8rem; }
  .steps, .two-column, .plan-table { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .intensity-group { flex-direction: column; border-radius: 8px; }
  .intensity-btn { border-right: none; border-bottom: 1px solid var(--line); }
  .intensity-btn:last-child { border-bottom: none; }
  .hero-actions { flex-direction: column; }
  .dash-header { flex-direction: column; gap: 8px; }
}
