/* ============================================================
   Stackr dashboard — a mobile-app experience rendered in a
   centered phone frame. Builds on the brand tokens in styles.css
   (violet primary, mint accent, indigo ink) so it reads as Stackr,
   not a clone of any one app.
   ============================================================ */

body {
  background: linear-gradient(180deg, #ece8ff 0%, #f3f1fb 40%, #e7faf2 100%);
  min-height: 100vh;
}
body::before { display: none; } /* drop the marketing grid texture here */

.muted { color: var(--ink-soft); }
.small { font-size: 0.8rem; }
.pos { color: var(--mint-deep); }
.warn { color: var(--coral); }
.hidden { display: none !important; }

/* ---------- Loading veil ---------- */
.app-loading { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid var(--violet-soft); border-top-color: var(--violet);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App frame ---------- */
.app {
  width: min(100%, 440px);
  margin-inline: auto;
  min-height: 100vh;
  background: transparent;
  position: relative;
  padding-bottom: 92px; /* room for bottom nav */
}
@media (min-width: 480px) {
  .app {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: calc(100vh - 3rem);
    background: var(--bg);
    border-radius: 34px;
    box-shadow: 0 40px 90px -40px rgba(22,19,52,0.5);
    overflow: hidden;
    border: 1px solid var(--line);
  }
}

/* ---------- Top bar ---------- */
.app__top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 0.7rem;
  padding: 1rem 1.1rem 0.8rem;
  background: linear-gradient(180deg, rgba(243,241,251,0.96), rgba(243,241,251,0.7));
  backdrop-filter: blur(8px);
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  border: none; background: var(--ink); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.app__top-pills { display: flex; gap: 0.5rem; margin-left: auto; }
.pill-chip {
  font-size: 0.78rem; font-weight: 700; padding: 0.4rem 0.7rem; border-radius: 999px;
  white-space: nowrap;
}
.pill-chip--mint { background: var(--mint-soft); color: var(--mint-deep); }
.pill-chip--violet { background: var(--violet-soft); color: var(--violet-deep); }

.acct-menu {
  position: absolute; top: 60px; left: 1.1rem; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 0.5rem; min-width: 200px;
}
.acct-menu__email { font-size: 0.8rem; color: var(--ink-soft); padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); margin-bottom: 0.3rem; word-break: break-all; }
.acct-menu__item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font: inherit; color: var(--ink); padding: 0.55rem 0.6rem; border-radius: 9px; cursor: pointer; text-decoration: none;
}
.acct-menu__item:hover { background: var(--violet-soft); }

/* ---------- Screens ---------- */
.app__screens { padding: 0.4rem 1.1rem 1.4rem; }
.screen { display: grid; gap: 1rem; animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.screen__title { font-size: 1.7rem; margin: 0.4rem 0 0.2rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.3rem;
  box-shadow: 0 10px 26px -20px rgba(22,19,52,0.45);
}

/* ---------- Buttons (dashboard extras) ---------- */
.btn--ink { --bg: var(--ink); --fg: #fff; border-color: var(--ink); }
.btn--sm { padding: 0.55rem 1rem; font-size: 0.86rem; }

.text-link {
  background: none; border: none; color: var(--violet-deep); font: inherit; font-weight: 700;
  cursor: pointer; padding: 0.6rem 0 0; display: inline-block;
}

/* ---------- Home: score card ---------- */
.score-card__top, .acct__head { display: flex; justify-content: space-between; align-items: center; color: var(--ink-soft); font-weight: 600; }
.score-card__num { display: flex; align-items: baseline; gap: 0.7rem; margin: 0.4rem 0 0.9rem; }
.score-card__num b { font-family: var(--display); font-size: 3.4rem; line-height: 1; letter-spacing: -0.03em; }
.delta { color: var(--mint-deep); font-weight: 700; font-size: 0.95rem; }
.chip-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--mint-soft); color: var(--mint-deep);
  border: none; font: inherit; font-weight: 700; font-size: 0.86rem;
  padding: 0.45rem 0.8rem; border-radius: 999px; cursor: pointer;
}
.chip-link__ic { font-weight: 800; }

