/* =========================================================
   Rudieta eShop — Dark Slate UI (mobile-ready)
   ========================================================= */
:root {
  --page-max: 1180px;
  --nav-h: 60px;

  --bg: radial-gradient(circle at top, #020617 0%, #0f172a 48%, #020617 90%);
  --bg-solid: #0b1020;
  --surface: rgba(10, 15, 25, 0.72);
  --surface-soft: rgba(15, 23, 42, 0.35);
  --border: rgba(148, 163, 184, 0.12);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --danger: #f43f5e;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 9px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
/* 1) make the whole page a flex column */
html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #020617;
  background-image: radial-gradient(circle at 10% 20%, rgba(59,130,246,0.08) 0%, rgba(2,6,23,0) 22%), radial-gradient(circle at 90% 0%, rgba(14,165,233,0.08) 0%, rgba(2,6,23,0) 40%);
  color: #e2e8f0;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ---------- Navbar ---------- */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  background: rgba(10, 13, 20, 0.55);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  z-index: 60;
}
.nav-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
}

/* brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}
.brand img {
  height: 34px;
  width: auto;
  object-fit: contain;
}
.brand-title {
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  opacity: 0.85;
}

/* desktop nav right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* links */
.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 5px 12px 6px;
  border-radius: 999px;
  color: rgba(226, 232, 240, 0.55);
  transition: background 150ms ease, color 150ms ease;
}
.nav-links a.active,
.nav-links a:hover {
  background: rgba(59, 130, 246, 0.17);
  color: #fff;
}

/* mobile nav button */
.nav-toggle {
  display: none;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.19);
  color: #e2e8f0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Auth slot ---------- */
.top-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* when NOT signed in */
#signinBtn {
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #e2e8f0;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

/* when signed in */
#userPill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 18, 30, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 3px 6px 3px 8px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}
#userPill .avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #3b82f6, #0f172a);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}
#userTag {
  font-size: 12.5px;
  color: #e2e8f0;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#globalSignOut {
  background: rgba(15, 23, 42, 0.45);
  border: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #dbeafe;
  font-weight: 600;
  transition: background 120ms ease;
}
#globalSignOut:hover {
  background: rgba(59, 130, 246, 0.45);
}

.hidden {
  display: none !important;
}

/* ---------- Page ---------- */
/* 2) content stretches and pushes footer */
.page {
  max-width: var(--page-max);
  margin: calc(var(--nav-h) + 16px) auto 26px;
  padding: 0 18px;
  flex: 1 0 auto;   /* <<--- this is the key */
}

.page-title {
  font-size: clamp(1.5rem, 2.1vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: -0.02em;
}
.page-sub {
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ---------- Cards ---------- */
.card {
  background: rgba(10, 15, 25, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 16px;
  padding: 14px 16px 15px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
}
.surface {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.05);
  border-radius: 14px;
  padding: 10px;
}
.muted {
  color: var(--text-muted);
}

/* ---------- Grids ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.grid-1 {
  display: grid;
  gap: 10px;
}

/* ---------- Forms ---------- */
label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 4px;
  color: rgba(226, 232, 240, 0.9);
}
input,
select,
textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 7px 10px 7.5px;
  font-size: 14px;
  color: #e2e8f0;
  outline: none;
  transition: border 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
input:focus,
select:focus,
textarea:focus {
  border: 1px solid rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: rgba(15, 23, 42, 0.5);
}
textarea {
  min-height: 95px;
  resize: vertical;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.03);
  background: rgba(148, 163, 184, 0.08);
  color: #e2e8f0;
  padding: 7px 14px;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}
.btn:hover {
  background: rgba(148, 163, 184, 0.15);
  transform: translateY(-0.5px);
}
.btn.primary {
  background: radial-gradient(circle, #3b82f6 0%, #1d4ed8 70%);
  color: #e2e8f0;
  border: 0;
}
.btn.primary:hover {
  background: radial-gradient(circle, #60a5fa 0%, #1d4ed8 60%);
}
.btn.secondary {
  background: rgba(15, 23, 42, 0.15);
}
.btn.sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* ---------- Table ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  text-align: left;
  padding: 6px 4px;
  font-size: 13px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.07);
}
.table th {
  color: rgba(226, 232, 240, 0.7);
  font-weight: 500;
}

