:root {
  color-scheme: dark;
  --bg: #0b0b10;
  --bg-soft: #101018;
  --surface: #16161f;
  --surface-2: #1c1c27;
  --surface-3: #22222e;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f7;
  --text-on-brand: #fff;
  --muted: #a4a4b4;
  --dim: #8d8d9e;
  --brand: #ff3b30;
  --brand-2: #ff4d8d;
  --accent: #ff8a3d;
  --brand-text: #ff8f85;
  --ok: #37d67a;
  --ok-soft: rgba(55, 214, 122, 0.12);
  --warn: #ffc043;
  --warn-soft: rgba(255, 192, 67, 0.12);
  --low: #ff5f57;
  --low-soft: rgba(255, 95, 87, 0.12);
  --track: rgba(255, 255, 255, 0.08);
  --field: rgba(22, 22, 31, 0.72);
  --aurora: 1;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
  --shadow-sm: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f9;
  --bg-soft: #ececf3;
  --surface: #ffffff;
  --surface-2: #f7f7fb;
  --surface-3: #efeff6;
  --line: rgba(18, 18, 32, 0.1);
  --line-strong: rgba(18, 18, 32, 0.2);
  --text: #17171f;
  --text-on-brand: #fff;
  --muted: #5b5b6b;
  --dim: #6c6c7e;
  --brand-text: #cc1f16;
  --ok: #0f8a4a;
  --ok-soft: rgba(15, 138, 74, 0.1);
  --warn: #9a6400;
  --warn-soft: rgba(154, 100, 0, 0.1);
  --low: #c62a20;
  --low-soft: rgba(198, 42, 32, 0.09);
  --track: rgba(18, 18, 32, 0.09);
  --field: rgba(255, 255, 255, 0.86);
  --aurora: 0.5;
  --shadow: 0 24px 60px -34px rgba(24, 24, 48, 0.4);
  --shadow-sm: 0 10px 26px -18px rgba(24, 24, 48, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.aurora {
  position: fixed;
  inset: -18% -10% auto;
  height: 640px;
  opacity: var(--aurora);
  background:
    radial-gradient(42% 55% at 22% 34%, rgba(255, 59, 48, 0.22), transparent 70%),
    radial-gradient(38% 48% at 76% 22%, rgba(255, 77, 141, 0.16), transparent 70%),
    radial-gradient(40% 50% at 55% 64%, rgba(94, 92, 255, 0.12), transparent 70%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}

.topbar,
.shell,
.foot {
  position: relative;
  z-index: 1;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 20px 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
}

.brand strong {
  font-weight: 700;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.16);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--field);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--muted);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

:root[data-theme="dark"] .icon-sun,
:root[data-theme="light"] .icon-moon {
  display: none;
}

:root[data-theme="light"] .icon-sun {
  display: block;
}

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 20px 72px;
}

.hero {
  max-width: 720px;
}

.hero-text {
  max-width: 720px;
}

@media (min-width: 1000px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 10px 56px;
    align-items: center;
  }

  .hero-text {
    max-width: none;
  }

  .hero-text h1 {
    font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  }

  .hero-form .search {
    max-width: none;
    margin-top: 4px;
  }
}

body.has-result .lede,
body.has-result .trust,
body.has-result .eyebrow {
  display: none;
}

@media (max-width: 999px) {
  body.has-result .hero-text h1 {
    font-size: clamp(1.4rem, 6vw, 1.9rem);
  }

  body.has-result .search {
    margin-top: 12px;
  }
}

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

