/* cf-auth-app — shared styles */
:root {
  --bg: #0b0d10;
  --surface: #141821;
  --surface-2: #1c212d;
  --border: #2a3040;
  --text: #e7ebf0;
  --text-muted: #9aa3b2;
  --text-dim: #6b7280;
  --accent: #4f8bff;
  --accent-hover: #6aa0ff;
  --accent-dim: rgba(79, 139, 255, 0.12);
  --accent-fg: #0b0d10;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #eab308;
  --radius: 10px;
  --radius-sm: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { font-weight: 700; letter-spacing: -0.01em; color: var(--text); text-decoration: none; font-size: 16px; }
.brand:hover { text-decoration: none; color: var(--text); }
.nav { display: flex; gap: 20px; align-items: center; }
.nav a { color: var(--text-muted); font-size: 14px; }
.nav a:hover { color: var(--text); }

/* Layout */
.center-wrap {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.card h1 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.01em; }
.card .lead { color: var(--text-muted); font-size: 14px; margin: 0 0 24px; }

/* Forms */
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 6px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted);
}
.field input {
  width: 100%;
  padding: 11px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.12s;
}
.field input:focus { outline: none; border-color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 18px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
  text-decoration: none;
}
.btn:hover { background: var(--border); text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* Messages */
.msg {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin: 16px 0;
  line-height: 1.5;
}
.msg.error   { background: rgba(239, 68, 68, 0.1);  border: 1px solid rgba(239, 68, 68, 0.3);  color: #fca5a5; }
.msg.success { background: rgba(34, 197, 94, 0.1);  border: 1px solid rgba(34, 197, 94, 0.3);  color: #86efac; }
.msg.warning { background: rgba(234, 179, 8, 0.1);  border: 1px solid rgba(234, 179, 8, 0.3);  color: #fde68a; }
.msg:empty { display: none; }

.form-footer {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 13px; color: var(--text-muted);
}
.form-footer a { font-weight: 500; }

/* Landing page */
.hero {
  padding: 80px 28px;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.hero h1 { font-size: 40px; letter-spacing: -0.02em; margin: 0 0 16px; }
.hero .sub { font-size: 17px; color: var(--text-muted); margin: 0 auto 32px; max-width: 520px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Dashboard */
.dashboard-wrap { max-width: 960px; margin: 0 auto; padding: 40px 28px; }
.dashboard-wrap h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.01em; }
.dashboard-wrap .greeting { color: var(--text-muted); margin-bottom: 28px; }

.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 6px; }
.panel .val { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.panel .val.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; font-weight: 400; color: var(--text-muted); }

.loading { color: var(--text-muted); font-size: 14px; text-align: center; padding: 30px; }

/* Pricing page */
.pricing-hero { text-align: center; padding: 60px 28px 20px; max-width: 780px; margin: 0 auto; }
.pricing-hero h1 { font-size: 34px; letter-spacing: -0.02em; margin: 0 0 12px; }
.pricing-hero .sub { color: var(--text-muted); margin: 0; font-size: 16px; }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1040px;
  margin: 32px auto 60px;
  padding: 0 28px;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex; flex-direction: column;
  position: relative;
}
.plan.is-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.plan-badge {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent); color: var(--accent-fg);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 10px;
}
.plan-name { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.plan-desc { color: var(--text-muted); font-size: 13px; margin: 0 0 20px; min-height: 36px; }
.plan-price { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; margin: 0; line-height: 1; }
.plan-price-unit { color: var(--text-muted); font-size: 14px; font-weight: 500; margin-left: 4px; }
.plan-credits { margin: 12px 0 20px; font-size: 14px; color: var(--text-muted); }
.plan-credits strong { color: var(--text); }
.plan-features { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.plan-features li { font-size: 13px; color: var(--text-muted); padding: 7px 0; display: flex; gap: 8px; align-items: flex-start; }
.plan-features li::before {
  content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0;
}
.plan-cta { margin-top: auto; }

.pricing-fine {
  max-width: 780px; margin: 0 auto 60px; padding: 0 28px;
  text-align: center; color: var(--text-muted); font-size: 13px; line-height: 1.7;
}

/* Billing page */
.billing-wrap { max-width: 840px; margin: 0 auto; padding: 40px 28px; }
.billing-wrap h1 { font-size: 26px; margin: 0 0 24px; letter-spacing: -0.01em; }

.billing-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.billing-section h2 { margin: 0 0 14px; font-size: 16px; }
.billing-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.billing-row:last-child { border-bottom: none; }
.billing-row .k { color: var(--text-muted); }
.billing-row .v { color: var(--text); font-weight: 500; }

.status-pill {
  display: inline-block; padding: 3px 10px;
  border-radius: 12px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.status-pill.active    { background: rgba(34,197,94,0.15); color: #86efac; }
.status-pill.past_due  { background: rgba(234,179,8,0.15); color: #fde68a; }
.status-pill.canceled  { background: rgba(239,68,68,0.15); color: #fca5a5; }
.status-pill.none, .status-pill.incomplete { background: var(--surface-2); color: var(--text-muted); }

.credits-bar {
  height: 8px; border-radius: 4px; background: var(--surface-2);
  overflow: hidden; margin: 12px 0 8px;
}
.credits-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s; }
.credits-bar-fill.low { background: var(--warning); }
.credits-bar-fill.empty { background: var(--danger); }

.credit-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: var(--accent-dim); border: 1px solid var(--accent);
  border-radius: 12px;
  font-size: 12px; font-weight: 600;
  color: var(--accent);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* Success / cancel pages */
.outcome-wrap { text-align: center; max-width: 460px; margin: 0 auto; padding: 80px 28px; }
.outcome-icon { font-size: 48px; margin-bottom: 16px; }
.outcome-wrap h1 { margin: 0 0 10px; font-size: 24px; }
.outcome-wrap p { color: var(--text-muted); margin: 0 0 28px; }
