/* ========== PayWay - Dark Theme ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-elevated: #161616;
  --border: rgba(255,255,255,0.08);
  --text: #ffffff;
  --text-secondary: rgba(255,255,255,0.5);
  --text-muted: rgba(255,255,255,0.35);
  --primary: #0070f3;
  --primary-hover: #005bb5;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 0.75rem;
  --radius-lg: 1rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

/* Glass effect */
.glass {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 600; border: none; cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #0051a8);
  color: white;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,112,243,0.35); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-secondary {
  background: rgba(255,255,255,0.08); color: white;
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-full { width: 100%; }

.btn-outline-red {
  background: transparent; color: var(--red);
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-outline-red:hover { background: rgba(239,68,68,0.1); }

/* Inputs */
input, select, textarea {
  width: 100%; padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius); color: white; font-size: 0.875rem;
  outline: none; transition: all 0.2s ease;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,112,243,0.15); }
input::placeholder { color: rgba(255,255,255,0.3); }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

select { appearance: none; cursor: pointer; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ''; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  border: 5px solid transparent; border-top-color: rgba(255,255,255,0.3);
  pointer-events: none;
}

label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.375rem; }

/* Cards */
.card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
}
.card-gradient {
  background: linear-gradient(135deg, #0a0f1a 0%, #0d1a2d 50%, #0a1628 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg); padding: 1.5rem;
  position: relative; overflow: hidden;
}

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; padding: 1.5rem; max-width: 900px; margin: 0 auto; width: 100%; }

/* Sidebar */
.sidebar {
  width: 260px; height: 100vh; position: fixed; left: 0; top: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 1rem; z-index: 100;
}
.sidebar-logo { display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem 0.75rem 1.5rem; }
.logo-icon { width: 32px; height: 32px; object-fit: contain; }
.logo-text { height: 18px; object-fit: contain; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem; border-radius: var(--radius);
  color: var(--text-secondary); font-size: 0.875rem; font-weight: 500;
  transition: all 0.2s ease;
}
.sidebar-item:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.8); }
.sidebar-item.active { background: rgba(0,112,243,0.15); color: var(--primary); }
.sidebar-item.logout { color: var(--red); margin-top: 0.5rem; }
.sidebar-item.logout:hover { background: rgba(239,68,68,0.1); }

.sidebar-footer { padding-top: 1rem; border-top: 1px solid var(--border); }
.user-info { padding: 0 0.75rem 0.75rem; }
.user-info small { display: block; font-size: 0.7rem; color: var(--text-muted); }
.user-info strong { font-size: 0.875rem; color: rgba(255,255,255,0.7); }

/* Mobile header */
.mobile-header { display: none; padding-bottom: 1rem; }
.mobile-logo { display: flex; align-items: center; gap: 0.5rem; }

/* Mobile nav */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(17,17,17,0.85); backdrop-filter: blur(20px);
  border-top: 1px solid var(--border); z-index: 100;
  padding: 0.25rem 0.5rem calc(0.25rem + env(safe-area-inset-bottom));
}
.mob-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 0.125rem; padding: 0.375rem; color: var(--text-muted);
  font-size: 0.6rem; font-weight: 500; transition: all 0.2s;
}
.mob-nav-item.active { color: var(--primary); }

/* Page title */
.page-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 1.25rem; }

