/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:    #6366f1;
  --accent-hi: #818cf8;
  --accent2:   #a78bfa;
  --success:   #22c55e;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --bg:        #0f1117;
  --surface:   #161b27;
  --surface2:  #1e2536;
  --border:    rgba(255,255,255,.08);
  --border-hi: rgba(255,255,255,.14);
  --text-1:    #f1f5f9;
  --text-2:    #94a3b8;
  --text-3:    #64748b;
  --transition: .2s ease;
  --radius:    14px;
  --shadow:    0 8px 32px rgba(0,0,0,.45);
}

body.light {
  --bg:       #f1f5f9;
  --surface:  #ffffff;
  --surface2: #f8fafc;
  --border:   rgba(0,0,0,.08);
  --border-hi:rgba(0,0,0,.14);
  --text-1:   #0f172a;
  --text-2:   #475569;
  --text-3:   #94a3b8;
}

body.light .navbar {
  background: rgba(255, 255, 255, 0.85);
}

html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.5;
  overflow: hidden;
}

/* ── Background blobs ─────────────────────────────────────── */
.bg-blob { position: fixed; border-radius: 50%; filter: blur(80px); opacity: .18; pointer-events: none; z-index: 0; }
.blob-1  { width: 500px; height: 500px; background: var(--accent);  top: -120px; left: -80px; }
.blob-2  { width: 400px; height: 400px; background: var(--accent2); bottom: -100px; right: -80px; }

/* ── Layout ───────────────────────────────────────────────── */
.shell {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: 100vh;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 60px;
  background: rgba(22,27,39,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon-wrap {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
}
.logo-title { font-size: 15px; font-weight: 700; color: var(--text-1); line-height: 1.1; margin-bottom: 2px; }
.logo-sub   { font-size: 10px; color: var(--text-3); font-weight: 500; line-height: 1; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* ── Stepper ──────────────────────────────────────────────── */
.stepper {
  display: flex; align-items: center; justify-content: center;
  gap: 0; padding: 16px 24px 0; flex-shrink: 0;
}
.step {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--text-3);
  cursor: pointer; transition: color var(--transition);
  padding: 6px 12px; border-radius: 99px;
}
.step.active   { color: var(--accent-hi); background: rgba(99,102,241,.12); }
.step.done     { color: var(--success); }
.step-num {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid currentColor;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.step.active .step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.done   .step-num { background: var(--success); border-color: var(--success); color: #fff; }
.step-connector { width: 32px; height: 2px; background: var(--border-hi); flex-shrink: 0; }

/* ── Main content ─────────────────────────────────────────── */
.main-content {
  flex: 1; overflow-y: auto; padding: 20px 24px 24px;
  display: flex; flex-direction: column; gap: 16px;
}

/* ── Step panels ──────────────────────────────────────────── */
.step-panel { display: none; flex-direction: column; gap: 16px; }
.step-panel.active { display: flex; }

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-3);
  margin-bottom: 14px;
}

/* ── Form rows ────────────────────────────────────────────── */
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 180px; }
.form-label { font-size: 11px; font-weight: 600; color: var(--text-2); letter-spacing: .4px; }
.form-input, .form-select, .form-textarea {
  background: var(--surface2);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text-1);
  font-family: inherit; font-size: 13px;
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2394a3b8%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}
.form-select option { background: var(--surface2); }
.form-input[type="password"] { letter-spacing: 2px; }
.form-textarea { resize: vertical; min-height: 200px; font-family: 'Consolas', monospace; font-size: 13px; line-height: 1.6; }

/* ── Preset chips ─────────────────────────────────────────── */
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.preset-chip {
  padding: 5px 14px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--surface2); border: 1px solid var(--border-hi);
  color: var(--text-2); cursor: pointer; transition: all var(--transition);
}
.preset-chip:hover { border-color: var(--accent); color: var(--accent-hi); }

