/* ─────────────────────────────────────────────────────────────────────────
   InFin4U — Design System
   Font: Inter (Google Fonts)
   Color: Teal primary, Gold accent, Indian-market inspired
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --primary:        #0F766E;
  --primary-light:  #14B8A6;
  --primary-dark:   #134E4A;
  --success:        #16A34A;
  --warning:        #D97706;
  --danger:         #DC2626;
  --neutral:        #6B7280;
  --bg-primary:     #F0FDFA;
  --bg-card:        #FFFFFF;
  --bg-dark:        #0F1724;
  --text-primary:   #111827;
  --text-secondary: #374151;
  --text-muted:     #9CA3AF;
  --border:         #E5E7EB;
  --border-focus:   #14B8A6;
  --gold:           #D97706;
  --gold-light:     #FEF3C7;
  --gold-dark:      #92400E;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg:  0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.05);
  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  16px;
  --font:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --text-xs:    11px;
  --text-sm:    13px;
  --text-base:  15px;
  --text-md:    16px;
  --text-lg:    18px;
  --text-xl:    20px;
  --text-2xl:   24px;
  --text-3xl:   30px;
  --text-4xl:   38px;
}

/* ─── RESET & BASE ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--text-base);
  margin: 0; padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.senior-mode { font-size: calc(var(--text-base) * 1.35); }

h1,h2,h3,h4,h5,h6 { margin: 0 0 0.5em; font-weight: 700; line-height: 1.25; }
p { margin: 0 0 1em; }
a { color: var(--primary); }

/* ─── LAYOUT ───────────────────────────────────────────────────────────── */
.container    { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
.container-sm { max-width: 480px;  margin: 0 auto; padding: 24px 20px; }
.container-md { max-width: 720px;  margin: 0 auto; padding: 24px 20px; }

/* ─── NAVBAR ───────────────────────────────────────────────────────────── */
.navbar {
  background: var(--bg-card);
  padding: 0 24px;
  height: 60px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.navbar-brand {
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.navbar-brand span { color: var(--gold); }
.navbar-menu { display: flex; align-items: center; gap: 4px; }
.navbar-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-sm);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.navbar-menu a:hover, .navbar-menu a.active { background: #F0FDFA; color: var(--primary); }
.navbar-right { display: flex; align-items: center; gap: 8px; }

/* ─── ALERT STRIP ──────────────────────────────────────────────────────── */
.alert-strip {
  padding: 10px 24px;
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.alert-strip.warning { background: var(--gold-light); color: var(--gold-dark); border-bottom: 1px solid #FCD34D; }
.alert-strip.danger  { background: #FEE2E2; color: #991B1B; border-bottom: 1px solid #FECACA; }
.alert-strip.success { background: #DCFCE7; color: #166534; border-bottom: 1px solid #BBF7D0; }

/* ─── CARDS ────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-sm  { padding: 14px 16px; }
.card-lg  { padding: 28px 32px; }

.card-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin: 6px 0 4px;
  letter-spacing: -0.5px;
}
.card-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.card-clickable { cursor: pointer; }
.card-clickable:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* Dashboard summary cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  cursor: default;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card .stat-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

/* ─── ONE THING CARD ───────────────────────────────────────────────────── */
.one-thing-card {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  border: 1px solid #FCD34D;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
}
.one-thing-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex; align-items: center; gap: 6px;
}
.one-thing-text {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--bg-dark);
  margin: 10px 0 16px;
  line-height: 1.4;
}

/* ─── BUTTONS ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  font-family: var(--font);
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { padding: 6px 14px; font-size: var(--text-xs); }
.btn-lg { padding: 14px 28px; font-size: var(--text-base); border-radius: var(--radius); }
.btn-block { width: 100%; display: flex; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,118,110,0.35); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803D; }

.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled)  { background: #B91C1C; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover:not(:disabled) { background: var(--gold-dark); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: #F0FDFA; }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover:not(:disabled) { background: #F3F4F6; color: var(--text-primary); }

/* ─── FORMS ────────────────────────────────────────────────────────────── */
.form-group   { margin-bottom: 18px; }
.form-label   { display: block; margin-bottom: 6px; font-weight: 600; font-size: var(--text-sm); color: var(--text-secondary); }
.form-hint    { display: block; margin-top: 4px; font-size: var(--text-xs); color: var(--text-muted); }
.form-error   { display: block; margin-top: 4px; font-size: var(--text-xs); color: var(--danger); }

.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(20,184,166,0.15);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control.error { border-color: var(--danger); }

select.form-control { appearance: none; cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* Radio / Checkbox Option Cards */
.option-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 10px;
}
.option-card:hover { border-color: var(--primary-light); background: #F0FDFA; }
.option-card input[type="radio"], .option-card input[type="checkbox"] { display: none; }
.option-card.selected { border-color: var(--primary); background: #F0FDFA; box-shadow: 0 0 0 3px rgba(15,118,110,0.1); }
.option-card .option-icon { font-size: 22px; width: 32px; text-align: center; }
.option-card .option-text { font-weight: 600; font-size: var(--text-base); }
.option-card .option-sub  { font-size: var(--text-xs); color: var(--text-muted); }

/* ─── GRID ─────────────────────────────────────────────────────────────── */
.grid          { display: grid; gap: 16px; }
.grid-2        { grid-template-columns: repeat(2, 1fr); }
.grid-3        { grid-template-columns: repeat(3, 1fr); }
.grid-4        { grid-template-columns: repeat(4, 1fr); }
.grid-cols-2   { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3   { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4   { grid-template-columns: repeat(4, 1fr); }

/* ─── FLEX ─────────────────────────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end   { justify-content: flex-end; }
.gap-1         { gap: 4px; }
.gap-2         { gap: 8px; }
.gap-3         { gap: 12px; }
.gap-4         { gap: 16px; }
.flex-1        { flex: 1; }
.flex-wrap     { flex-wrap: wrap; }

/* ─── SPACING ──────────────────────────────────────────────────────────── */
.mt-1 { margin-top: 4px; }   .mb-1 { margin-bottom: 4px; }
.mt-2 { margin-top: 8px; }   .mb-2 { margin-bottom: 8px; }
.mt-3 { margin-top: 12px; }  .mb-3 { margin-bottom: 12px; }
.mt-4 { margin-top: 20px; }  .mb-4 { margin-bottom: 20px; }
.mt-6 { margin-top: 32px; }  .mb-6 { margin-bottom: 32px; }
.p-0  { padding: 0; }
.p-4  { padding: 20px; }

/* ─── TYPOGRAPHY ───────────────────────────────────────────────────────── */
.text-xs       { font-size: var(--text-xs); }
.text-sm       { font-size: var(--text-sm); }
.text-base     { font-size: var(--text-base); }
.text-lg       { font-size: var(--text-lg); }
.text-xl       { font-size: var(--text-xl); }
.text-2xl      { font-size: var(--text-2xl); }
.text-3xl      { font-size: var(--text-3xl); }
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-weight-bold { font-weight: 700; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-left     { text-align: left; }
.uppercase     { text-transform: uppercase; letter-spacing: 0.05em; }
.leading-none  { line-height: 1; }

/* Color utilities */
.text-primary   { color: var(--primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger) !important; }
.text-warning   { color: var(--warning) !important; }
.text-gold      { color: var(--gold) !important; }
.text-white     { color: #fff !important; }
.text-dark      { color: var(--text-primary) !important; }

.bg-primary { background: var(--primary) !important; }
.bg-success { background: var(--success) !important; }
.bg-danger  { background: var(--danger) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-gold    { background: var(--gold-light) !important; }
.bg-muted   { background: #F9FAFB !important; }

/* ─── TRANSACTION LIST ─────────────────────────────────────────────────── */
.txn-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.txn-row:last-child { border-bottom: none; }
.txn-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  background: #F0FDFA;
}
.txn-meta { flex: 1; min-width: 0; }
.txn-merchant { font-weight: 600; font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-detail   { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.txn-amount   { font-weight: 700; font-size: var(--text-base); white-space: nowrap; }
.txn-amount.in  { color: var(--success); }
.txn-amount.out { color: var(--danger); }

/* ─── BADGES ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.badge-primary { background: #CCFBF1; color: var(--primary-dark); }
.badge-success { background: #DCFCE7; color: #166534; }
.badge-danger  { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: var(--gold-light); color: var(--gold-dark); }
.badge-neutral { background: #F3F4F6; color: #374151; }

/* ─── PROGRESS BAR ─────────────────────────────────────────────────────── */
.progress-bar-wrap { background: var(--border); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 99px; transition: width 0.4s ease; }
.progress-bar-fill.primary { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.progress-bar-fill.success { background: linear-gradient(90deg, var(--success), #22C55E); }
.progress-bar-fill.warning { background: linear-gradient(90deg, var(--warning), #F59E0B); }
.progress-bar-fill.danger  { background: linear-gradient(90deg, var(--danger), #EF4444); }

/* ─── AUTH PAGES ───────────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #F0FDFA 0%, #CCFBF1 50%, #99F6E4 100%);
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.auth-logo {
  font-size: 28px; font-weight: 800; color: var(--primary);
  letter-spacing: -1px; margin-bottom: 4px;
}
.auth-logo span { color: var(--gold); }

/* OTP input */
.otp-input {
  font-size: 28px;
  letter-spacing: 12px;
  text-align: center;
  font-weight: 700;
}

/* ─── PAGE HEADER ──────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: var(--text-2xl); font-weight: 700; margin: 0; }
.page-sub   { font-size: var(--text-sm); color: var(--text-muted); margin-top: 2px; }

/* ─── DIVIDERS ─────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.divider-label {
  text-align: center; font-size: var(--text-xs); color: var(--text-muted);
  position: relative; margin: 20px 0;
}
.divider-label::before, .divider-label::after {
  content: ''; position: absolute; top: 50%;
  width: calc(50% - 30px); height: 1px; background: var(--border);
}
.divider-label::before { left: 0; }
.divider-label::after  { right: 0; }

/* ─── MISC ─────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 9999px; }
.overflow-hidden { overflow: hidden; }
.cursor-pointer  { cursor: pointer; }

/* ─── LOADING SPINNER ──────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── TOAST NOTIFICATIONS ──────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--bg-dark); color: #fff;
  padding: 12px 18px; border-radius: var(--radius);
  font-size: var(--text-sm); font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.danger  { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ─── RESPONSIVE ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-4, .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-2, .grid-cols-2,
  .grid-3, .grid-cols-3,
  .grid-4, .grid-cols-4 { grid-template-columns: 1fr; }
  .navbar-menu { display: none; }
  .container, .container-sm, .container-md { padding: 16px 14px; }
  .auth-card { padding: 28px 20px; }
  .page-header { flex-direction: column; }
}
