:root {
  --bg: #06070b;
  --bg-warm: #1a0f08;
  --bg-cool: #060f1c;
  --ink: #f0f4fa;
  --muted: #8b94a8;
  --line: rgba(255, 255, 255, 0.10);
  --panel: rgba(255, 255, 255, 0.05);
  --panel-edge: rgba(255, 255, 255, 0.10);
  --primary: #4ea3ff;
  --accent: #1fd693;
  --sun: #ffa94d;
  --rose: #ff7aa0;
  --plum: #a787e0;
  --ok: #1fd693;
  --warn: #ffcd5b;
  --bad: #ff6b6b;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  font-weight: 500;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at top left, rgba(78, 163, 255, 0.16) 0%, transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(255, 169, 77, 0.14) 0%, transparent 55%),
    linear-gradient(180deg, #06070b 0%, #0a0c14 100%);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    radial-gradient(circle at 78% 62%, rgba(255, 255, 255, 0.4) 1px, transparent 1px),
    radial-gradient(circle at 42% 88%, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 60px 60px, 80px 80px, 100px 100px;
  background-position: 0 0, 30px 40px, 12px 24px;
  opacity: 0.5;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.65;
  will-change: transform;
}

.orb-sun {
  top: -12%;
  left: -8%;
  width: 44rem;
  height: 44rem;
  background: radial-gradient(circle, rgba(255, 169, 77, 0.55), transparent 62%);
  animation: floatA 22s ease-in-out infinite;
}

.orb-green {
  top: -10%;
  right: -12%;
  width: 46rem;
  height: 46rem;
  background: radial-gradient(circle, rgba(78, 163, 255, 0.55), transparent 62%);
  animation: floatB 26s ease-in-out infinite;
}

.orb-rose {
  bottom: -18%;
  right: 14%;
  width: 40rem;
  height: 40rem;
  background: radial-gradient(circle, rgba(31, 214, 147, 0.42), transparent 62%);
  animation: floatC 30s ease-in-out infinite;
}

.bg-orbs::after {
  content: "";
  position: absolute;
  bottom: -8%;
  left: 8%;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 135, 224, 0.45), transparent 62%);
  filter: blur(90px);
  animation: floatD 34s ease-in-out infinite;
}

@keyframes floatD {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -40px) scale(1.07); }
}

@keyframes floatA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.06); }
}

@keyframes floatB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 40px) scale(1.08); }
}

@keyframes floatC {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, -50px) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .orb,
  .orb-sun,
  .orb-green,
  .orb-rose {
    animation: none;
  }
}

.gradient-text {
  color: var(--ink);
  text-shadow: 0 0 28px rgba(78, 163, 255, 0.22);
  animation: shimmerText 12s ease-in-out infinite;
}

@keyframes shimmerText {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

@media (prefers-reduced-motion: reduce) {
  .gradient-text { animation: none; }
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover {
  border-color: rgba(31, 214, 147, 0.6);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 24px rgba(31, 214, 147, 0.15);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button:disabled:hover {
  box-shadow: none;
  transform: none;
}

.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-color: transparent;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

body:not(.is-authenticated) .shell {
  display: none;
}

body.is-authenticated .auth-screen {
  display: none;
}

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card-solo {
  width: 100%;
  max-width: 400px;
}

.auth-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.auth-logo-sm {
  width: 28px;
  height: 28px;
}

.auth-art {
  max-width: 860px;
}

.auth-art img {
  width: 92px;
  height: 92px;
  margin-bottom: 22px;
  filter: drop-shadow(0 16px 28px rgba(15, 95, 165, 0.22));
}

.auth-art p:last-child {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.auth-card {
  padding: 26px;
  border: 1px solid var(--panel-edge);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 95, 165, 0.1), rgba(255, 200, 87, 0.2));
}

.auth-tabs button {
  border-color: transparent;
  background: transparent;
}

.auth-tabs button.active {
  background: rgba(78, 163, 255, 0.18);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(78, 163, 255, 0.5);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.hidden {
  display: none;
}

.link-button,
.ghost-button {
  border-color: transparent;
  background: transparent;
  color: var(--primary);
  box-shadow: none;
}

.link-button:hover,
.ghost-button:hover {
  background: rgba(15, 95, 165, 0.08);
  box-shadow: none;
}

.session-email {
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 700;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--panel-edge);
  background: linear-gradient(180deg, rgba(20, 26, 40, 0.78), rgba(10, 13, 20, 0.62));
  backdrop-filter: blur(22px);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 34px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 8px 18px rgba(15, 95, 165, 0.22));
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.key-box p,
.eyebrow,
.metrics span,
td,
label {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 8px;
}

.nav a {
  position: relative;
  transition: color 160ms ease, background 200ms ease, padding-left 200ms ease;
}

.nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0.2);
  width: 3px;
  height: 60%;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
}

