/* Fonts, reset and the pieces every page shares. Colours are CSS variables written by js/theme.js
   (light, or Dark Mode worked out with the iOS app's rule). */

/* The same font files as the iOS app: variable fonts, so one file covers every weight. */
@font-face {
  font-family: 'DM Sans';
  src: url('../fonts/DMSans.ttf') format('truetype');
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Ionicons';
  src: url('../fonts/Ionicons.ttf') format('truetype');
  font-display: block;
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--surface);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--text);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  margin: 0;
  font-weight: inherit;
  font-size: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: inherit;
}

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

img {
  display: block;
}

/* Hidden elements stay hidden even when a class gives them a display. */
[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

/* Icons: the Ionicons font (glyphs in js/glyphs.js), or a small drawn SVG. */
.icon {
  font-family: 'Ionicons';
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  speak: never;
}
.icon-svg svg {
  width: 1em;
  height: 1em;
  display: block;
}

/* Card logos: the bundled logo, else the card's first letter (size set by script). */
.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.card-letter {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1;
}

.flag {
  display: block;
  flex: none;
}

/* The header every inner page shares (PageHeader.swift): back, title in the middle. */
.page-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--topbar-line);
}
.page-header-row {
  max-width: 900px;
  margin: 0 auto;
  padding: 8px 20px;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.back-button {
  width: 44px;
  height: 44px;
  margin-left: -10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text);
  border-radius: 12px;
}
.back-button:active {
  opacity: 0.5;
}
.page-title {
  flex: 1;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-header-spacer {
  width: 34px;
  flex: none;
}

/* Pages not built yet. */
.coming-soon {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px;
  text-align: center;
}
.coming-soon h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 600;
}
.coming-soon p {
  color: var(--muted);
  font-size: 14px;
}
.coming-soon .coming-soon-details {
  font-size: 13px;
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Loading and "can't reach the server" (ServerLoaded in LiveScreens.swift) */
.loading {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}
.loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--topbar-line);
  border-top-color: var(--muted);
  animation: loading-spin 0.8s linear infinite;
}
@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-icon {
  font-size: 30px;
  color: var(--muted);
}
.loading-message {
  max-width: 300px;
  font-size: 14px;
  color: var(--text);
}
.loading-retry {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--surface);
  background: var(--text);
}

/* Bank logo (BankLogo in NigerianBanks.swift): the logo on a white tile, else initials on a gradient */
.bank-logo {
  flex: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
}
.bank-logo.has-image {
  background: #fff;
  border: 1px solid #e8ecf2;
}
.bank-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.bank-logo.tone-0 { background: linear-gradient(135deg, #5a6dd0, #33469e); }
.bank-logo.tone-1 { background: linear-gradient(135deg, #2aa37a, #16704f); }
.bank-logo.tone-2 { background: linear-gradient(135deg, #e2884a, #b35a22); }
.bank-logo.tone-3 { background: linear-gradient(135deg, #9a5bd6, #643199); }
.bank-logo.tone-4 { background: linear-gradient(135deg, #3a9bd0, #1f6a99); }

/* Buttons with a single centred label (the page reset leaves button text left-aligned) */
.pf-save,
.pf-close-account,
.pf-sheet-cancel,
.bt-continue,
.bt-track,
.rf-done,
.dialog-button,
.loading-retry,
.act-empty-button,
.nt-empty-button {
  text-align: center;
}
