/* Account / developer dashboard */

.acct-loading { padding: var(--space-12) 0; text-align: center; }

/* ── sign-in ─────────────────────────────────────────────── */
.acct-auth {
  display: flex;
  justify-content: center;
  padding: var(--space-10) 0;
}
.acct-signin { max-width: 420px; width: 100%; }
.acct-signin h1 { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--space-2); }
.acct-form { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-5); }
.acct-form label { font-size: var(--text-sm); font-weight: 600; color: var(--text-subtle); }
.acct-form input,
.acct-modal-card input {
  font-family: inherit;
  font-size: var(--text-sm);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  color: var(--text);
}
.acct-form input:focus,
.acct-modal-card input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.acct-or { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-5) 0; color: var(--text-subtle); font-size: var(--text-xs); }
.acct-or::before, .acct-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.acct-google { width: 100%; justify-content: center; }
.acct-fineprint { font-size: var(--text-xs); margin-top: var(--space-4); line-height: 1.5; }

/* ── dashboard head ──────────────────────────────────────── */
.acct-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-4); margin: var(--space-6) 0 var(--space-5);
}
.acct-head h1 { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; }

.acct-alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}
.acct-alert-ok  { border-color: var(--positive); color: var(--positive); }
.acct-alert-err { border-color: var(--negative); color: var(--negative); }

/* ── subscribe upsell ────────────────────────────────────── */
.acct-upsell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  padding: var(--space-8) var(--space-6);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-md);
  animation: acct-rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.acct-upsell-glow {
  position: absolute;
  top: -40%; left: 50%;
  width: 140%; height: 180%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
  opacity: 0.7;
  pointer-events: none;
  animation: acct-pulse 6s ease-in-out infinite;
}
.acct-upsell-inner { position: relative; max-width: 560px; margin: 0 auto; }
.acct-upsell-badge {
  display: inline-block;
  font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); background: var(--accent-soft);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-full);
}
.acct-upsell-title {
  font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.03em;
  margin: var(--space-3) 0 var(--space-2);
}
.acct-upsell-sub { color: var(--text-muted); line-height: 1.55; max-width: 520px; }

.acct-price { display: flex; align-items: baseline; gap: var(--space-2); margin-top: var(--space-5); }
.acct-price-amount {
  font-size: 3rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1;
  background: linear-gradient(120deg, var(--accent), var(--text));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.acct-price-per { font-size: var(--text-md); font-weight: 600; color: var(--text-subtle); }
.acct-price-note { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-1); }

.acct-spark { width: 100%; height: 70px; margin: var(--space-5) 0; display: block; }
.acct-spark-line {
  stroke-dasharray: 600; stroke-dashoffset: 600;
  animation: acct-draw 1.6s 0.2s ease-out forwards;
}
.acct-spark-area { opacity: 0; animation: acct-fade 1s 1.2s ease-out forwards; }

.acct-benefits { list-style: none; padding: 0; margin: var(--space-4) 0; display: grid; gap: var(--space-3); }
.acct-benefits li {
  display: flex; align-items: flex-start; gap: var(--space-3);
  opacity: 0; transform: translateY(8px);
  animation: acct-rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(0.3s + var(--i) * 0.1s);
}
.acct-benefits i { color: var(--accent); margin-top: 2px; flex-shrink: 0; }
.acct-benefits strong { display: block; font-weight: 700; }
.acct-benefits span { display: block; font-size: var(--text-sm); line-height: 1.5; }

.acct-cta {
  margin-top: var(--space-3);
  font-size: var(--text-md); font-weight: 700;
  padding: var(--space-3) var(--space-5);
  display: inline-flex; align-items: center; gap: var(--space-2);
  box-shadow: 0 6px 20px -6px var(--accent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.acct-cta:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 28px -8px var(--accent); }
.acct-cta i { transition: transform 0.15s ease; }
.acct-cta:hover:not(:disabled) i { transform: translateX(3px); }

.acct-upsell-fine { font-size: var(--text-xs); margin-top: var(--space-4); line-height: 1.5; }

@keyframes acct-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes acct-draw { to { stroke-dashoffset: 0; } }
@keyframes acct-fade { to { opacity: 1; } }
@keyframes acct-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 0.85; } }
@media (prefers-reduced-motion: reduce) {
  .acct-upsell, .acct-benefits li, .acct-spark-line, .acct-spark-area, .acct-upsell-glow { animation: none; opacity: 1; transform: none; stroke-dashoffset: 0; }
}

/* ── cards / grid ────────────────────────────────────────── */
.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.acct-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.acct-card-title {
  display: flex; align-items: center; gap: var(--space-2);
  font-weight: 700; font-size: var(--text-md); margin-bottom: var(--space-3);
}
.acct-card-title i { color: var(--accent); }
.acct-sub { font-size: var(--text-xs); }
.acct-card p { line-height: 1.5; margin-bottom: var(--space-4); }
.acct-card-link { display: block; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.acct-card-link:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }

.acct-status {
  display: inline-block; font-weight: 700; font-size: var(--text-sm);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-full);
  background: var(--bg-sunken); color: var(--text-muted);
}
.acct-status-active { color: var(--positive); background: rgba(34,197,94,0.12); }
.acct-status-past_due, .acct-status-canceled { color: var(--negative); background: rgba(239,68,68,0.12); }

.acct-billing-actions { margin: var(--space-4) 0; display: flex; gap: var(--space-2); flex-wrap: wrap; }
.acct-notice-warn { color: var(--warning); margin-top: var(--space-2); }

/* retention modal */
.acct-retain-list { list-style: none; padding: 0; margin: var(--space-3) 0; display: flex; flex-direction: column; gap: var(--space-2); }
.acct-retain-list li { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.acct-retain-list i { color: var(--accent); }
.acct-retain-actions { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.acct-retain-keep { display: flex; gap: var(--space-2); }
.acct-packs { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }
.acct-packs .btn { justify-content: flex-start; }

.acct-balance { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.02em; }
.acct-balance span { font-size: var(--text-sm); font-weight: 500; }
.acct-meter { height: 8px; background: var(--bg-sunken); border-radius: var(--radius-full); overflow: hidden; margin: var(--space-3) 0 var(--space-1); }
.acct-meter-fill { height: 100%; background: var(--accent); }
.acct-mini-stats { display: flex; gap: var(--space-6); margin-top: var(--space-4); }
.acct-mini-stats > div { display: flex; flex-direction: column; }
.acct-mini-num { font-size: var(--text-xl); font-weight: 800; }
.acct-mini-stats .muted { font-size: var(--text-xs); }

/* ── sections ────────────────────────────────────────────── */
.acct-section { margin-bottom: var(--space-8); }
.acct-section > h2 { font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-4); }
.acct-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.acct-section-head h2 { font-size: var(--text-xl); font-weight: 700; }

/* ── api keys ────────────────────────────────────────────── */
.acct-keys { display: flex; flex-direction: column; gap: var(--space-2); }
.acct-key {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-elevated); padding: var(--space-3) var(--space-4); flex-wrap: wrap;
}
.acct-key-name { font-weight: 600; }
.acct-key-prefix { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.acct-key-scopes { display: flex; gap: var(--space-1); flex-wrap: wrap; margin-top: var(--space-2); }
.acct-key-meta { display: flex; align-items: center; gap: var(--space-2); }
.acct-tag {
  font-size: var(--text-xs); font-weight: 600; padding: 1px var(--space-2);
  border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent);
}
.acct-tag-off { background: var(--bg-sunken); color: var(--text-muted); }
.acct-danger { color: var(--negative); }

/* ── analytics ───────────────────────────────────────────── */
.acct-analytics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4); margin-bottom: var(--space-4);
}
.acct-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.acct-bar { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.acct-bar-fill { width: 100%; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; }
.acct-eps { display: flex; flex-direction: column; gap: var(--space-2); }
.acct-ep-row { display: grid; grid-template-columns: 1fr 80px auto; align-items: center; gap: var(--space-3); font-size: var(--text-xs); }
.acct-ep-row code { font-family: var(--font-mono); color: var(--text-muted); }
.acct-ep-bar { height: 6px; background: var(--bg-sunken); border-radius: var(--radius-full); overflow: hidden; }
.acct-ep-bar > div { height: 100%; background: var(--accent); }
.acct-keytable { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.acct-keytable th { text-align: left; font-size: var(--text-xs); text-transform: uppercase; color: var(--text-subtle); padding: var(--space-2); border-bottom: 1px solid var(--border); }
.acct-keytable td { padding: var(--space-2); border-bottom: 1px solid var(--border); }

/* ── modal ───────────────────────────────────────────────── */
.acct-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; padding: var(--space-4);
}
.acct-modal-card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-6); max-width: 440px; width: 100%;
  display: flex; flex-direction: column; gap: var(--space-3); box-shadow: var(--shadow-lg);
}
.acct-modal-card h3 { font-size: var(--text-lg); font-weight: 700; }
.acct-modal-card label { font-size: var(--text-sm); font-weight: 600; color: var(--text-subtle); }
.acct-scopes-grid { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.acct-scope { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); font-weight: 500; }
.acct-modal-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }
.acct-secret {
  font-family: var(--font-mono); font-size: var(--text-sm);
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: var(--space-3); word-break: break-all;
}

@media (max-width: 640px) {
  .acct-key { flex-direction: column; align-items: flex-start; }
  .acct-ep-row { grid-template-columns: 1fr 60px auto; }
}