.nav a.active,
.nav a:hover {
  background: linear-gradient(90deg, rgba(15, 95, 165, 0.12), rgba(25, 169, 116, 0.12));
  color: var(--primary);
  padding-left: 18px;
}

.nav a.active::before,
.nav a:hover::before {
  opacity: 1;
  transform: translateY(-50%) scaleY(1);
}

.key-box {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
}

.key-box label {
  display: block;
  margin-bottom: 8px;
}

.key-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  padding: 10px 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

input:hover,
select:hover,
textarea:hover {
  background: rgba(255, 255, 255, 0.07);
}

select option {
  background: #0a0d14;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(25, 169, 116, 0.14);
  outline: none;
}

textarea {
  resize: vertical;
}

.main {
  padding: 36px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
}

h1,
h2 {
  margin: 0;
  line-height: 1.02;
}

h1 {
  max-width: 920px;
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  letter-spacing: 0;
}

h2 {
  font-size: 1.4rem;
}

.status-card,
.panel,
.metrics article {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
}

.status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-top: 4px solid var(--sun);
}

.status-card small {
  display: block;
  color: var(--muted);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 0 0 rgba(201, 141, 0, 0.6);
}

.status-dot.ok {
  background: var(--ok);
  animation: pulse 2.4s ease-out infinite;
}

.status-dot.bad {
  background: var(--bad);
  animation: pulseBad 1.6s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(21, 131, 78, 0.5); }
  70% { box-shadow: 0 0 0 14px rgba(21, 131, 78, 0); }
  100% { box-shadow: 0 0 0 0 rgba(21, 131, 78, 0); }
}

@keyframes pulseBad {
  0% { box-shadow: 0 0 0 0 rgba(208, 68, 68, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(208, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(208, 68, 68, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .status-dot { animation: none !important; }
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metrics article {
  padding: 18px;
  position: relative;
  overflow: hidden;
  border-top: 4px solid var(--metric, var(--accent));
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.metrics article:focus-visible {
  outline: 2px solid var(--metric, var(--accent));
  outline-offset: 2px;
}

.metrics article:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 60px rgba(20, 42, 70, 0.18);
}

.metrics article::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--metric-glow, rgba(255, 200, 87, 0.22));
  transition: transform 320ms ease;
}

.metrics article:hover::after {
  transform: scale(1.15) rotate(8deg);
}

.metrics article[data-metric="usd"] { --metric: var(--accent); --metric-glow: rgba(25, 169, 116, 0.22); }
.metrics article[data-metric="brl"] { --metric: var(--primary); --metric-glow: rgba(15, 95, 165, 0.20); }
.metrics article[data-metric="rpm"] { --metric: var(--sun);    --metric-glow: rgba(255, 200, 87, 0.28); }
.metrics article[data-metric="rpd"] { --metric: var(--rose);   --metric-glow: rgba(255, 107, 138, 0.22); }

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
  color: var(--ink);
  text-shadow: 0 0 18px var(--metric-glow, rgba(31, 214, 147, 0.22));
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
  border-top: 4px solid rgba(25, 169, 116, 0.6);
  transition: box-shadow 220ms ease;
}

.panel:hover {
  box-shadow: 0 24px 60px rgba(20, 42, 70, 0.16);
}

#playground.panel { border-top-color: rgba(15, 95, 165, 0.65); }
#models.panel { border-top-color: rgba(255, 200, 87, 0.85); }

.hero,
.metrics,
.panel {
  animation: rise 540ms ease-out both;
}

.metrics { animation-delay: 60ms; }
#playground { animation-delay: 120ms; }
#requests { animation-delay: 180ms; }
#models { animation-delay: 240ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero, .metrics, .panel { animation: none; }
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.count-pill {
  display: inline-grid;
  place-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 169, 77, 0.18), rgba(78, 163, 255, 0.18));
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.form-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
}

.terminal {
  margin: 14px 0 0;
  padding: 18px;
  min-height: 88px;
  overflow: auto;
  border-radius: 12px;
  background: linear-gradient(160deg, #1a2438 0%, #131a2b 100%);
  color: #d8f3e3;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88rem;
  white-space: pre-wrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 36px rgba(15, 25, 45, 0.25);
}

.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.pager span {
  min-width: 86px;
  color: var(--muted);
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(60, 70, 95, 0.10);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--ink);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.model-card {
  padding: 16px;
  border: 1px solid var(--panel-edge);
  border-top: 4px solid var(--accent);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 200ms ease, box-shadow 200ms ease, border-top-color 200ms ease;
  font-weight: 600;
}

.model-card:hover {
  border-top-color: var(--sun);
}

.model-card strong {
  font-weight: 800;
}

.model-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(20, 42, 70, 0.12);
  border-left-color: var(--sun);
}