h1 {
  margin: 0;
  font-size: clamp(2rem, 5.6vw, 3.35rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.grad {
  background: linear-gradient(100deg, var(--brand) 5%, var(--accent) 55%, var(--brand-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

:root[data-theme="light"] .grad {
  background: linear-gradient(100deg, #e0241a 5%, #e2620a 55%, #d81b6a 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.lede {
  max-width: 54ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 2.3vw, 1.06rem);
}

.search {
  max-width: 640px;
  margin-top: 26px;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) + 2px);
  background: var(--field);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-row:focus-within {
  border-color: rgba(255, 90, 70, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.12), var(--shadow);
}

.input-row.is-invalid {
  border-color: rgba(255, 95, 87, 0.6);
}

.input-icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.input-row input {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 1.06rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  outline: none;
}

.input-row input::placeholder {
  color: var(--dim);
  letter-spacing: 0.04em;
}

.input-row button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 136px;
  padding: 14px 22px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), #e8332a 45%, var(--brand-2));
  color: var(--text-on-brand);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.input-row button:hover:not(:disabled),
.btn:hover:not(:disabled) {
  filter: brightness(1.07);
}

.input-row button:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

.input-row button:disabled {
  cursor: not-allowed;
  background: var(--surface-3);
  color: var(--dim);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

form.busy .input-row button:disabled {
  cursor: progress;
  background: linear-gradient(135deg, var(--brand), #e8332a 45%, var(--brand-2));
  color: var(--text-on-brand);
  box-shadow: none;
  filter: saturate(0.6);
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

form.busy .spinner {
  display: inline-block;
}

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

.hint {
  margin: 12px 2px 0;
  color: var(--dim);
  font-size: 0.85rem;
}

.hint strong {
  color: var(--muted);
  font-weight: 600;
}

.hint.error {
  color: var(--low);
  font-weight: 600;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--dim);
  font-size: 0.82rem;
}

.trust li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.trust li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  opacity: 0.8;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.live:empty {
  display: none;
}

.live {
  margin-top: 26px;
}

.result {
  margin-top: 18px;
  display: grid;
  gap: 16px;
  outline: none;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow-sm);
}

.summary {
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.summary::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 120, 90, 0.6), transparent);
}

.summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.balance {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.balance small {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
}

.balance-sub {
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 0.85rem;
}

.summary-side {
  display: grid;
  justify-items: end;
  gap: 6px;
  text-align: right;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill-ok {
  color: var(--ok);
  background: var(--ok-soft);
}

.pill-warn {
  color: var(--warn);
  background: var(--warn-soft);
}

.pill-low {
  color: var(--low);
  background: var(--low-soft);
}

.msisdn {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.provider {
  margin: 0;
  color: var(--dim);
  font-size: 0.82rem;
}

.meter {
  margin-top: 22px;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--dim);
  font-size: 0.8rem;
}

.meter-head strong {
  color: var(--muted);
  font-weight: 600;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.facts div {
  min-width: 0;
}

.facts dt {
  color: var(--dim);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts dd {
  margin: 4px 0 0;
  font-size: 0.94rem;
  font-weight: 600;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--field);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.18s ease, border-color 0.18s ease;
}

.btn:hover:not(:disabled) {
  border-color: var(--muted);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 2px 0;
}

.section-head h2 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-head span {
  color: var(--dim);
  font-size: 0.82rem;
}

.packages {
  display: grid;
  gap: 14px;
}

@media (min-width: 820px) {
  .packages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .packages > .pkg:only-child {
    grid-column: 1 / -1;
  }
}

.pkg {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.pkg.is-empty {
  background: var(--surface-2);
}

.pkg.is-empty .pkg-name,
.pkg.is-empty .pkg-amount strong {
  color: var(--muted);
}

.pkg-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pkg-name {
  margin: 0;
  font-size: 0.99rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.tag {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag-ok {
  border-color: rgba(55, 214, 122, 0.3);
  color: var(--ok);
  background: var(--ok-soft);
}

.tag-empty {
  border-color: rgba(255, 95, 87, 0.28);
  color: var(--low);
  background: var(--low-soft);
}

.pkg-amount {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.pkg-amount strong {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.pkg-amount span {
  color: var(--dim);
  font-size: 0.82rem;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-row > .bar {
  flex: 1;
}

.bar-pct {
  flex: none;
  min-width: 42px;
  text-align: right;
  color: var(--dim);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.bar-ok > span {
  background: linear-gradient(90deg, #22c55e, #6ee7a2);
}

.bar-warn > span {
  background: linear-gradient(90deg, #f59e0b, var(--warn));
}

.bar-low > span {
  background: linear-gradient(90deg, #dc2626, var(--low));
}

.bar-sm {
  height: 5px;
}

.quota-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quota-list li {
  display: grid;
  gap: 7px;
}

.q-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.q-name {
  color: var(--muted);
  font-size: 0.84rem;
}

.q-val {
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.q-meta {
  margin: 0;
  color: var(--dim);
  font-size: 0.76rem;
}

.pkg-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.note,
.alert {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.note {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.alert {
  border: 1px solid rgba(255, 95, 87, 0.3);
  background: var(--low-soft);
  color: var(--text);
  align-items: flex-start;
}

.alert-icon {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 95, 87, 0.18);
  color: var(--low);
  font-size: 0.8rem;
  font-weight: 800;
}

.alert strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 2px;
}

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

.alert .btn {
  margin-top: 12px;
}

.loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
}

.loading .spinner {
  display: inline-block;
  border-color: var(--track);
  border-top-color: var(--accent);
  width: 16px;
  height: 16px;
}

.skeleton {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.skeleton-card {
  height: 168px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  position: relative;
}

.skeleton-card.is-tall {
  height: 214px;
}

.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s ease-in-out infinite;
}

:root[data-theme="light"] .skeleton-card::after {
  background: linear-gradient(90deg, transparent, rgba(24, 24, 48, 0.05), transparent);
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 56px;
  color: var(--dim);
  font-size: 0.8rem;
}

.foot-grid {
  display: grid;
  gap: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

@media (min-width: 820px) {
  .foot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.foot h2 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.foot p {
  margin: 0;
  max-width: 62ch;
}

.foot code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--muted);
}

.foot-dim {
  margin-top: 22px;
}

.noscript {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  color: var(--low);
}

@media (max-width: 560px) {
  .shell {
    padding-top: 20px;
  }

  .input-row {
    flex-wrap: wrap;
    padding: 10px 10px 10px 14px;
  }

  .input-row input {
    padding: 12px 0;
  }

  .input-row button {
    width: 100%;
    padding: 15px 18px;
  }

  .summary {
    padding: 20px;
  }

  .summary-head {
    flex-direction: column;
    gap: 16px;
  }

  .summary-side {
    justify-items: start;
    text-align: left;
  }

  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 16px;
  }

  .facts div:last-child {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .aurora,
  .topbar,
  .trust,
  .result-actions,
  .foot,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .shell {
    padding: 0;
  }

  .card,
  .pkg {
    border-color: #ccc;
    background: #fff;
    box-shadow: none;
    break-inside: avoid;
  }

  .balance,
  .pkg-amount strong,
  .facts dd {
    color: #000;
  }
}