/* ---------- Popup ---------- */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  backdrop-filter: blur(3px);
}
.popup.hidden {
  display: none;
}
.popup-content {
  background: rgba(12, 16, 26, 1);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  width: min(420px, 94vw);
  padding: 18px 16px 15px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.4);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;  /* stays */
  background: rgba(7, 10, 16, 0.5);
  border-top: 1px solid rgba(148, 163, 184, 0.04);
  padding: 13px 18px 20px;
  backdrop-filter: blur(6px);
}

.footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(226, 232, 240, 0.4);
  font-size: 12.5px;
}

/* ---------- MOBILE ---------- */
@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* hide menu by default */
  .nav-right {
    position: fixed;
    top: var(--nav-h);
    right: 10px;
    left: 10px;
    background: rgba(8, 11, 18, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    padding: 10px;
    backdrop-filter: blur(12px);
    flex-direction: column;
    gap: 10px;
    display: none;
  }
  .nav-right.open {
    display: flex;
  }
  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .nav-links a {
    width: 100%;
  }
  .page {
    padding: 0 12px;
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .btn,
  button,
  input,
  select {
    max-width: 100%;
  }
}

/* even smaller */
@media (max-width: 540px) {
  .brand-sub {
    display: none;
  }
  #userTag {
    max-width: 95px;
  }
  .popup-content {
    width: min(95vw, 420px);
  }
}
.form-disclaimer {
  margin-top: 10px;
  font-size: 12.5px;
  color: rgba(226, 232, 240, 0.6);
  display: flex;
  gap: 4px;
  align-items: center;
  line-height: 1.4;
}
.form-disclaimer small {
  opacity: 0.85;
}
.form-disclaimer a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}
.form-disclaimer a:hover {
  text-decoration: underline;
}
.form-disclaimer .dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.45);
  flex: 0 0 4px;
}
@media (max-width: 560px) {
  .form-disclaimer {
    flex-wrap: wrap;
  }
}
/* ============ LAYOUT HELPERS ============ */

/* use this on pages that should be narrow (auth) */
.page.page--narrow {
  max-width: 1280px;
  margin: calc(var(--nav-h) + 22px) auto 26px;
  padding: 0 14px;
}

/* generic auth shell */
.auth-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card {
  background: rgba(10, 15, 25, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.09);
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

/* secondary little card under auth (for tos/privacy/info) */
.auth-meta {
  background: rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.05);
  border-radius: 14px;
  padding: 9px 12px 8px;
  font-size: 12.5px;
  color: rgba(226,232,240,0.7);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* legal links inside auth */
.auth-meta a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  font-size: 12.5px;
}
.auth-meta a:hover {
  text-decoration: underline;
}
.auth-meta .dot {
  width: 3.5px;
  height: 3.5px;
  border-radius: 999px;
  background: rgba(226,232,240,0.28);
}

/* ============ CONSISTENT FORM DISCLAIMER ============ */
.form-disclaimer {
  margin-top: 10px;
  font-size: 12.5px;
  color: rgba(226, 232, 240, 0.6);
  display: flex;
  gap: 6px;
  align-items: center;
  line-height: 1.45;
  flex-wrap: wrap;
}
.form-disclaimer a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}
.form-disclaimer a:hover {
  text-decoration: underline;
}
.form-disclaimer .dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.35);
}
@media (max-width: 540px) {
  .form-disclaimer {
    flex-direction: row;
  }
}

/* ============ CARDS (tiny tweak so widths match) ============ */
.card,
.auth-card {
  width: 100%;
  box-sizing: border-box;
}

/* ============ TOS / PRIVACY PAGE CONSISTENCY ============ */
.tos-tabs,
.pp-tabs {
  gap: 6px;
}
.tos-tab,
.pp-tab {
  min-width: 110px;
  justify-content: center;
  text-align: center;
}
.tos-panel,
.pp-panel {
  margin-top: 8px;
}

/* ============ MOBILE: make small cards full width ============ */
@media (max-width: 540px) {
  .page.page--narrow {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  .auth-card,
  .auth-meta {
    border-radius: 14px;
  }
}

/* ----- admin / creator tabs (patched) ----- */
.admin-tabs,
.creator-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  position: sticky;
  top: calc(var(--nav-h) + 6px);
  z-index: 5;
  background: radial-gradient(circle at top, #020617 0%, rgba(2,6,23,0) 80%);
  padding-bottom: 6px;
}

.admin-tab,
.creator-tab {
  border: 1px solid rgba(148,163,184,0.05);
  background: rgba(15,23,42,0.35);
  border-radius: 999px;
  padding: 5px 14px 6px;
  font-size: 13px;
  color: #e2e8f0;
  cursor: pointer;
}

.admin-tab.active,
.creator-tab.active {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.4);
}