.consumption-totals {
  display: flex;
  gap: 18px;
  align-items: center;
}

.consumption-totals span {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.consumption-totals small {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
}

.consumption-totals b {
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.consumption-totals span:nth-child(1) b { color: var(--accent); }
.consumption-totals span:nth-child(2) b { color: var(--rose); }
.consumption-totals span:nth-child(3) b { color: var(--primary); }

.timeline-dialog {
  width: min(720px, calc(100vw - 28px));
  padding: 22px;
}

.timeline-chart {
  margin: 14px 0;
  padding: 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-edge);
}

.timeline-chart svg {
  width: 100%;
  height: 220px;
  display: block;
}

.timeline-chart .grid-line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.timeline-chart .area {
  fill: url(#timelineGradient);
  opacity: 0.4;
}

.timeline-chart .line {
  stroke: var(--accent);
  stroke-width: 2.5;
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.timeline-chart .dot {
  fill: var(--accent);
}

.timeline-chart text {
  fill: var(--muted);
  font-size: 11px;
  font-family: ui-sans-serif, sans-serif;
}

.timeline-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.timeline-summary div {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-edge);
  font-weight: 700;
}

.timeline-summary div small {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  font-weight: 700;
}

.muted-copy {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 720px;
}

.credits-panel {
  border-top-color: rgba(244, 183, 64, 0.85);
}

.credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.credit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 18px 18px;
  border: 1px solid var(--panel-edge);
  border-top: 4px solid var(--credit-stripe, var(--accent));
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 220ms ease, box-shadow 220ms ease;
  overflow: hidden;
}

.credit-card::after {
  content: "";
  position: absolute;
  top: -38px;
  right: -38px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--credit-glow, rgba(244, 183, 64, 0.34));
  filter: blur(8px);
  pointer-events: none;
  transition: transform 300ms ease;
}

.credit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px rgba(33, 26, 60, 0.18);
}

.credit-card:hover::after {
  transform: scale(1.15) rotate(10deg);
}

.credit-card[data-rank="1"] { --credit-stripe: var(--sun);    --credit-glow: rgba(255, 169, 77, 0.34); }
.credit-card[data-rank="2"] { --credit-stripe: var(--accent); --credit-glow: rgba(31, 214, 147, 0.34); }
.credit-card[data-rank="3"] { --credit-stripe: var(--primary);--credit-glow: rgba(78, 163, 255, 0.36); }
.credit-card[data-rank="4"] { --credit-stripe: var(--rose);   --credit-glow: rgba(255, 122, 160, 0.34); }
.credit-card[data-rank="5"] { --credit-stripe: var(--plum);   --credit-glow: rgba(167, 135, 224, 0.36); }

.credit-card .badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--primary), var(--plum));
  color: white;
  box-shadow: 0 6px 14px rgba(32, 101, 192, 0.28);
}

.credit-card .pkg-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.credit-card .pkg-price {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-shadow: 0 0 18px var(--credit-glow, rgba(78, 163, 255, 0.28));
}

.credit-card .pkg-credits {
  font-size: 0.96rem;
  color: var(--ink);
  font-weight: 700;
}

