/* ==========================================================================
   PulsKasy PRO — Fintech Design System & Responsive UI Styles
   ========================================================================== */

:root {
  --bg-canvas: #f3f5fa;
  --bg-surface: #ffffff;
  --bg-elevated: #f8fafd;
  --bg-subtle: #eef2f8;
  --bg-glass: rgba(255, 255, 255, 0.84);
  --border-hairline: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.15);
  --text-primary: #0b1120;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-soft: rgba(16, 185, 129, 0.12);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px -6px rgba(15, 23, 42, 0.05);
  --shadow-float: 0 20px 45px -12px rgba(15, 23, 42, 0.18);
  --ring-focus: rgba(16, 185, 129, 0.25);
}

html.dark {
  --bg-canvas: #080c14;
  --bg-surface: #101726;
  --bg-elevated: #162033;
  --bg-subtle: #1d2a42;
  --bg-glass: rgba(16, 23, 38, 0.84);
  --border-hairline: rgba(148, 163, 184, 0.11);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #8b9bb4;
  --accent: #10b981;
  --accent-hover: #34d399;
  --accent-soft: rgba(16, 185, 129, 0.15);
  --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.28), 0 14px 32px -10px rgba(0, 0, 0, 0.42);
  --shadow-float: 0 24px 56px -12px rgba(0, 0, 0, 0.72);
  --ring-focus: rgba(16, 185, 129, 0.32);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -15%, rgba(16, 185, 129, 0.08), transparent),
    radial-gradient(ellipse 50% 40% at 95% 10%, rgba(59, 130, 246, 0.05), transparent);
  background-attachment: fixed;
}

/* Tabular numbers everywhere currency or metrics appear */
.num,
.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "cv05" 1;
}

.font-mono-num {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

/* Privacy Blur Mode */
body.privacy-mode .priv-amount {
  filter: blur(7px);
  user-select: none;
  transition: filter 0.2s ease;
}
body.privacy-mode .priv-amount:hover {
  filter: blur(0px);
}

/* Surfaces */
.pk-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card);
}

.pk-elevated {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
}

.pk-subtle {
  background-color: var(--bg-subtle);
}

.pk-glass {
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--border-hairline);
}

/* Hero Card Gradient Mesh */
.pk-hero-card {
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(16, 185, 129, 0.14) 0%, transparent 55%),
    radial-gradient(90% 90% at 0% 100%, rgba(59, 130, 246, 0.09) 0%, transparent 50%),
    var(--bg-surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
}

/* Text tokens */
.text-main { color: var(--text-primary); }
.text-sub { color: var(--text-secondary); }
.text-muted-pk { color: var(--text-muted); }

/* Inputs */
.pk-input {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.pk-input::placeholder {
  color: var(--text-muted);
  opacity: 0.72;
}
.pk-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring-focus);
}

/* Custom Numpad Keys */
.numpad-key {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-hairline);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 0.75rem;
  padding: 0.55rem 0.4rem;
  transition: transform 0.07s ease, background-color 0.12s ease, border-color 0.12s ease;
  user-select: none;
}
.numpad-key:hover {
  border-color: var(--border-strong);
  background-color: var(--bg-subtle);
}
.numpad-key:active {
  transform: scale(0.95);
  background-color: var(--accent-soft);
  border-color: var(--accent);
}
.numpad-key-op {
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.08);
}

/* Scrollbar polish */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.42);
}
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* View & Modal Animations */
@keyframes pkFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pkPopIn {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes pkPulseMic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.55); }
  50% { box-shadow: 0 0 0 12px rgba(244, 63, 94, 0); }
}

.animate-pk-view {
  animation: pkFadeUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-pk-modal {
  animation: pkPopIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.mic-recording {
  animation: pkPulseMic 1.3s infinite;
  background-color: #f43f5e !important;
  color: #ffffff !important;
  border-color: #f43f5e !important;
}

/* Calendar Heatmap Cells */
.heat-cell {
  aspect-ratio: 1 / 1;
  border-radius: 0.65rem;
  border: 1px solid var(--border-hairline);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.heat-cell:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* Safe area bottom padding for mobile nav + floating action button */
.pb-safe-main {
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
}
.pb-safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Kbd shortcut badge */
.pk-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  padding: 0.12rem 0.38rem;
  border-radius: 0.38rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}