/* ---------- Home: credit account ---------- */
.acct__title { font-family: var(--display); font-size: 1.25rem; font-weight: 700; color: var(--ink); }
.acct__pill {
  display: inline-block; margin: 0.7rem 0 1rem;
  background: var(--mint-soft); color: var(--mint-deep);
  font-size: 0.82rem; font-weight: 700; padding: 0.35rem 0.7rem; border-radius: 999px;
}
.timeline { display: flex; justify-content: space-between; gap: 0.3rem; margin-bottom: 1rem; }
.tl {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  position: relative;
}
.tl::before {
  content: ""; position: absolute; top: 16px; left: -50%; width: 100%; height: 2px;
  background: var(--line-strong); z-index: 0;
}
.tl:first-child::before { display: none; }
.tl__dot {
  width: 33px; height: 33px; border-radius: 50%; z-index: 1;
  display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line-strong); color: var(--ink-soft);
  font-size: 0.9rem; font-weight: 700;
}
.tl--paid .tl__dot { background: var(--mint-deep); border-color: var(--mint-deep); color: #fff; }
.tl--paid::before { background: var(--mint-deep); }
.tl--current .tl__dot { border-color: var(--violet); color: var(--violet); border-style: dashed; }
.tl__label { font-size: 0.72rem; color: var(--ink-soft); }
.tl--current .tl__label { color: var(--violet-deep); font-weight: 700; }

.acct__rows { display: grid; gap: 0.55rem; margin-bottom: 1.1rem; }
.acct__row { display: flex; justify-content: space-between; gap: 0.8rem; font-size: 0.9rem; color: var(--ink-soft); align-items: center; }
.acct__row b { color: var(--ink); }
.acct__row b.pos { color: var(--mint-deep); }

/* ---------- Home: bill promo ---------- */
.bill-promo { display: flex; align-items: center; gap: 1rem; background: linear-gradient(135deg, var(--violet-soft), var(--mint-soft)); border: none; }
.bill-promo h3 { font-size: 1.15rem; margin-bottom: 0.2rem; }
.bill-promo p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }
.bill-promo__art { font-size: 2.6rem; flex: none; }

/* ---------- Credit: bureau tabs ---------- */
.bureau-tabs { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.2rem; }
.bureau {
  flex: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.5rem 0.9rem; font: inherit; font-size: 0.85rem; font-weight: 600;
  color: var(--ink-soft); cursor: pointer; white-space: nowrap;
}
.bureau.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 2025 Wrapped strip */
.wrapped {
  background: var(--ink); color: #fff; border-radius: 18px; padding: 1.2rem 1.3rem;
  display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; position: relative; overflow: hidden;
}
.wrapped::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(22,224,160,0.45), transparent 65%); }
.wrapped__logo { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 800; color: var(--mint); font-size: 0.85rem; }
.wrapped__logo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.wrapped b { font-family: var(--display); font-size: 1.7rem; letter-spacing: -0.02em; }
.wrapped__btn { background: rgba(255,255,255,0.14); color: #fff; border: none; border-radius: 999px; padding: 0.45rem 0.9rem; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }

/* Credit score card */
.credit-score__num { display: flex; align-items: baseline; gap: 0.6rem; }
.credit-score__num b { font-family: var(--display); font-size: 3rem; line-height: 1; letter-spacing: -0.03em; }
.credit-score__meta { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ink-soft); margin: 0.5rem 0 0.9rem; }
.gauge { position: relative; height: 10px; border-radius: 999px; background: linear-gradient(90deg, #ff6f5e, #ffd64a, #16e0a0); }
.gauge__dot { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); transform: translate(-50%, -50%); transition: left 0.6s cubic-bezier(.2,.8,.2,1); left: 0; }
.credit-score__foot { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.9rem; font-size: 0.88rem; }
.band-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mint-deep); }
.credit-score__foot .muted { margin-left: auto; }

/* Glow-up banner */
.glowup {
  background: linear-gradient(120deg, var(--mint), var(--mint-deep)); color: #06372a;
  border-radius: 16px; padding: 0.9rem 1.1rem; display: flex; align-items: center; justify-content: space-between;
}
.glowup b { font-family: var(--display); font-size: 1.2rem; display: block; }
.glowup span { font-size: 0.82rem; font-weight: 600; }