.credit-card .pkg-margin {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(31, 214, 147, 0.12);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.credit-card .pkg-desc {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.credit-card .pkg-breakdown {
  display: grid;
  gap: 6px;
  padding: 12px;
  margin: 6px 0 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
}

.credit-card .pkg-breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

.credit-card .pkg-breakdown-row span {
  display: grid;
  gap: 2px;
}

.credit-card .pkg-breakdown-row small {
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.7rem;
  font-weight: 700;
}

.credit-card .pkg-breakdown-row b {
  color: var(--ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.credit-card button {
  margin-top: auto;
  width: 100%;
  font-weight: 700;
}

.checkout-dialog {
  width: min(620px, calc(100vw - 28px));
}

.checkout-details {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 12px;
}

.checkout-details div {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.checkout-details small,
.checkout-details strong {
  display: block;
}

.checkout-details small {
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.checkout-details strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.checkout-breakdown {
  position: relative;
  z-index: 1;
  text-align: left;
}

.checkout-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.topups-wrap {
  border-top: 1px solid rgba(60, 70, 95, 0.10);
  padding-top: 20px;
}

.topups-wrap h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.topups-list {
  display: grid;
  gap: 10px;
}

.topup-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--panel-edge);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  font-weight: 600;
}

.topup-row .topup-amount {
  font-weight: 700;
}

.topup-row .topup-credits {
  color: var(--muted);
  font-size: 0.88rem;
}

.topup-row .topup-date {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.topups-empty {
  padding: 18px;
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.5);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .topup-row {
    grid-template-columns: 1fr 1fr;
  }
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(99, 112, 135, 0.14);
  color: var(--muted);
  white-space: nowrap;
}

.status-badge.success {
  background: rgba(21, 131, 78, 0.14);
  color: var(--ok);
}

.status-badge.error,
.status-badge.provider_error {
  background: rgba(208, 68, 68, 0.14);
  color: var(--bad);
}

.status-badge.provider_rate_limited {
  background: rgba(201, 141, 0, 0.18);
  color: var(--warn);
}

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover {
  background: rgba(32, 101, 192, 0.06);
}

.model-card small {
  color: var(--muted);
}

dialog {
  width: min(920px, calc(100vw - 28px));
  border: 1px solid var(--panel-edge);
  border-radius: 16px;
  color: var(--ink);
  background: linear-gradient(160deg, #161a26, #0c0f17);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
}

.celebration-dialog {
  width: min(480px, calc(100vw - 28px));
  padding: 32px 28px 28px;
  text-align: center;
  border: 1px solid var(--panel-edge);
  border-radius: 16px;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 169, 77, 0.22), transparent 12rem),
    radial-gradient(circle at 88% 2%, rgba(31, 214, 147, 0.18), transparent 13rem),
    radial-gradient(circle at 92% 98%, rgba(255, 122, 160, 0.16), transparent 13rem),
    linear-gradient(160deg, #161a26, #0c0f17);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55);
  animation: popIn 360ms cubic-bezier(0.2, 0.9, 0.3, 1.4);
  overflow: hidden;
  position: relative;
}

.celebration-dialog::before,
.celebration-dialog::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.celebration-dialog::before {
  top: -30px;
  left: -20px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 200, 87, 0.45), transparent 70%);
  filter: blur(8px);
}

.celebration-dialog::after {
  bottom: -36px;
  right: -24px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(25, 169, 116, 0.40), transparent 70%);
  filter: blur(10px);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.86) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.celebration-dialog::backdrop {
  background: rgba(21, 32, 51, 0.42);
  backdrop-filter: blur(6px);
}

.celebration-dialog h2 {
  margin: 14px 0 6px;
  font-size: 1.55rem;
  color: var(--ink);
  text-shadow: 0 0 20px rgba(31, 214, 147, 0.22);
}

.celebration-dialog p {
  color: var(--muted);
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.celebration-dialog strong {
  color: var(--primary);
}

.celebration-mark {
  position: relative;
  display: inline-block;
}

.celebration-mark img {
  width: 84px;
  height: 84px;
  filter: drop-shadow(0 14px 26px rgba(15, 95, 165, 0.22));
  animation: bobble 3.6s ease-in-out infinite;
}

@keyframes bobble {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

.spam-tip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 200, 87, 0.22);
  color: #8a5d00;
  font-size: 0.82rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.spam-tip::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 4px rgba(255, 200, 87, 0.3);
}

.celebration-dialog .auth-form {
  margin-top: 18px;
  text-align: left;
  position: relative;
  z-index: 1;
}

.celebration-dialog .primary {
  margin-top: 18px;
  width: 100%;
}

.topup-celebration {
  width: min(520px, calc(100vw - 28px));
}

.topup-celebration .confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.topup-celebration .confetti span {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.9;
  animation: confettiFall 2.6s linear forwards;
}

.topup-celebration .confetti span:nth-child(5n + 1) { background: var(--sun); }
.topup-celebration .confetti span:nth-child(5n + 2) { background: var(--accent); }
.topup-celebration .confetti span:nth-child(5n + 3) { background: var(--primary); }
.topup-celebration .confetti span:nth-child(5n + 4) { background: var(--rose); }
.topup-celebration .confetti span:nth-child(5n + 5) { background: var(--plum); }

.topup-celebration .confetti span:nth-child(1)  { left: 4%;  animation-delay: 0.00s; }
.topup-celebration .confetti span:nth-child(2)  { left: 12%; animation-delay: 0.20s; }
.topup-celebration .confetti span:nth-child(3)  { left: 20%; animation-delay: 0.50s; }
.topup-celebration .confetti span:nth-child(4)  { left: 28%; animation-delay: 0.10s; }
.topup-celebration .confetti span:nth-child(5)  { left: 36%; animation-delay: 0.70s; }
.topup-celebration .confetti span:nth-child(6)  { left: 44%; animation-delay: 0.30s; }
.topup-celebration .confetti span:nth-child(7)  { left: 52%; animation-delay: 0.90s; }
.topup-celebration .confetti span:nth-child(8)  { left: 60%; animation-delay: 0.05s; }
.topup-celebration .confetti span:nth-child(9)  { left: 68%; animation-delay: 0.60s; }
.topup-celebration .confetti span:nth-child(10) { left: 76%; animation-delay: 0.25s; }
.topup-celebration .confetti span:nth-child(11) { left: 84%; animation-delay: 0.80s; }
.topup-celebration .confetti span:nth-child(12) { left: 92%; animation-delay: 0.15s; }
.topup-celebration .confetti span:nth-child(13) { left: 8%;  animation-delay: 1.20s; }
.topup-celebration .confetti span:nth-child(14) { left: 24%; animation-delay: 1.50s; }
.topup-celebration .confetti span:nth-child(15) { left: 40%; animation-delay: 1.10s; }
.topup-celebration .confetti span:nth-child(16) { left: 56%; animation-delay: 1.40s; }
.topup-celebration .confetti span:nth-child(17) { left: 72%; animation-delay: 1.00s; }
.topup-celebration .confetti span:nth-child(18) { left: 88%; animation-delay: 1.60s; }
.topup-celebration .confetti span:nth-child(19) { left: 16%; animation-delay: 1.80s; }
.topup-celebration .confetti span:nth-child(20) { left: 64%; animation-delay: 1.90s; }

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 1; }
  100% {
    transform: translateY(420px) rotate(540deg);
    opacity: 0;
  }
}