/* ── Enc radio ────────────────────────────────────────────── */
.radio-row { display: flex; gap: 14px; align-items: center; }
.radio-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}
.radio-label input { accent-color: var(--accent); }

/* ── Info tip ─────────────────────────────────────────────── */
.tip-box {
  background: rgba(99,102,241,.08); border: 1px solid rgba(99,102,241,.22);
  border-radius: 8px; padding: 10px 14px;
  font-size: 12px; color: var(--accent-hi); line-height: 1.5; margin-top: 10px;
}

/* ── File drop zone ───────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border-hi); border-radius: 10px;
  padding: 30px; text-align: center; cursor: pointer;
  transition: all var(--transition); position: relative;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent); background: rgba(99,102,241,.06);
}
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone-icon { font-size: 32px; margin-bottom: 8px; }
.dropzone-text { font-size: 13px; color: var(--text-2); }
.dropzone-sub  { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ── Data table ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); max-height: 260px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead tr { background: var(--surface2); position: sticky; top: 0; z-index: 2; }
th { padding: 8px 12px; text-align: left; font-weight: 600; color: var(--text-3); font-size: 11px; letter-spacing: .5px; text-transform: uppercase; }
td { padding: 7px 12px; border-top: 1px solid var(--border); color: var(--text-2); }
tr:hover td { background: rgba(255,255,255,.03); }

/* ── Variable chips ───────────────────────────────────────── */
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.var-chip {
  padding: 3px 10px; border-radius: 99px;
  background: rgba(99,102,241,.12); border: 1px solid rgba(99,102,241,.3);
  color: var(--accent-hi); font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.var-chip:hover { background: var(--accent); color: #fff; }

/* ── Progress ─────────────────────────────────────────────── */
.progress-track {
  width: 100%; height: 10px; background: var(--surface2);
  border-radius: 99px; overflow: hidden; margin: 8px 0;
}
.progress-fill {
  height: 100%; border-radius: 99px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .4s ease;
}
.progress-label { font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; }

/* ── Log console ──────────────────────────────────────────── */
.log-console {
  background: var(--surface2); border: 1px solid var(--border-hi);
  border-radius: 10px; padding: 14px 16px;
  height: 240px; overflow-y: auto;
  font-family: 'Consolas', 'Menlo', monospace; font-size: 12px; line-height: 1.6;
  color: var(--text-1);
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.02);
}
.log-line-ok      { color: var(--success); }
.log-line-error   { color: var(--danger); }
.log-line-warning { color: var(--warning); }
.log-line-info    { color: var(--accent); }
.log-line-normal  { color: var(--text-2); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 9px; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; transition: all var(--transition);
  font-family: inherit; text-decoration: none;
}
.btn-primary  { background: var(--accent);  color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.35); }
.btn-primary:hover  { background: #4f52d9; transform: translateY(-1px); }
.btn-success  { background: var(--success); color: #fff; box-shadow: 0 4px 14px rgba(34,197,94,.3); }
.btn-success:hover  { background: #16a34a; transform: translateY(-1px); }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-danger:hover   { background: #dc2626; }
.btn-warning  { background: var(--warning); color: #000; }
.btn-ghost    { background: var(--surface2); color: var(--text-2); border: 1px solid var(--border-hi); }
.btn-ghost:hover    { color: var(--accent-hi); border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.btn-lg { padding: 13px 28px; font-size: 15px; font-weight: 700; }

/* ── Footer row ───────────────────────────────────────────── */
.panel-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }

/* ── Stats chips (top of send page) ──────────────────────── */
.stats-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stat-chip {
  flex: 1; min-width: 100px;
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 12px; padding: 16px; text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  position: relative;
  overflow: hidden;
}
.stat-chip.s-total { background: rgba(99, 102, 241, 0.08); border-color: rgba(99, 102, 241, 0.2); }
.stat-chip.s-sent { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.2); }
.stat-chip.s-failed { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.2); }
.stat-chip.s-pending { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.2); }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.2; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.stat-chip.s-sent    .stat-value { color: var(--success); }
.stat-chip.s-failed  .stat-value { color: var(--danger); }
.stat-chip.s-total   .stat-value { color: var(--accent); }
.stat-chip.s-pending .stat-value { color: var(--warning); }

/* ── Theme toggle ─────────────────────────────────────────── */
.theme-toggle {
  background: var(--surface2); border: 1px solid var(--border-hi);
  border-radius: 8px; width: 34px; height: 34px; padding: 0; cursor: pointer;
  color: var(--text-2); display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover { color: var(--accent-hi); border-color: var(--accent); }

/* ── App footer ───────────────────────────────────────────── */
.app-footer {
  text-align: center; padding: 10px 0 16px;
  font-size: 11px; color: var(--text-3);
}
.app-footer a { color: var(--text-3); text-decoration: none; margin: 0 6px; }
.app-footer a:hover { color: var(--accent-hi); }

/* ── Support / Donate Button & Modal ──────────────────────── */
.btn-donate {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  height: 34px; padding: 0 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-donate:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
body.light .btn-donate {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
body.light .btn-donate:hover {
  color: #fff; background: #ef4444;
}

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  opacity: 0; visibility: hidden;
  transition: all 0.3s ease;
}
.modal-overlay.active {
  opacity: 1; visibility: visible;
}
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%; max-width: 400px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  text-align: center;
}
.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--text-1); margin-bottom: 8px; }
.modal-close {
  background: transparent; border: none;
  color: var(--text-3); cursor: pointer;
  padding: 4px; border-radius: 6px;
  display: grid; place-items: center; transition: all var(--transition);
  position: absolute; top: 16px; right: 16px;
}
.modal-close:hover { background: var(--surface2); color: var(--text-1); }
.modal-body { text-align: center; }
.modal-desc { font-size: 13px; color: var(--text-2); margin-bottom: 20px; line-height: 1.5; }
.qr-container {
  background: #ffffff; padding: 12px; border-radius: 12px;
  display: inline-block; margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.qr-container img {
  display: block; width: 200px; height: 200px; object-fit: contain;
}
.upi-id-text { font-size: 13px; font-weight: 600; color: var(--text-3); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .stepper { gap: 0; }
  .step span:last-child { display: none; }
  .form-row { flex-direction: column; }
}

/* ── Choices.js Custom Theme ──────────────────────────── */
.choices { margin-bottom: 0; }
.choices__inner {
  background: var(--surface2);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  min-height: 40px;
  padding: 5px 12px 0 12px;
  color: var(--text-1);
  font-size: 13px;
  box-shadow: none;
  transition: all var(--transition);
}
.choices.is-focused .choices__inner {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}
.choices__list--single { padding: 4px 0px; }
.choices[data-type*="select-one"]::after {
  border: none;
  width: 16px; height: 16px; margin-top: -8px;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2394a3b8%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
  background-size: cover;
}
.choices.is-open { z-index: 100; }
.choices.is-open[data-type*="select-one"]::after { margin-top: -8px; transform: rotate(180deg); }
.choices__list--dropdown, .choices__list[aria-expanded] {
  background: var(--surface2);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  margin-top: 4px;
  z-index: 100 !important;
}
.choices__list--dropdown .choices__item, .choices__list[aria-expanded] .choices__item {
  font-size: 13px;
  color: var(--text-1);
  padding: 10px 16px;
}
.choices__list--dropdown .choices__item--selectable.is-highlighted, .choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background: rgba(99,102,241,.12);
  color: var(--accent-hi);
}
.choices__item.choices__item--choice.is-selected {
  display: none;
}
.choices__list--multiple .choices__item {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  margin-right: 6px;
  margin-bottom: 6px;
}
.choices__list--multiple .choices__item.is-highlighted {
  background: var(--accent-hi); border: none;
}
.choices[data-type*="select-multiple"] .choices__button {
  border-left: 1px solid rgba(255,255,255,0.2);
  margin-left: 6px;
  padding-left: 6px;
}
