/* =========================================================================
   FINS — theme layer for Framework7 v8, iOS theme.
   Palette from the brand swatches:
     Krishna #6045F4 · Aqua Green #53E6D4 · Vivid Mint #2BC48B
     Mirage #0E1B2B · Bunker #0F1417 · Glossy Platinum #E6EAED
   ========================================================================= */

:root {
  --violet:    #6045F4;
  --violet-dk: #4B2FF0;
  --aqua:      #53E6D4;
  --mint:      #2BC48B;
  --danger:    #FF5D5D;

  --bg:        #0B1420;
  --bg-2:      #0E1B2B;
  --card:      #14202F;
  --hair:      rgba(255, 255, 255, 0.09);

  --ink:       #E6EAED;
  --ink-soft:  #90A1B4;
  --ink-faint: #62748A;

  --font-brand: "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-num:   "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --f7-theme-color: var(--violet);
  --f7-theme-color-rgb: 96, 69, 244;
  --f7-theme-color-shade: var(--violet-dk);
  --f7-theme-color-tint: #7A63F6;
}

/* --- Framework7 dark surfaces, repainted ------------------------------- */
:root.dark,
.dark {
  --f7-page-bg-color: var(--bg);
  --f7-text-color: var(--ink);
  --f7-bars-bg-color: rgba(14, 27, 43, 0.72);
  --f7-bars-bg-color-rgb: 14, 27, 43;
  --f7-bars-border-color: var(--hair);
  --f7-bars-text-color: var(--ink);

  --f7-list-bg-color: var(--card);
  --f7-list-item-border-color: var(--hair);
  --f7-list-item-title-text-color: var(--ink);
  --f7-list-item-after-text-color: var(--ink-soft);
  --f7-list-item-subtitle-text-color: var(--ink-soft);
  --f7-list-item-text-text-color: var(--ink-soft);
  --f7-list-chevron-icon-color: var(--ink-faint);

  --f7-block-strong-bg-color: var(--card);
  --f7-block-title-text-color: var(--ink-soft);
  --f7-block-text-color: var(--ink-soft);
  --f7-block-footer-text-color: var(--ink-faint);

  --f7-input-text-color: var(--ink);
  --f7-input-placeholder-color: var(--ink-faint);
  --f7-label-text-color: var(--ink-soft);

  --f7-tabbar-link-active-color: var(--aqua);
  --f7-tabbar-link-inactive-color: var(--ink-faint);

  --f7-sheet-bg-color: var(--bg-2);
  --f7-actions-bg-color: var(--bg-2);
  --f7-dialog-bg-color: rgba(27, 42, 60, 0.94);
  --f7-login-screen-bg-color: var(--bg);
}

/* --- Base -------------------------------------------------------------- */
html, body { background: var(--bg); }
body { color: var(--ink); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
[hidden] { display: none !important; }

/* Ambient light, so the frosted bars have something to pick up. */
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(46% 34% at 16% 6%,  rgba(96, 69, 244, 0.26), transparent 70%),
    radial-gradient(50% 38% at 90% 88%, rgba(83, 230, 212, 0.15), transparent 72%);
}
#app { position: relative; z-index: 1; }

/* =========================================================================
   Brand
   ========================================================================= */
.mark { width: 56px; height: 56px; display: block; }
.mark-sm { width: 26px; height: 26px; margin-left: 2px; }