.topup-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 18px auto 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(15, 95, 165, 0.10);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.92rem;
  position: relative;
  z-index: 1;
}

.topup-status.paid {
  background: rgba(21, 131, 78, 0.14);
  color: var(--ok);
}

.topup-status.review {
  background: rgba(201, 141, 0, 0.18);
  color: var(--warn);
}

.topup-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.9s linear infinite;
}

.topup-status.paid .topup-spinner,
.topup-status.review .topup-spinner {
  border: 2px solid currentColor;
  border-radius: 50%;
  animation: none;
  position: relative;
}

.topup-status.paid .topup-spinner::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: currentColor;
}

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

.receipt-dialog {
  padding: 24px;
}

.receipt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.receipt-head strong {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--ink);
}

.receipt-card {
  display: grid;
  gap: 16px;
}

.receipt-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(32, 101, 192, 0.92), rgba(21, 166, 119, 0.88));
  color: white;
  box-shadow: 0 18px 40px rgba(32, 101, 192, 0.22);
}

.receipt-hero .receipt-model {
  font-size: 1.1rem;
  font-weight: 700;
}

.receipt-hero .receipt-provider {
  display: block;
  font-size: 0.84rem;
  opacity: 0.86;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 2px;
}

.receipt-hero .receipt-cost {
  margin-left: auto;
  text-align: right;
}

.receipt-hero .receipt-cost b {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.receipt-hero .receipt-cost small {
  display: block;
  font-size: 0.82rem;
  opacity: 0.86;
}

.receipt-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.receipt-pills .pill {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-edge);
  font-weight: 700;
}

.receipt-pills .pill small {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.receipt-pills .pill strong {
  font-size: 1rem;
}

.receipt-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 252, 246, 0.6);
  border: 1px solid var(--panel-edge);
  font-size: 0.86rem;
  color: var(--muted);
}

.receipt-meta div span {
  color: var(--ink);
  font-weight: 600;
}

.receipt-hash {
  padding: 12px 14px;
  border-radius: 10px;
  background: #131a2b;
  color: #d8f3e3;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  word-break: break-all;
}

.receipt-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

@media (max-width: 540px) {
  .receipt-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .receipt-hero .receipt-cost {
    margin-left: 0;
    text-align: left;
  }
  .receipt-meta {
    grid-template-columns: 1fr;
  }
}

.metrics strong {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .celebration-dialog { animation: none; }
  .celebration-mark img { animation: none; }
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(12, 16, 24, 0.96);
  color: #f0f4fa;
  border: 1px solid rgba(78, 163, 255, 0.35);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
  z-index: 9999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* --- Button spinner state ------------------------------------------------- */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: btn-spin 0.8s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}

button.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

button.is-loading .btn-label {
  visibility: hidden;
}

button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: btn-spin 0.8s linear infinite;
}

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

/* --- Inline auth notice (success / error / info) ------------------------- */
.auth-notice {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  animation: notice-in 240ms ease;
}

.auth-notice.show {
  display: flex;
}

