/* ============================================================
   WONPAY — MAIN STYLESHEET
   ============================================================ */

:root {
  --primary: #6C63FF;
  --primary-dark: #5A52E0;
  --primary-light: #EEF0FF;
  --secondary: #4ECDC4;
  --accent: #FF6B6B;
  --success: #6C63FF;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;

  --bg: #F0F4F8;
  --bg-white: #FFFFFF;
  --bg-card: #FFFFFF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;

  --text: #1A1A2E;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;

  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);

  --transition: 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; }

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff;
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; font-weight: 600; font-size: 14px;
  transition: var(--transition);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); text-decoration: none; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--primary);
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary); cursor: pointer;
  font-weight: 600; font-size: 14px; transition: var(--transition);
}
.btn-outline:hover { background: var(--primary-light); text-decoration: none; }

.btn-auth {
  width: 100%; padding: 14px; background: var(--primary);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 700; cursor: pointer; transition: var(--transition);
}
.btn-auth:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-auth:disabled { opacity: 0.7; cursor: not-allowed; }

.btn-sm-primary {
  padding: 6px 14px; background: var(--primary); color: #fff;
  border: none; border-radius: 6px; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: var(--transition);
}
.btn-sm-primary:hover { background: var(--primary-dark); text-decoration: none; }

.btn-sm-outline {
  padding: 6px 14px; background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary); border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition);
}

.btn-xs-success {
  padding: 4px 10px; background: var(--success); color: #fff;
  border: none; border-radius: 5px; font-size: 12px; cursor: pointer;
}
.btn-xs-danger {
  padding: 4px 10px; background: var(--danger); color: #fff;
  border: none; border-radius: 5px; font-size: 12px; cursor: pointer;
}

/* ── Forms ────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; color: var(--text); background: var(--bg-white);
  transition: var(--transition); outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.input-password-wrap { position: relative; }
.input-password-wrap input { padding-right: 50px; }
.toggle-pw {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 18px;
}

.input-with-prefix { display: flex; align-items: center; }
.input-with-prefix span {
  background: var(--bg); border: 1.5px solid var(--border);
  border-right: none; padding: 12px 14px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-weight: 600; color: var(--text-muted);
}
.input-with-prefix input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.amount-input-wrap { display: flex; align-items: center; }
.amount-input-wrap .currency-prefix, .amount-input-wrap > span {
  background: var(--bg); border: 1.5px solid var(--border);
  border-right: none; padding: 12px 14px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-weight: 700; font-size: 16px;
}
.amount-input-wrap input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
  font-size: 18px; font-weight: 600;
}

.optional { font-weight: 400; color: var(--text-muted); font-size: 12px; }

.checkbox-label {
  display: flex; align-items: flex-start; gap: 10px;
  font-weight: 400; cursor: pointer;
}
.checkbox-label input { margin-top: 2px; }

/* ── Alerts ───────────────────────────────────────────── */
.alert {
  padding: 14px 18px; border-radius: var(--radius-sm);
  margin-bottom: 20px; font-size: 14px; font-weight: 500;
}
.alert-success { background: #DCFCE7; color: #4b45c7; border: 1px solid #86EFAC; }
.alert-error   { background: #FEE2E2; color: #B91C1C; border: 1px solid #FCA5A5; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.alert-info    { background: #DBEAFE; color: #1D4ED8; border: 1px solid #93C5FD; }

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* ── Logo ─────────────────────────────────────────────── */
.logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; font-weight: 900; font-size: 18px;
}

/* ── Modal ────────────────────────────────────────────── */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; }
.modal.open { display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.modal-content {
  position: relative; z-index: 1; background: #fff;
  border-radius: var(--radius-lg); padding: 32px; width: 90%; max-width: 480px;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.modal-header h3 { font-size: 18px; }
.modal-header button {
  background: var(--bg); border: none; border-radius: 8px;
  width: 32px; height: 32px; cursor: pointer; font-size: 16px;
}

/* ── Quick Amounts ────────────────────────────────────── */
.quick-amounts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick-amounts button {
  padding: 5px 12px; background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 20px; font-size: 13px; cursor: pointer; transition: var(--transition);
}
.quick-amounts button:hover { border-color: var(--primary); color: var(--primary); }

/* ── Misc ─────────────────────────────────────────────── */
.green  { color: var(--success); }
.red    { color: var(--danger); }
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.empty-state {
  text-align: center; padding: 60px 24px; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.empty-state.large { padding: 80px 24px; }

/* ── Toast ────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; color: #fff;
  z-index: 9999; box-shadow: var(--shadow-lg);
  transform: translateY(100px); opacity: 0;
  transition: all 0.3s ease;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { background: var(--success); }
#toast.error   { background: var(--danger); }
#toast.info    { background: var(--info); }

/* ── Progress Bar ─────────────────────────────────────── */
.progress-bar {
  height: 8px; background: var(--bg); border-radius: 100px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 100px; transition: width 0.5s ease;
}

/* ── Status Badges ────────────────────────────────────── */
.status-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 600;
}
.status-active    { background: #DCFCE7; color: #4b45c7; }
.status-pending   { background: #FEF3C7; color: #92400E; }
.status-suspended { background: #FEE2E2; color: #B91C1C; }
.status-frozen    { background: #DBEAFE; color: #1D4ED8; }
.status-successful{ background: #DCFCE7; color: #4b45c7; }
.status-failed    { background: #FEE2E2; color: #B91C1C; }
.status-processing{ background: #EDE9FE; color: #6D28D9; }

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 100px; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .modal-content { padding: 24px; }
}