/* Usage tracker */
.usage__head { color: var(--ink-soft); font-weight: 600; margin-bottom: 0.4rem; }
.usage__pct { font-family: var(--display); font-size: 2.4rem; color: var(--mint-deep); }
.usage__bar { height: 9px; border-radius: 999px; background: var(--violet-soft); margin: 0.7rem 0; overflow: hidden; }
.usage__bar i { display: block; height: 100%; border-radius: 999px; background: var(--mint-deep); width: 0; transition: width 0.6s ease; }
.usage__rows { display: flex; justify-content: space-between; font-size: 0.84rem; color: var(--ink-soft); }
.usage__rows b { color: var(--ink); }
.usage__note { font-size: 0.8rem; color: var(--ink-soft); margin: 0.9rem 0 0; }

/* ---------- Bills ---------- */
.bill-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.bill-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 1rem; font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem;
}
.bill-tile__ic { font-size: 1.5rem; }
.savings { background: linear-gradient(135deg, var(--mint-soft), var(--violet-soft)); border: none; }
.savings h3 { font-size: 1.1rem; margin-bottom: 0.2rem; }
.savings p { margin: 0 0 0.8rem; font-size: 0.86rem; color: var(--ink-soft); }
.seg { display: flex; gap: 0.4rem; background: var(--violet-soft); padding: 0.3rem; border-radius: 999px; }
.seg__btn { flex: 1; background: none; border: none; font: inherit; font-weight: 600; font-size: 0.86rem; color: var(--ink-soft); padding: 0.5rem; border-radius: 999px; cursor: pointer; }
.seg__btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.empty { text-align: center; padding: 1.5rem 1rem; }
.empty__art { font-size: 3rem; margin-bottom: 0.6rem; }
.empty b { display: block; font-size: 1.1rem; margin-bottom: 0.2rem; }
.empty p { margin: 0 0 1.2rem; color: var(--ink-soft); font-size: 0.88rem; }

/* ---------- Disputes ---------- */
.dispute { text-align: center; }
.dispute__art { font-size: 3rem; margin-bottom: 0.5rem; }
.dispute__head { font-size: 1.3rem; margin-bottom: 1.1rem; }
.dispute__item {
  display: flex; justify-content: space-between; align-items: center; text-align: left;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.8rem 1rem; margin-bottom: 1.1rem;
}
.dispute__item b { display: block; }
.dispute p { margin: 0.8rem 0 0; }

/* ---------- Offers ---------- */
.offer-cats { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.2rem; }
.offer-cat { flex: none; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 0.85rem; font: inherit; font-size: 0.84rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.offer-cat.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.offer { padding: 0; overflow: hidden; }
.offer__card { height: 110px; display: grid; place-items: center; color: #fff; font-weight: 800; letter-spacing: 0.15em; font-size: 1.1rem; }
.offer__card--a { background: linear-gradient(135deg, #8a5a2b, #c98f4e); }
.offer__card--b { background: linear-gradient(135deg, #1b2a6b, #3f5bd6); }
.offer__body { padding: 1.2rem; }
.offer__body h3 { font-size: 1.15rem; margin-bottom: 0.8rem; }
.offer__rows { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.offer__rows div { display: flex; justify-content: space-between; font-size: 0.86rem; color: var(--ink-soft); }
.offer__rows b { color: var(--ink); }

/* ---------- Bottom nav ---------- */
.app__nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(100%, 440px); z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 0.5rem 0.4rem calc(0.5rem + env(safe-area-inset-bottom));
}
@media (min-width: 480px) {
  .app__nav { bottom: 1.5rem; border-radius: 0 0 34px 34px; border: 1px solid var(--line); border-top: 1px solid var(--line); }
}
.navitem {
  background: none; border: none; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  color: var(--ink-soft); padding: 0.3rem; font-size: 0.68rem; font-weight: 600;
}
.navitem svg { width: 22px; height: 22px; }
.navitem.active { color: var(--violet); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 110px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 0.8rem 1.2rem; border-radius: 999px;
  font-weight: 600; font-size: 0.9rem; z-index: 50; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 0.5rem; animation: toast-in 0.3s ease;
}
.toast .toast__pts { color: var(--mint); font-weight: 800; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Score bump pulse */
.bump { animation: bump 0.6s ease; }
@keyframes bump { 0% { transform: none; } 30% { transform: scale(1.12); color: var(--mint-deep); } 100% { transform: none; } }