.auth-notice .notice-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.auth-notice .notice-text {
  flex: 1 1 auto;
  color: var(--ink);
}

.auth-notice.success {
  border-color: rgba(31, 214, 147, 0.4);
  background: linear-gradient(135deg, rgba(31, 214, 147, 0.14), rgba(31, 214, 147, 0.04));
}
.auth-notice.success .notice-icon {
  background: rgba(31, 214, 147, 0.22);
  color: var(--ok);
}

.auth-notice.error {
  border-color: rgba(255, 107, 107, 0.42);
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.16), rgba(255, 107, 107, 0.04));
}
.auth-notice.error .notice-icon {
  background: rgba(255, 107, 107, 0.22);
  color: var(--bad);
}

.auth-notice.info {
  border-color: rgba(78, 163, 255, 0.4);
  background: linear-gradient(135deg, rgba(78, 163, 255, 0.16), rgba(78, 163, 255, 0.04));
}
.auth-notice.info .notice-icon {
  background: rgba(78, 163, 255, 0.22);
  color: var(--primary);
}

@keyframes notice-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========================================================================= */
/* ADMIN PANEL                                                                */
/* ========================================================================= */
.admin-panel { border-top-color: rgba(167, 135, 224, 0.7); }

.admin-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.admin-overview .metric-card {
  cursor: default;
}

.admin-block {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 14px;
  padding: 18px;
  margin-top: 16px;
  backdrop-filter: blur(8px);
}

.admin-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-block-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.admin-block-head input[type="search"] {
  width: min(260px, 60vw);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.85rem;
}

.admin-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
}

.admin-empty {
  margin: 0;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--panel-edge);
}

.admin-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-actions button {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: 8px;
}

.admin-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(167, 135, 224, 0.2);
  color: var(--plum);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-empty-ok {
  color: var(--ok);
  border: 1px solid rgba(31, 214, 147, 0.25);
  border-radius: 10px;
  background: rgba(31, 214, 147, 0.06);
}

.admin-empty-bad {
  color: var(--bad);
  border: 1px solid rgba(255, 107, 107, 0.25);
  border-radius: 10px;
  background: rgba(255, 107, 107, 0.06);
  text-align: left;
  word-break: break-word;
}

/* ========================================================================= */
/* AUTH SCREEN — completely new design                                       */
/* Centered card, minimal, modern fintech vibe (Linear / Notion / Stripe)    */
/* ========================================================================= */

body:not(.is-authenticated) {
  background: #fafbfd;
  color: #0e1626;
}

body:not(.is-authenticated)::before { display: none; }
body:not(.is-authenticated) .bg-orbs { display: none; }

/* Background subtle: dot grid + single soft accent blob */
body:not(.is-authenticated) {
  background-image:
    radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.10) 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
    radial-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px;
}

/* Layout: ONE column, card centered */
body:not(.is-authenticated) .auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  grid-template-columns: none;
  gap: 0;
}

/* Esconde a coluna de hero da esquerda */
body:not(.is-authenticated) .auth-art { display: none; }

/* CARD principal — branco, generoso, sombra suave */
body:not(.is-authenticated) .auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 36px 32px;
  background: #ffffff;
  border: 1px solid #e6e8ee;
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.06),
    0 24px 48px rgba(15, 23, 42, 0.04);
  backdrop-filter: none;
  position: relative;
}

