/* Copyright (c) Edward James Harrison. All rights reserved. */

/*
 * BILLING PANEL styling — the `.acct-*` component subset needed to render the
 * shared subscription + tokens component (ui/account/manage-billing.js) INSIDE
 * the app (the in-app "Add more tokens" modal). account.html gets these same
 * classes from account.css; this file is the app-side counterpart so the modal
 * mirrors the page without pulling in account.css's global body/starfield rules.
 *
 * Everything is scoped under `.acct-scope` (the wrapper the component renders),
 * and the CSS variables live on that wrapper rather than :root so nothing
 * leaks into the app's own theming. Values mirror account.css.
 */

.acct-scope {
  --acct-ink: #dcd9f5;
  --acct-muted: #9b97c4;
  --acct-faint: #6f6b9c;
  --acct-cyan: #7fd6ff;
  --acct-gold: #e9c98a;
  --acct-line: rgba(150, 160, 255, 0.18);
  --acct-line-strong: rgba(150, 160, 255, 0.28);
  --acct-err: #ef8a8a;
  --acct-ok: #8fd08f;
  color: var(--acct-ink);
  font-family: 'Outfit', system-ui, sans-serif;
}

.acct-scope * { box-sizing: border-box; }

/* ── Cards ── */
.acct-scope .acct-card {
  position: relative;
  background: rgba(20, 24, 51, 0.82);
  border: 1px solid var(--acct-line);
  border-radius: 16px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 22px 22px 20px;
  margin-bottom: 16px;
}
.acct-scope .acct-card:last-child { margin-bottom: 0; }
.acct-scope .acct-card-title {
  font-family: 'Cinzel', serif;
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--acct-gold); margin: 0 0 14px; font-weight: 600; opacity: 0.9;
}

.acct-scope .acct-sub { font-size: 12.5px; color: var(--acct-muted); margin: 3px 0 0; }
.acct-scope .acct-label {
  display: block; font-size: 11.5px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--acct-muted); margin: 0 0 5px;
}

/* ── Inputs (confirm-panel password fields) ── */
.acct-scope .acct-input {
  width: 100%; padding: 11px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(150, 160, 255, 0.2);
  border-radius: 8px; color: #eeecff;
  font-family: inherit; font-size: 14px; outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.acct-scope .acct-input:focus {
  border-color: rgba(127, 214, 255, 0.7);
  background: rgba(127, 214, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(127, 214, 255, 0.12);
}
.acct-scope .acct-input::placeholder { color: var(--acct-faint); }

/* ── Buttons ── */
.acct-scope .acct-btn {
  padding: 10px 18px;
  background: linear-gradient(180deg, #f0d69a, #e9c98a 55%, #d8b877);
  border: none; border-radius: 8px;
  color: #1a1400; font-family: inherit; font-size: 13.5px; font-weight: 700;
  letter-spacing: 0.02em; cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 20px rgba(233, 201, 138, 0.18);
  transition: filter 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.acct-scope .acct-btn:hover { filter: brightness(1.05); box-shadow: 0 8px 26px rgba(233, 201, 138, 0.30); }
.acct-scope .acct-btn:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
.acct-scope .acct-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--acct-line-strong);
  color: var(--acct-ink); box-shadow: none; font-weight: 600;
}
.acct-scope .acct-btn.secondary:hover { background: rgba(127, 214, 255, 0.08); border-color: rgba(127, 214, 255, 0.5); }
.acct-scope .acct-btn.danger {
  background: rgba(239, 138, 138, 0.10);
  border: 1px solid rgba(239, 138, 138, 0.4);
  color: #f4a6a6; box-shadow: none; font-weight: 600;
}
.acct-scope .acct-btn.danger:hover { background: rgba(239, 138, 138, 0.18); }

.acct-scope .acct-link {
  background: none; border: none; color: var(--acct-cyan);
  font-family: inherit; font-size: 12.5px; cursor: pointer;
  text-decoration: none; padding: 4px; opacity: 0.85;
  transition: opacity 0.15s, text-shadow 0.15s;
}
.acct-scope .acct-link:hover { opacity: 1; text-shadow: 0 0 10px rgba(127, 214, 255, 0.45); }

.acct-scope .acct-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }

/* ── Status / pills ── */
.acct-scope .acct-status { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.acct-scope .acct-pill {
  display: inline-block; padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid var(--acct-line-strong);
}
.acct-scope .acct-pill.active { color: #a9e6c0; border-color: rgba(120, 220, 160, 0.5); background: rgba(120, 220, 160, 0.10); }
.acct-scope .acct-pill.inactive { color: #f4b6a6; border-color: rgba(240, 150, 120, 0.5); background: rgba(240, 150, 120, 0.10); }
.acct-scope .acct-tier-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--acct-gold); border: 1px solid rgba(233, 201, 138, 0.4);
  background: rgba(233, 201, 138, 0.08);
}

/* ── Plan / pack chooser (radio cards) ── */
.acct-scope .acct-choices { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.acct-scope .acct-choice {
  flex: 1; min-width: 150px; cursor: pointer;
  border: 1px solid var(--acct-line-strong); border-radius: 10px;
  padding: 12px 14px; background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s, background 0.15s;
}
.acct-scope .acct-choice:hover { border-color: rgba(127, 214, 255, 0.5); }
.acct-scope .acct-choice.selected { border-color: var(--acct-cyan); background: rgba(127, 214, 255, 0.08); box-shadow: 0 0 0 2px rgba(127, 214, 255, 0.12) inset; }
.acct-scope .acct-choice-name { font-size: 13.5px; font-weight: 700; color: var(--acct-ink); }
.acct-scope .acct-choice-price { font-size: 12.5px; color: var(--acct-muted); margin-top: 2px; }
.acct-scope .acct-choice-tag { font-size: 11px; color: var(--acct-ok); margin-top: 3px; }

/* ── Lists (billing history) ── */
.acct-scope .acct-list { margin: 8px 0 0; }
.acct-scope .acct-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--acct-line); font-size: 13px;
}
.acct-scope .acct-item:first-child { border-top: none; }
.acct-scope .acct-item-main { min-width: 0; }
.acct-scope .acct-item-sub { font-size: 11.5px; color: var(--acct-muted); margin-top: 2px; }

/* ── Messages / notes / confirm ── */
.acct-scope .acct-msg { font-size: 12.5px; min-height: 16px; margin-top: 10px; }
.acct-scope .acct-msg.err { color: var(--acct-err); }
.acct-scope .acct-msg.ok { color: var(--acct-ok); }
.acct-scope .acct-note {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px dashed var(--acct-line-strong); border-radius: 10px;
  padding: 10px 14px; font-size: 12.5px; color: var(--acct-muted);
}
.acct-scope .acct-confirm {
  border: 1px solid var(--acct-line-strong); border-radius: 12px;
  padding: 14px 16px; margin-top: 12px; background: rgba(255, 255, 255, 0.03);
}
.acct-scope .acct-confirm .acct-input { margin-bottom: 8px; }

/* ── Spinner (initial load) ── */
.acct-scope .acct-spinner {
  width: 30px; height: 30px; margin: 40px auto;
  border: 3px solid rgba(127, 214, 255, 0.2);
  border-top-color: var(--acct-cyan); border-radius: 50%;
  animation: billing-spin 0.8s linear infinite;
}
@keyframes billing-spin { to { transform: rotate(360deg); } }