/* Balance */
.balance-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.balance-amount {
  font-size: 2.25rem; font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff 0%, #a0b4d0 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* Transaction list */
.txn-list { display: flex; flex-direction: column; gap: 0.5rem; }
.txn-item {
  display: flex; align-items: center; gap: 0.875rem;
  padding: 0.875rem; border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s;
}
.txn-item:hover { background: rgba(255,255,255,0.05); }
.txn-icon {
  width: 40px; height: 40px; border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.txn-icon.sent { background: rgba(239,68,68,0.12); color: var(--red); }
.txn-icon.received { background: rgba(34,197,94,0.12); color: var(--green); }
.txn-info { flex: 1; min-width: 0; }
.txn-name { font-size: 0.875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-meta { font-size: 0.75rem; color: var(--text-muted); }
.txn-amount { text-align: right; flex-shrink: 0; }
.txn-amount .amount { font-size: 0.875rem; font-weight: 600; }
.txn-amount .amount.positive { color: var(--green); }
.txn-amount .status {
  display: inline-block; font-size: 0.65rem; padding: 0.125rem 0.5rem;
  border-radius: 999px; margin-top: 0.125rem;
}
.status-completed { background: rgba(34,197,94,0.1); color: var(--green); }
.status-pending { background: rgba(234,179,8,0.1); color: #eab308; }

/* Quick actions */
.quick-actions { display: flex; gap: 0.5rem; margin-top: 1.25rem; flex-wrap: wrap; }
.qa-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1rem; border-radius: var(--radius);
  background: rgba(255,255,255,0.08); color: white;
  font-size: 0.8rem; font-weight: 500; border: none; cursor: pointer;
  transition: all 0.2s;
}
.qa-btn:hover { background: rgba(255,255,255,0.12); }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
.stat-card { display: flex; align-items: center; gap: 0.75rem; padding: 1rem; }
.stat-icon { width: 36px; height: 36px; border-radius: 0.625rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon.green { background: rgba(34,197,94,0.12); color: var(--green); }
.stat-icon.red { background: rgba(239,68,68,0.12); color: var(--red); }

/* Section header */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-header h3 { font-size: 1rem; }
.section-header a { font-size: 0.75rem; color: var(--primary); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-row .form-group { margin-bottom: 0; }

/* Method selector */
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1.25rem; }
.method-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: rgba(255,255,255,0.02);
  color: var(--text-muted); font-size: 0.75rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.method-btn:hover { background: rgba(255,255,255,0.05); }
.method-btn.active {
  border-color: rgba(0,112,243,0.4); background: rgba(0,112,243,0.08);
  color: var(--primary);
}
.method-btn svg { stroke-width: 1.5; }

/* Radio options */
.radio-option {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: rgba(255,255,255,0.02); margin-bottom: 0.5rem;
  cursor: pointer; transition: all 0.2s; text-align: left; width: 100%;
}
.radio-option:hover { background: rgba(255,255,255,0.04); }
.radio-option.selected { border-color: rgba(0,112,243,0.3); background: rgba(0,112,243,0.08); }
.radio-circle {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.radio-option.selected .radio-circle { border-color: var(--primary); }
.radio-circle::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); opacity: 0; transition: opacity 0.2s;
}
.radio-option.selected .radio-circle::after { opacity: 1; }

/* Amount presets */
.preset-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.375rem; margin-top: 0.5rem; }
.preset-btn {
  padding: 0.5rem; border-radius: 0.5rem; font-size: 0.7rem; font-weight: 500;
  border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  color: var(--text-muted); cursor: pointer; transition: all 0.2s;
}
.preset-btn:hover { background: rgba(255,255,255,0.08); }
.preset-btn.active { border-color: rgba(0,112,243,0.3); background: rgba(0,112,243,0.1); color: var(--primary); }

/* Filters */
.filter-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-btn {
  padding: 0.375rem 0.75rem; border-radius: 0.5rem;
  font-size: 0.7rem; font-weight: 500;
  border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  color: var(--text-muted); cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover { background: rgba(255,255,255,0.08); }
.filter-btn.active { border-color: rgba(0,112,243,0.3); background: rgba(0,112,243,0.1); color: var(--primary); }

/* Receipt modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); display: flex;
  align-items: flex-end; justify-content: center;
}
.modal-content {
  background: var(--bg-elevated); width: 100%; max-width: 420px;
  max-height: 90vh; overflow-y: auto;
  border-radius: 1.25rem 1.25rem 0 0;
  border: 1px solid var(--border);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem; border-bottom: 1px solid var(--border);
}
.modal-body { padding: 1.5rem; }
.receipt-header { text-align: center; margin-bottom: 1.5rem; }
.receipt-logo { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 1rem; }
.receipt-success { width: 56px; height: 56px; border-radius: 50%; background: rgba(34,197,94,0.12); color: var(--green); display: flex; align-items: center; justify-content: center; margin: 0 auto 0.75rem; }
.receipt-amount { font-size: 1.5rem; font-weight: 700; }
.receipt-positive { color: var(--green); }
.receipt-negative { color: var(--text); }

.receipt-divider { border: none; border-top: 1px dashed rgba(255,255,255,0.1); margin: 1rem 0; }

.receipt-row { display: flex; justify-content: space-between; margin-bottom: 0.625rem; }
.receipt-row .label { font-size: 0.8rem; color: var(--text-muted); }
.receipt-row .value { font-size: 0.8rem; color: var(--text); font-weight: 500; }
.receipt-row .value.mono { font-family: monospace; text-transform: uppercase; }

.receipt-summary { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }

/* Landing page */
.landing { min-height: 100vh; }
.landing-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,0.04); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.landing-nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 1rem; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.landing-links { display: flex; gap: 2rem; font-size: 0.875rem; color: var(--text-muted); }
.landing-links a:hover { color: rgba(255,255,255,0.8); }

.hero { text-align: center; padding: 7rem 1rem 4rem; position: relative; overflow: hidden; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.375rem 1rem; border-radius: 999px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  font-size: 0.75rem; color: var(--primary); margin-bottom: 1.5rem;
}
.hero h1 { font-size: 3rem; font-weight: 800; line-height: 1.1; margin-bottom: 1rem; }
.hero h1 span {
  background: linear-gradient(135deg, #0070f3, #00c6ff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { color: var(--text-secondary); max-width: 480px; margin: 0 auto 2rem; font-size: 1rem; }
.hero-buttons { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; max-width: 480px; margin: 2.5rem auto 0; }
.stat-box { text-align: center; padding: 1rem; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.stat-box .num { font-size: 1.25rem; font-weight: 700; }
.stat-box .lbl { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.25rem; }

.features { padding: 3rem 1rem; max-width: 1100px; margin: 0 auto; }
.features h2 { text-align: center; font-size: 1.5rem; margin-bottom: 0.5rem; }
.features > p { text-align: center; color: var(--text-secondary); margin-bottom: 2rem; font-size: 0.875rem; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.feature-card { padding: 1.25rem; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: all 0.2s; }
.feature-card:hover { background: rgba(255,255,255,0.05); }
.feature-icon { width: 40px; height: 40px; border-radius: 0.625rem; display: flex; align-items: center; justify-content: center; margin-bottom: 0.75rem; font-size: 1.125rem; }
.feature-card h3 { font-size: 0.875rem; margin-bottom: 0.375rem; }
.feature-card p { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }

.cta-section { padding: 2rem 1rem; max-width: 600px; margin: 0 auto; }
.cta-card {
  text-align: center; padding: 2.5rem; border-radius: 1.25rem;
  background: linear-gradient(135deg, #0f1629, #162040);
  border: 1px solid var(--border); position: relative; overflow: hidden;
}
.cta-card h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
.cta-card p { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 1.5rem; }
.cta-note { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.75rem; }

.landing-footer {
  border-top: 1px solid var(--border); padding: 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; font-size: 0.75rem; color: var(--text-muted);
}

/* Auth pages */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-box { width: 100%; max-width: 360px; }
.auth-logo { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 2rem; justify-content: center; }
.auth-box h1 { text-align: center; font-size: 1.5rem; margin-bottom: 0.375rem; }
.auth-box > p { text-align: center; color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 1.5rem; }
.auth-box .error { background: rgba(239,68,68,0.1); color: var(--red); padding: 0.625rem 1rem; border-radius: var(--radius); font-size: 0.8rem; margin-bottom: 1rem; }
.auth-box .success { background: rgba(34,197,94,0.1); color: var(--green); padding: 0.625rem 1rem; border-radius: var(--radius); font-size: 0.8rem; margin-bottom: 1rem; }
.auth-toggle { text-align: center; margin-top: 1.25rem; font-size: 0.8rem; color: var(--text-muted); }
.auth-toggle a { color: var(--primary); font-weight: 500; }

/* Settings */
.settings-menu { display: flex; flex-direction: column; gap: 0.5rem; max-width: 480px; }
.settings-item { display: flex; align-items: center; gap: 0.875rem; padding: 1rem; background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; transition: all 0.2s; }
.settings-item:hover { background: rgba(255,255,255,0.05); }
.settings-icon { width: 40px; height: 40px; border-radius: 0.625rem; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.settings-info { flex: 1; }
.settings-info h4 { font-size: 0.875rem; font-weight: 500; }
.settings-info p { font-size: 0.75rem; color: var(--text-muted); }

/* Profile card */
.profile-card { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; margin-bottom: 1.25rem; }
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #0070f3, #00c6ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 700; color: white;
}
.profile-info h3 { font-size: 1rem; }
.profile-info p { font-size: 0.8rem; color: var(--text-muted); }

/* Alert */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.8rem; margin-bottom: 1rem; }
.alert-error { background: rgba(239,68,68,0.1); color: var(--red); }
.alert-success { background: rgba(34,197,94,0.1); color: var(--green); }

/* Confirmation page */
.confirm-box { max-width: 480px; margin: 0 auto; }
.confirm-box h2 { font-size: 1.25rem; margin-bottom: 1.25rem; }
.confirm-details { margin-bottom: 1.25rem; }
.confirm-row { display: flex; justify-content: space-between; padding: 0.625rem 0; border-bottom: 1px solid var(--border); }
.confirm-row .lbl { font-size: 0.8rem; color: var(--text-muted); }
.confirm-row .val { font-size: 0.8rem; font-weight: 500; }
.confirm-actions { display: flex; gap: 0.75rem; }

/* Success page */
.success-page { text-align: center; padding: 4rem 1rem; max-width: 400px; margin: 0 auto; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: rgba(34,197,94,0.12); color: var(--green); display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.success-page h2 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.success-page p { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 0.25rem; }
.success-page .ref { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.success-actions { display: flex; gap: 0.75rem; justify-content: center; }

/* Hamburger menu */
.hamburger { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0.25rem; display: none; }
.mobile-menu {
  position: absolute; top: 56px; left: 0; right: 0;
  background: var(--bg-elevated); border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem; display: none;
}
.mobile-menu.show { display: block; }
.mobile-menu a { display: block; padding: 0.625rem 0; color: var(--text-secondary); font-size: 0.875rem; }
.mobile-menu a:hover { color: var(--text); }
.mobile-menu .btn-primary { margin-top: 0.75rem; width: 100%; }

/* Card type indicator */
.card-type-img { position: absolute; right: 2.5rem; top: 50%; transform: translateY(-50%); height: 20px; object-fit: contain; }
.input-wrap { position: relative; }

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 1rem; padding-bottom: 5rem; }
  .mobile-header { display: flex; align-items: center; }
  .mobile-nav { display: flex; }
  .features-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .stats-row { grid-template-columns: 1fr; }
  .landing-links { display: none; }
  .hamburger { display: block; }
  .balance-amount { font-size: 1.875rem; }
  .preset-grid { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}

@media (min-width: 769px) {
  .main-content { margin-left: 260px; }
  .mobile-menu { display: none !important; }
}

/* Print styles for receipt */
@media print {
  body * { visibility: hidden; }
  .receipt-print, .receipt-print * { visibility: visible; }
  .receipt-print {
    position: absolute; left: 0; top: 0; width: 100%;
    background: white !important; color: black !important; padding: 2rem;
  }
  .receipt-print .no-print { display: none !important; }
  .receipt-print h2, .receipt-print p, .receipt-print span { color: #1a1a1a !important; }
}