/* Logo + nome no topo do card */
body:not(.is-authenticated) .auth-card::before {
  content: "";
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  background-image: url("/assets/softpog-logo.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

body:not(.is-authenticated) .auth-card .auth-title {
  text-align: center;
  margin: 0 0 6px;
  color: #0e1626;
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

body:not(.is-authenticated) .auth-card .auth-sub {
  text-align: center;
  margin: 0 0 28px;
  color: #6b7280;
  font-size: 0.94rem;
  line-height: 1.5;
}

/* Tabs minimalistas (underline em vez de pill) */
body:not(.is-authenticated) .auth-tabs {
  display: flex;
  background: transparent;
  padding: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid #e6e8ee;
  gap: 0;
}
body:not(.is-authenticated) .auth-tabs button {
  flex: 1;
  background: transparent;
  border: none;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.93rem;
  padding: 12px 0;
  margin-bottom: -1px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  box-shadow: none;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}
body:not(.is-authenticated) .auth-tabs button:hover {
  color: #0e1626;
  background: transparent;
}
body:not(.is-authenticated) .auth-tabs button.active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
  background: transparent;
  box-shadow: none;
}

/* Form gap */
body:not(.is-authenticated) .auth-form {
  display: grid;
  gap: 16px;
}

/* Labels e inputs limpos */
body:not(.is-authenticated) .auth-form label {
  display: block;
  color: #374151;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0;
}
body:not(.is-authenticated) .auth-form input {
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #0e1626;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
body:not(.is-authenticated) .auth-form input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16);
}
body:not(.is-authenticated) .auth-form input::placeholder {
  color: #9ca3af;
}

/* Botão primário — solid, sem gradiente, vibe Linear */
body:not(.is-authenticated) .auth-card .primary {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
  transition: background-color 140ms ease, box-shadow 140ms ease, transform 80ms ease;
}
body:not(.is-authenticated) .auth-card .primary:hover {
  background: #4338ca;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}
body:not(.is-authenticated) .auth-card .primary:active {
  transform: translateY(1px);
}

/* Link "esqueci minha senha" como link de texto puro */
body:not(.is-authenticated) .auth-card .link-button {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 4px;
  padding: 6px 0;
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 140ms ease;
}
body:not(.is-authenticated) .auth-card .link-button:hover {
  color: #4f46e5;
  background: transparent;
}

/* Notice acima dos tabs (compacta, sem visual carregado) */
body:not(.is-authenticated) .auth-notice {
  padding: 11px 14px;
  margin-bottom: 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  border: 1px solid;
}
body:not(.is-authenticated) .auth-notice .notice-text {
  color: #1f2937;
  font-weight: 500;
}
body:not(.is-authenticated) .auth-notice.success {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
body:not(.is-authenticated) .auth-notice.success .notice-icon { background: #10b981; color: #fff; }
body:not(.is-authenticated) .auth-notice.error {
  background: #fef2f2;
  border-color: #fecaca;
}
body:not(.is-authenticated) .auth-notice.error .notice-icon { background: #ef4444; color: #fff; }
body:not(.is-authenticated) .auth-notice.info {
  background: #eef2ff;
  border-color: #c7d2fe;
}
body:not(.is-authenticated) .auth-notice.info .notice-icon { background: #4f46e5; color: #fff; }

/* Auth screen NAO mais 100vh — deixa rodape aparecer abaixo natural */
body:not(.is-authenticated) .auth-screen {
  min-height: 100vh;
}

/* "scroll for more" hint sutil no canto inferior central da tela de login */
body:not(.is-authenticated) .auth-screen::after {
  content: "↓ a nossa historia";
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: #9ca3af;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  animation: scroll-hint 2.4s ease-in-out infinite;
}

@keyframes scroll-hint {
  0%, 100% { opacity: 0.5; transform: translate(-50%, 0); }
  50%      { opacity: 1;   transform: translate(-50%, 4px); }
}

/* Dialogs no tema claro */
body:not(.is-authenticated) .celebration-dialog {
  background: #ffffff;
  color: #0e1626;
  border: 1px solid #e6e8ee;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  padding: 30px 28px;
}
body:not(.is-authenticated) .celebration-dialog h2 { color: #0e1626; font-weight: 700; }
body:not(.is-authenticated) .celebration-dialog p  { color: #4b5563; }
body:not(.is-authenticated) .celebration-dialog .spam-tip { color: #6b7280; }
body:not(.is-authenticated) .celebration-dialog .primary {
  background: #4f46e5;
  color: #fff;
  border-radius: 8px;
}
body:not(.is-authenticated) .celebration-dialog .primary:hover { background: #4338ca; }
body:not(.is-authenticated) .celebration-dialog input {
  background: #fff;
  border: 1px solid #d1d5db;
  color: #0e1626;
  border-radius: 8px;
}
body:not(.is-authenticated) .celebration-dialog .ghost-button {
  color: #6b7280;
  background: transparent;
}

/* Mobile: card ocupa quase a tela inteira */
@media (max-width: 480px) {
  body:not(.is-authenticated) .auth-card {
    padding: 32px 24px 24px;
    border-radius: 12px;
  }
  body:not(.is-authenticated) .auth-screen::after {
    font-size: 0.72rem;
    bottom: 12px;
  }
}

/* ========================================================================= */
/* SITE FOOTER — historia + missao SoftPog (visivel sempre)                  */
/* ========================================================================= */

.site-footer {
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(79, 70, 229, 0.10), transparent 70%),
    linear-gradient(180deg, #0e1626 0%, #0a1020 100%);
  color: #d6dbe6;
  padding: 88px 24px 32px;
  overflow: hidden;
  isolation: isolate;
}

/* Pattern sutil de pontos atras */
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.35;
  z-index: -1;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
}

/* Hero do footer (slogan grande) */
.footer-hero {
  max-width: 880px;
  margin: 0 auto 56px;
  text-align: center;
}

.footer-eyebrow {
  color: #a5b4fc;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 0 18px;
}

.footer-slogan {
  font-size: clamp(2rem, 5.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 22px;
  color: #ffffff;
}

.footer-slogan-accent {
  background: linear-gradient(135deg, #818cf8 0%, #f472b6 60%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.footer-tagline {
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.55;
  color: #b8c0d4;
  max-width: 640px;
  margin: 0 auto;
  font-weight: 400;
}

/* Stats em faixa */
.footer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 880px;
  margin: 0 auto 72px;
  padding: 28px 32px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}

.footer-stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-stat strong {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #c7d2fe, #ffffff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-stat span {
  font-size: 0.85rem;
  color: #9aa3b8;
  line-height: 1.35;
}

/* Tres colunas de historia */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  max-width: 1100px;
  margin: 0 auto 72px;
}

.footer-col h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.005em;
  line-height: 1.3;
}

.footer-col p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #aeb6ca;
}

/* Manifesto — frase de fechamento com peso */
.footer-manifesto {
  max-width: 880px;
  margin: 0 auto 64px;
  padding: 32px 36px;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.10), rgba(244, 114, 182, 0.06));
  border-left: 3px solid #818cf8;
  border-radius: 4px 14px 14px 4px;
  position: relative;
}

.footer-manifesto::before {
  content: "“";
  position: absolute;
  top: -10px;
  left: 18px;
  font-size: 4rem;
  line-height: 1;
  color: rgba(129, 140, 248, 0.4);
  font-family: Georgia, serif;
}

.footer-manifesto p {
  margin: 0;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.6;
  color: #d6dbe6;
  font-weight: 400;
}

.footer-manifesto strong {
  display: block;
  margin: 14px 0;
  color: #ffffff;
  font-weight: 700;
  font-size: clamp(1.15rem, 1.7vw, 1.4rem);
  line-height: 1.45;
}

/* Italic no hero ganha um peso especial */
.footer-tagline em {
  color: #ffffff;
  font-weight: 700;
  font-style: normal;
}

/* Bloco "Onde estamos / Equipe / Contato" — 3 colunas pequenas */
.footer-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto 56px;
  padding: 32px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.footer-meta-block h4 {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #a5b4fc;
}

.footer-meta-block p {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: #d6dbe6;
  line-height: 1.5;
}

.footer-meta-block strong {
  color: #ffffff;
  font-weight: 600;
}

.footer-meta-role {
  display: block;
  color: #8b94a8;
  font-size: 0.82rem;
  margin-top: 2px;
}

.footer-meta-extra {
  color: #8b94a8 !important;
  font-size: 0.86rem !important;
}

.footer-meta-divine {
  color: #fbbf24;
  margin-right: 4px;
}

.footer-meta-link {
  display: inline-block;
  margin-top: 8px;
  color: #818cf8;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 140ms ease;
}

.footer-meta-link:hover { color: #c7d2fe; }

.footer-meta-block a {
  color: #c7d2fe;
  text-decoration: none;
  transition: color 140ms ease;
}

.footer-meta-block a:hover { color: #ffffff; }

/* Linha inferior fina */
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 4px 12px rgba(129, 140, 248, 0.3));
}

.footer-brand strong {
  display: block;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
}

.footer-brand small {
  display: block;
  color: #6b7488;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.footer-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: #9aa3b8;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 140ms ease;
}

.footer-nav a:hover {
  color: #ffffff;
}

/* Mobile: tudo empilhado */
@media (max-width: 820px) {
  .site-footer { padding: 64px 20px 28px; }
  .footer-stats {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 24px;
    margin-bottom: 56px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 48px;
  }
  .footer-meta-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
    margin-bottom: 40px;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .footer-brand { flex-direction: column; gap: 8px; }
  .footer-nav { justify-content: center; }
}

@media (max-width: 900px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }

  .auth-art {
    max-width: none;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .key-box {
    position: static;
    margin-top: 24px;
  }

  .main {
    padding: 22px;
  }

  .hero,
  .form-grid,
  .filters,
  .metrics,
  .checkout-details,
  .checkout-actions {
    grid-template-columns: 1fr;
  }
}

/* ===== PLANOS ===== */

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 20px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.plan-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}

.plan-card--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 32px rgba(31, 214, 147, 0.15);
}

.plan-card .pkg-price small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 2px;
}

.plan-features {
  margin: 0;
  padding: 0 0 0 16px;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-active-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  background: rgba(31, 214, 147, 0.06);
  border: 1px solid rgba(31, 214, 147, 0.3);
  border-radius: 14px;
  margin-bottom: 8px;
}

.plan-active-card strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.plan-active-card span {
  font-size: 0.88rem;
  color: var(--muted);
}