.admin-panel,
.creator-panel {
  display: none;
}
.admin-panel.active,
.creator-panel.active {
  display: block;
}

.btn-sm {
  background: rgba(15,23,42,0.35);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 999px;
  padding: 3px 10px 4px;
  font-size: 12px;
  color: #e2e8f0;
  cursor: pointer;
}
.btn-sm:hover {
  background: rgba(59,130,246,0.2);
}

/* ---- PATCH 2025-11-01: unify admin/creator buttons + fix panes ---- */
.admin-pane,
.creator-pane {
  display: none;
}
.admin-pane.active,
.creator-pane.active {
  display: block;
}

.admin-tab,
.creator-tab {
  background: rgba(15,23,42,0.35);
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 10px;
  padding: 6px 14px 7px;
  color: #e2e8f0;
  font-weight: 500;
  cursor: pointer;
  transition: 0.15s ease;
}
.admin-tab.active,
.creator-tab.active {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.35);
  color: #fff;
}
.btn,
.btn-sm {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(15,23,42,0.45);
  color: #e2e8f0;
  font-weight: 500;
  cursor: pointer;
}
.btn-sm { font-size: 12px; padding: 3px 10px 4px; }
.btn-danger {
  background: rgba(248,113,113,0.1);
  border-color: rgba(248,113,113,0.45);
  color: #fee2e2;
}
.table-inline-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
/* --- ORDERS PAGE: hard stretch --- */
.orders-page #clientOrders {
  display: flex !important;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  align-items: stretch !important;   /* 👈 this is the missing piece */
}

/* every order card in there must fill */
.orders-page #clientOrders .card,
.orders-page #clientOrders .order-card {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  margin-inline: 0 !important;
}


.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  align-items: flex-start;
}

.popular-topups {
  margin-top: 10px;
  background: rgba(15,23,42,0.25);
  border: 1px solid rgba(148,163,184,0.08);
  border-radius: 14px;
  padding: 8px 10px 10px;
}
.popular-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(226,232,240,0.65);
  margin-bottom: 4px;
}
.popular-logos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.popular-logo {
  width: 120px;
  height: 80px;
  background: rgba(15,23,42,0.35);
  border: 1px solid rgba(148,163,184,0.04);
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.popular-logo img {
  max-height: 120px;
  max-width: 80px;
}

#giftCardList {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.giftcard-chip {
  background: rgba(22,163,74,0.12);
  border: 1px solid rgba(22,163,74,0.35);
  border-radius: 999px;
  padding: 3px 10px 3px 9px;
  font-size: 11.5px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.giftcard-chip button {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
}


/* payment iframe popup */
.payment-popup {
  backdrop-filter: blur(3px);
}
.payment-frame {
  position: relative;
  width: min(940px, 96vw);
  height: min(620px, 88vh);
  background: rgba(15,23,42,0.96);
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.payment-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #0f172a;
}
.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: rgba(2,6,23,0.4);
  color: #e2e8f0;
  font-size: 20px;
  cursor: pointer;
}

/* faq cards */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.faq-card {
  background: rgba(15,23,42,0.5);
  border: 1px solid rgba(148,163,184,0.08);
  border-radius: 12px;
  padding: 14px 16px 16px;
}
.faq-card h2 {
  font-size: 1rem;
  margin-bottom: 6px;
}
.faq-card p {
  font-size: 0.88rem;
  color: rgba(226,232,240,0.8);
}
.faq-card a {
  color: #38bdf8;
}
.admin-list { display: grid; gap: 8px; }
.admin-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}
.admin-list-item:focus { outline: 2px solid #222; }
.li-title { font-weight: 600; }
.li-sub { color: #666; font-size: 12px; margin-top: 2px; }
.li-right { color: #999; font-size: 18px; padding-left: 10px; }

/* Modal */
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 9999; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.35);
}
.modal-dialog {
  position: relative; max-width: 720px; width: calc(100% - 24px);
  margin: 40px auto; background: #fff; border-radius: 12px; padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.modal-close {
  position: absolute; right: 10px; top: 10px;
  border: 0; background: #f3f3f3; border-radius: 8px; width: 28px; height: 28px; cursor: pointer;
}
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px; padding: 4px 0; }
.kv-col { margin-top: 8px; }
.modal-body { margin-top: 8px; }