.wordmark {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  margin: 16px 0 6px;
  background: linear-gradient(105deg, var(--ink) 0%, var(--aqua) 55%, var(--violet) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  font-family: var(--font-brand);
  font-weight: 300;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
}

/* =========================================================================
   Login screen
   ========================================================================= */
.login-screen, .login-screen .page { background: var(--bg); }
.login-screen .page { background: transparent; }

.login-screen-content { position: relative; }
.login-screen-content::before {
  content: "";
  position: absolute;
  inset: -30%;
  pointer-events: none;
  background:
    radial-gradient(44% 30% at 20% 12%, rgba(96, 69, 244, 0.3), transparent 70%),
    radial-gradient(46% 32% at 84% 86%, rgba(83, 230, 212, 0.16), transparent 72%);
}

.login-screen .brand,
.login-screen .auth-pane { position: relative; }

.login-screen .brand { text-align: center; margin: 0 0 26px; }
.login-screen .brand .mark { margin: 0 auto; }

.auth-pane { animation: rise 0.32s cubic-bezier(0.22, 0.9, 0.3, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.auth-switch { color: var(--ink-soft); font-weight: 400; margin-top: 6px; }
.auth-switch b { color: var(--aqua); font-weight: 600; }

.auth-note { text-align: center; }

.auth-msg {
  display: none;
  margin: 0 16px 4px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--danger);
  background: rgba(255, 93, 93, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
}
.auth-msg.show { display: block; }

/* =========================================================================
   Hero panel
   ========================================================================= */
.hero {
  background: linear-gradient(150deg, rgba(96, 69, 244, 0.9) 0%, rgba(75, 47, 240, 0.7) 46%, rgba(20, 32, 47, 0.96) 100%);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 18px 40px -22px rgba(96, 69, 244, 0.9);
}
.hero-soft {
  background: linear-gradient(150deg, rgba(83, 230, 212, 0.2) 0%, rgba(20, 32, 47, 0.96) 70%);
  box-shadow: none;
  border: 1px solid var(--hair);
}

.hero-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(230, 234, 237, 0.72);
  margin-bottom: 10px;
}
.hero-value {
  font-family: var(--font-num);
  font-weight: 500;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.hero-value-sm { font-size: 24px; font-family: var(--font-brand); letter-spacing: 0; }
.hero-sub { margin-top: 8px; font-size: 14px; color: rgba(230, 234, 237, 0.66); }

/* =========================================================================
   The month rail
   ========================================================================= */
.rail-wrap { margin: 26px 16px 0; }

.rail-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.rail-title { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.rail-legend { font-family: var(--font-num); font-size: 12px; color: var(--ink-faint); }

.rail {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 78px;
  padding: 0 2px 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }

.rail-day {
  flex: 1 0 9px;
  min-width: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.rail-bar {
  width: 100%;
  min-height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  transition: height 0.5s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.rail-day.has-bill .rail-bar { background: linear-gradient(180deg, var(--aqua), rgba(83, 230, 212, 0.28)); }
.rail-day.is-today .rail-bar { background: linear-gradient(180deg, var(--violet), rgba(96, 69, 244, 0.35)); }
.rail-day.is-today.has-bill .rail-bar { background: linear-gradient(180deg, #fff, var(--violet)); }

.rail-num { font-family: var(--font-num); font-size: 9px; color: var(--ink-faint); height: 11px; }
.rail-day.is-today .rail-num { color: var(--ink); }

/* =========================================================================
   Lists and rows
   ========================================================================= */
.block-title { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }

.fins-list { margin: 8px 16px 0; }
.fins-list ul { background: var(--card); border-radius: 16px; }

.row-icon {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(96, 69, 244, 0.18);
  color: #9C8BFF;
  font-size: 16px;
}
.row-icon.aqua { background: rgba(83, 230, 212, 0.16); color: var(--aqua); }
.row-icon.mint { background: rgba(43, 196, 139, 0.16); color: var(--mint); }
.row-icon.dim  { background: rgba(255, 255, 255, 0.06); color: var(--ink-faint); }

.amount {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
}
.amount-sm { font-size: 13px; color: var(--ink-soft); }

.pill {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--aqua);
  background: rgba(83, 230, 212, 0.14);
  vertical-align: 2px;
}
.pill-private { color: var(--ink-soft); background: rgba(255, 255, 255, 0.08); }

.trail { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }

.you-badge { color: var(--aqua); }

/* Goal progress */
.bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.09); overflow: hidden; margin-top: 8px; }
.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--violet), var(--aqua));
  transition: width 0.6s cubic-bezier(0.22, 0.9, 0.3, 1);
}

/* Empty states */
.empty {
  margin: 8px 16px 0;
  padding: 28px 22px;
  border-radius: 18px;
  background: var(--card);
  border: 1px dashed var(--hair);
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
}
.empty i { display: block; font-size: 26px; color: var(--ink-faint); margin-bottom: 10px; }

.block-footer-note { font-size: 13px; color: var(--ink-faint); text-align: center; }

/* =========================================================================
   Invite code
   ========================================================================= */
.invite-card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
}
.invite-code {
  font-family: var(--font-num);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--aqua);
  margin-bottom: 10px;
}
.invite-help { font-size: 13px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 16px; }

/* =========================================================================
   Bars, sheets, buttons
   ========================================================================= */
.navbar .navbar-bg { backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.navbar .title { font-family: var(--font-brand); font-weight: 500; }

.toolbar.tabbar { backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.tabbar .tabbar-label { font-size: 10px; }

.sheet-modal { border-radius: 20px 20px 0 0; overflow: hidden; }
.sheet-modal .toolbar { --f7-toolbar-bg-color: var(--bg-2); }
.sheet-title { font-weight: 600; font-size: 16px; }
.sheet-modal-inner .page-content { max-height: 76vh; padding-bottom: 20px; }

.button-danger { background: rgba(255, 93, 93, 0.12); color: var(--danger); }
.button-outline { --f7-button-border-color: var(--hair); color: var(--ink-soft); }

/* A little air under the last card, above the tab bar. */
.tabs > .page-content::after { content: ""; display: block; height: 24px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
