/* =============================================
   BankQR Base Styles — Reset & Foundations
   ============================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100%;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  user-select: none;
  -webkit-user-select: none;
}

/* Allow text selection in inputs/textareas */
input, textarea, [contenteditable] {
  user-select: text;
  -webkit-user-select: text;
}

/* =============================================
   App Shell
   ============================================= */

#app {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 24px);
}

/* =============================================
   View System
   ============================================= */

.view {
  display: none;
  padding: var(--sp-4);
  padding-top: calc(var(--safe-top) + var(--sp-4));
  animation: viewFadeIn var(--duration-normal) var(--ease-out);
}

.view.active {
  display: block;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================
   Typography Helpers
   ============================================= */

.text-title {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.3px;
}

.text-headline {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.2px;
}

.text-large {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}

.text-body {
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
}

.text-caption {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.text-tiny {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.text-money {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.text-danger { color: var(--text-danger); }
.text-success { color: var(--text-success); }
.text-accent { color: var(--text-accent); }

/* =============================================
   Layout Helpers
   ============================================= */

.hidden { display: none !important; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.flex-start { align-items: flex-start; }
.items-center { align-items: center; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }

.w-full { width: 100%; }

/* =============================================
   Section Headers
   ============================================= */

.section-header {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--sp-4) 0 var(--sp-2);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
}

.section-title-row h3 {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}

.section-title-row .link {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
}

/* =============================================
   Scrollbar
   ============================================= */

::-webkit-scrollbar {
  width: 0;
  height: 0;
}
