:root {
  --bg: linear-gradient(135deg, #f7f9fc, #eef2f7);
  --card: #ffffff;
  --card-border: #e2e8f0;
  --text: #0f172a;
  --muted: #6b7280;
  --accent: #0ea5e9;
  --accent-strong: #0ea5e9;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', 'Helvetica Neue', Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.shell {
  max-width: 960px;
  width: 100%;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

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

.title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 32px;
  letter-spacing: -0.02em;
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  align-items: center;
}

.hero-text h1 {
  margin: 0 0 12px;
  font-size: 40px;
  letter-spacing: -0.03em;
}

.hero-text p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(14, 165, 233, 0.08);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.pill:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.pill span {
  width: 10px;
  height: 10px;
  background: var(--accent-strong);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.12);
}

.card-inner {
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--accent-strong);
  color: #0b1021;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.25);
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--card-border);
  box-shadow: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(34, 211, 238, 0.35);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.feature {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
}

.feature h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.feature p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 14px;
}

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

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.7), rgba(59, 130, 246, 0.6));
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #0b1021;
}

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

@media (max-width: 640px) {
  body {
    padding: 24px 12px;
  }

  .hero-text h1 {
    font-size: 32px;
  }
}

/* --- Top up page --- */
.topup-body {
  background: linear-gradient(135deg, #f7f9fc 0%, #eef2f7 100%);
  align-items: flex-start;
  justify-content: center;
  padding-top: 28px;
}

.topup-shell {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  padding: 12px;
}

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

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

.logo-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #22d3ee, #38bdf8);
  box-shadow: 0 8px 30px rgba(56, 189, 248, 0.25);
}

.brand-text h1 {
  margin: 4px 0 8px;
  letter-spacing: -0.02em;
  font-size: 28px;
}

.lede {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.form-card {
  margin-top: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.topup-form {
  display: grid;
  gap: 10px;
}

.topup-form label {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.topup-form input {
  width: 100%;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--text);
  font-size: 16px;
}

.btn.block {
  width: 100%;
  justify-content: center;
}

.btn.secondary[disabled],
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.success {
  background: #22c55e;
  color: #0b1021;
  border-color: rgba(34, 197, 94, 0.9);
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.35);
}

.btn.success:hover {
  box-shadow: 0 14px 40px rgba(34, 197, 94, 0.45);
}

.form-hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.alert {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: #f8fafc;
  color: var(--text);
  font-size: 14px;
}

.alert.error {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.1);
}

.alert ul {
  margin: 8px 0 0 16px;
  padding: 0;
}

.alert.muted {
  color: var(--muted);
}

.topup-results {
  margin-top: 18px;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  font-weight: 700;
  font-size: 13px;
}

.topup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.topup-card {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}

.topup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-name {
  margin: 0 0 4px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.price {
  font-weight: 800;
  font-size: 18px;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  font-size: 13px;
}

.chip.subtle {
  background: rgba(255, 255, 255, 0.03);
}

.chip-row.wrap {
  flex-wrap: wrap;
}

.operators {
  border-top: 1px solid var(--card-border);
  padding-top: 8px;
}

.topup-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
}

.topup-label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.topup-select {
  width: 100%;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: #fff;
  color: var(--text);
  font-size: 16px;
}

.logo-slot {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  border: 2px dashed #cbd5e1;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 10, 25, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #e2e8f0;
  font-weight: 700;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.loading-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: #22d3ee;
  animation: spin 0.9s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 10, 25, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #e2e8f0;
  font-weight: 700;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.loading-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: #22d3ee;
  animation: spin 0.9s linear infinite;
}

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

/* --- Usage page --- */
.usage-body {
  background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 55%),
    linear-gradient(160deg, #f8fafc, #e6f3f8 65%);
  align-items: flex-start;
  justify-content: center;
  padding-top: 28px;
}

.usage-shell {
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  padding: 12px;
}

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

.usage-card {
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.usage-form {
  display: grid;
  gap: 10px;
}

.usage-form label {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.usage-form input {
  width: 100%;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--text);
  font-size: 16px;
}

.usage-results {
  margin-top: 18px;
}

.usage-progress-wrap {
  margin: 12px 0 18px;
}

.usage-progress-visuals {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}

.usage-ring {
  width: 94px;
  height: 94px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  background: conic-gradient(
    #22c55e calc(var(--usage-percent, 0) * 1%),
    rgba(15, 23, 42, 0.12) 0
  );
}

.usage-ring-center {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 800;
  color: var(--text);
  z-index: 1;
}

.usage-ring-center span {
  font-size: 18px;
  line-height: 1;
}

.usage-ring-center small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.usage-progress {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.usage-progress-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  border-radius: 999px;
}

.usage-progress-label {
  margin-top: 8px;
  font-size: 13px;
}

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

.usage-stat {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  background: #f8fafc;
}

.usage-value {
  margin: 4px 0 0;
  font-weight: 800;
  font-size: 18px;
}

.usage-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.usage-meta {
  border: 1px dashed var(--card-border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(248, 250, 252, 0.7);
  font-size: 14px;
}

.usage-note {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.usage-link {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.usage-link:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .topup-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

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

  .usage-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .usage-meta-grid {
    grid-template-columns: 1fr;
  }

  .usage-progress-visuals {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}
