:root {
  --primary: #1CA6EF;
  --primary-dark: #0d8fd1;
  --accent: #6C5CE7;
  --accent-dark: #5847d8;
  --bg-grad: radial-gradient(circle at 15% 10%, #eaf4fd 0%, #f4f1fc 45%, #eef2f8 100%);
  --card-bg: rgba(255, 255, 255, 0.82);
  --card-border: rgba(255, 255, 255, 0.6);
  --text: #1a2130;
  --muted: #6b7686;
  --success-bg: #e7f7ec;
  --success-fg: #17803d;
  --error-bg: #fdecea;
  --error-fg: #b3261e;
  --info-bg: #e8f4fd;
  --info-fg: #0d5c8a;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-soft: 0 20px 45px rgba(30, 60, 110, 0.10);
  --shadow-btn: 0 10px 24px rgba(28, 166, 239, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-grad);
  color: var(--text);
  letter-spacing: 0.1px;
}

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

.glass-card {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 36px 32px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.35);
}

h1.page-title, h2.page-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin: 6px 0 2px;
  color: var(--text);
}

.page-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 26px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #33394a;
  margin: 16px 0 6px;
}

input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e1e6ee;
  background: #fff;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(28, 166, 239, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s;
  text-decoration: none;
}
.btn-primary {
  margin-top: 22px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(28,166,239,.42); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-outline {
  background: #fff;
  color: var(--primary-dark);
  border: 1.5px solid #cfe8f8;
}
.btn-danger { background: #fff; color: var(--error-fg); border: 1.5px solid #f6c9c5; }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; }

.foot-link {
  text-align: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--muted);
}
.foot-link a { color: var(--primary-dark); font-weight: 600; text-decoration: none; }
.foot-link a:hover { text-decoration: underline; }

.msg {
  margin-top: 14px;
  font-size: 13.5px;
  padding: 11px 14px;
  border-radius: 10px;
  display: none;
}
.msg.show { display: block; }
.msg.error { background: var(--error-bg); color: var(--error-fg); }
.msg.success { background: var(--success-bg); color: var(--success-fg); }
.msg.info { background: var(--info-bg); color: var(--info-fg); }

/* ---------- Top App Bar (dashboard/tool/wallet/admin) ---------- */
.app-shell { max-width: 760px; margin: 0 auto; padding: 20px 18px 60px; }
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  padding: 14px 20px;
  margin-bottom: 22px;
}
.app-bar-left { display: flex; align-items: center; gap: 12px; }
.app-bar-title { font-weight: 700; font-size: 15.5px; }
.app-bar-right { display: flex; align-items: center; gap: 12px; }

.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #fff8e6, #fff1cc);
  border: 1px solid #f3dfa0;
  color: #7a5b00;
  font-weight: 700;
  font-size: 13.5px;
  padding: 7px 14px;
  border-radius: 999px;
  text-decoration: none;
}
.credit-pill:hover { filter: brightness(0.97); }

.user-chip { font-size: 13px; color: var(--muted); }

.section-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  padding: 26px 26px 30px;
  margin-bottom: 20px;
}

.balance-hero {
  text-align: center;
  padding: 10px 0 6px;
}
.balance-hero .num {
  font-size: 42px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.balance-hero .label { color: var(--muted); font-size: 13px; margin-top: 2px; }

.quick-picks { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.quick-pick {
  flex: 1;
  min-width: 90px;
  text-align: center;
  padding: 10px 8px;
  border: 1.5px solid #e1e6ee;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  transition: all .12s;
}
.quick-pick.active, .quick-pick:hover { border-color: var(--primary); color: var(--primary-dark); background: #eef8fe; }

table.history { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13.5px; }
table.history th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid #e7ebf1; }
table.history td { padding: 10px 6px; border-bottom: 1px solid #f0f2f6; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge.pending { background: #fff3cd; color: #8a6400; }
.badge.approved { background: var(--success-bg); color: var(--success-fg); }
.badge.rejected { background: var(--error-bg); color: var(--error-fg); }

.step { display: none; }
.step.active { display: block; animation: fade .2s ease; }
@keyframes fade { from{opacity:0; transform:translateY(4px);} to{opacity:1; transform:translateY(0);} }

.captcha-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.captcha-row img { height: 44px; border: 1px solid #dfe4ea; border-radius: 8px; background: #fff; padding: 2px; }
.refresh-btn {
  cursor: pointer; font-size: 12px; color: var(--primary-dark);
  border: 1.5px solid var(--primary); background: #fff; border-radius: 8px; padding: 8px 12px; font-weight: 600;
}

.spinner-row { display: none; align-items: center; gap: 10px; justify-content: center; padding: 16px; color: var(--muted); font-size: 13.5px; }
.spinner-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
  animation: pulse 1s infinite ease-in-out;
}
@keyframes pulse { 0%,100%{opacity:.3} 50%{opacity:1} }

.lock-banner {
  text-align: center; padding: 34px 20px;
}
.lock-banner .icon { font-size: 34px; margin-bottom: 10px; }
.lock-banner p { color: var(--muted); margin: 6px 0 20px; font-size: 14px; }

a.download-link {
  display: block; text-align: center; margin-top: 16px;
  background: linear-gradient(135deg, #1e9e52, #17803d);
  color: #fff; padding: 13px; border-radius: var(--radius-md); text-decoration: none; font-weight: 700;
  box-shadow: 0 12px 26px rgba(23,128,61,.3);
}

@media (max-width: 480px) {
  .glass-card { padding: 28px 20px; }
  .app-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .app-bar-right { justify-content: space-between; }
}
