/*
 * Public pages, new design: the landing page, Privacy, Terms and
 * Unsubscribe. Link it right after tx-components.c726069.css (two <link> tags
 * rather than an @import, so the browser fetches both at once). Holds only
 * what is particular to these pages: the page base, how sections are
 * spaced, and the small pictures of the app. Everything reusable lives in
 * components/.
 */

html {
  background: var(--tx-bg-page);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--tx-bg-page);
  color: var(--tx-text);
  font-family: var(--tx-font-body);
  font-size: var(--tx-text-md);
  line-height: 1.5;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Anything with the hidden attribute stays hidden, even if a component
   class gives it a display value */
[hidden] {
  display: none !important;
}

/* "Skip to content" link for keyboard users: hidden until focused */
.pub-skip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: var(--tx-radius-full);
  background: var(--tx-primary);
  color: var(--tx-on-primary);
  font-weight: var(--tx-weight-bold);
  text-decoration: none;
  transform: translateY(-200%);
}

.pub-skip:focus {
  transform: none;
}

/* Light / dark switch: shows a moon in light mode and a sun in dark mode */
.pub-theme .is-sun,
:root.dark .pub-theme .is-moon {
  display: none;
}

:root.dark .pub-theme .is-sun {
  display: block;
}

/* Keep "Log in" and the switches from squashing on small phones */
.tx-site-header__end .tx-btn {
  white-space: nowrap;
}

@media (max-width: 380px) {
  .tx-site-header__end {
    gap: 4px;
  }

  .tx-site-header__end .tx-btn--ghost {
    padding-inline: 10px;
  }
}

/* ---------- landing page ---------- */

.home-hero h1 {
  font-size: clamp(44px, 6vw, 80px);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.home-hero .tx-checklist--inline {
  margin-top: 26px;
}

/* Phones: the two hero buttons go full width, easy to hit with a thumb */
@media (max-width: 480px) {
  .home-hero .tx-hero__actions .tx-btn {
    flex: 1 1 100%;
  }
}

.home-section {
  padding-block: clamp(64px, 9vw, 112px) 0;
}

.home-section .tx-section-head {
  margin-bottom: clamp(28px, 4vw, 40px);
}

/* The picture of the app in the hero. It is a drawing, not a screenshot,
   so it's hidden from screen readers and gets a caption instead. */
.home-shot {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.home-shot__label {
  color: var(--tx-income);
  font-size: 11px;
  font-weight: var(--tx-weight-bold);
  letter-spacing: var(--tx-label-tracking);
  text-transform: uppercase;
}

.home-shot__big {
  margin-top: 6px;
  font-family: var(--tx-font-money);
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
}

.home-shot__split {
  display: flex;
  gap: 3px;
  max-width: 320px;
  margin-top: 14px;
}

.home-shot__split span {
  height: 6px;
  border-radius: var(--tx-radius-full);
}

.home-shot__split span:first-child {
  flex: 71;
  background: var(--tx-income);
}

.home-shot__split span:last-child {
  flex: 29;
  background: var(--tx-expense);
}

.home-shot__legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 320px;
  margin-top: 8px;
  color: var(--tx-text-muted);
  font-size: var(--tx-text-xs);
}

.home-shot__card {
  padding: 14px 16px 4px;
  border-radius: 18px;
  background: var(--tx-bg-card);
}

.home-shot__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.home-shot__head .tx-label {
  font-size: 10px;
}

.home-shot__head span:last-child {
  font-family: var(--tx-font-money);
  font-size: 22px;
}

.home-shot__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: var(--tx-text-sm);
}

.home-shot__row + .home-shot__row {
  border-top: 1px solid var(--tx-line);
}

.home-shot__row > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: var(--tx-weight-bold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-shot__row > span:last-child {
  font-weight: var(--tx-weight-bold);
}

/* The little phone over the browser window */
.home-phone {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 11px;
}

.home-phone__title {
  font-weight: var(--tx-weight-bold);
  text-align: center;
}

.home-phone__switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: var(--tx-radius-full);
  background: var(--tx-bg-track);
  font-size: 10px;
  font-weight: var(--tx-weight-bold);
  text-align: center;
}

.home-phone__switch span {
  padding: 5px 0;
  border-radius: var(--tx-radius-full);
  color: var(--tx-text-muted);
}

.home-phone__switch span:first-child {
  background: var(--tx-bg-card);
  color: var(--tx-text);
}

.home-phone__amount {
  font-family: var(--tx-font-money);
  font-size: 34px;
  line-height: 1;
  text-align: center;
}

.home-phone__fields {
  padding: 2px 10px;
  border-radius: 14px;
  background: var(--tx-bg-card);
}

.home-phone__fields div {
  padding: 7px 0;
}

.home-phone__fields div + div {
  border-top: 1px solid var(--tx-line);
}

.home-phone__fields small {
  display: block;
  color: var(--tx-text-muted);
  font-size: 9px;
}

.home-phone__fields strong {
  font-weight: var(--tx-weight-bold);
}

.home-phone__fields .is-done {
  color: var(--tx-income-on-tint);
}

.home-phone__save {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  border-radius: var(--tx-radius-full);
  background: var(--tx-primary);
  color: var(--tx-on-primary);
  font-weight: var(--tx-weight-bold);
}

.home-hero figcaption {
  margin-top: 14px;
  color: var(--tx-text-muted);
  font-size: var(--tx-text-sm);
}

@media (min-width: 561px) {
  .home-hero figcaption {
    position: absolute;
    bottom: 6px;
    left: 4px;
    max-width: calc(100% - 240px);
    margin: 0;
  }
}

/* Step-card previews */
.home-step-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.home-step-row .is-expense {
  color: var(--tx-expense);
  font-weight: var(--tx-weight-bold);
}

.home-money {
  font-family: var(--tx-font-money);
  font-size: 20px;
}

.home-file {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-file > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.home-file b {
  overflow: hidden;
  font-weight: var(--tx-weight-bold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-file .is-done {
  color: var(--tx-income);
}

/* Features: the "Coming soon" card sits under the grid */
.home-soon {
  margin-top: var(--tx-space-4);
}

/* Pricing: words on the left, the card on the right */
.home-pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  align-items: center;
  gap: 40px;
}

.home-pricing .tx-section-head {
  margin: 0;
}

/* Story */
.home-story {
  max-width: 760px;
  margin-inline: auto;
}

.home-story .tx-letter {
  max-width: none;
}

/* More from Transactor: Balance */
.home-balance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  align-items: center;
  gap: 32px;
}

.home-balance__name {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.home-balance__name svg {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
}

.home-balance p {
  max-width: 30em;
  margin: 18px 0 24px;
  color: var(--tx-text-soft);
  font-size: var(--tx-text-lg);
  line-height: 1.55;
}

.home-balance .tx-frame-phone {
  justify-self: center;
  width: 250px;
  outline-color: var(--tx-bg-hover);
  box-shadow: none;
}

.home-balance__screen {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.home-balance__screen .home-shot__label {
  margin-top: 10px;
  font-size: 9px;
}

.home-balance__screen .home-shot__big {
  font-size: 40px;
}

.home-balance__screen .home-shot__card {
  margin-top: 10px;
  padding: 0 10px;
  text-align: left;
}

.home-close {
  padding-block: clamp(64px, 9vw, 112px) 0;
}

/* ---------- Privacy and Terms ---------- */

.legal-main {
  padding-block: 24px 64px;
}

.legal-main .tx-display {
  font-size: clamp(40px, 5vw, 64px);
}

.legal-main .tx-prose > p:first-of-type {
  margin-top: 28px;
}

.legal-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 28px 40px;
  border-top: 1px solid var(--tx-line-strong);
  color: var(--tx-text-muted);
  font-size: var(--tx-text-sm);
}

.legal-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.legal-foot a {
  color: var(--tx-text-soft);
}

/* ---------- What's new ---------- */

.news-top {
  padding-block: clamp(32px, 6vw, 64px) clamp(8px, 2vw, 24px);
}

.news-top .tx-section-head {
  margin-bottom: clamp(32px, 5vw, 56px);
}

.news-top .tx-lede {
  max-width: 34em;
  font-size: 18px;
}

.news-top .tx-hero__actions {
  justify-content: center;
  margin-top: 10px;
}

/* A screenshot of the app: in a browser window on wide screens, in a phone
   on narrow ones, where the wide picture would be too small to read. */
.news-shot figure {
  margin: 0;
}

.news-shot__phone {
  display: none;
}

@media (max-width: 720px) {
  .news-shot__web {
    display: none;
  }

  .news-shot .news-shot__phone {
    display: block;
    margin-inline: auto;
  }
}

.news-item {
  padding-block: clamp(56px, 8vw, 96px) 0;
}

/* The words on one side, the steps on the other; one under the other when
   there isn't room for both. */
.news-item__intro {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 24px 48px;
  align-items: start;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.news-item .tx-section-head {
  margin-bottom: 0;
}

.news-item .tx-section-head h2 {
  font-size: clamp(30px, 3.4vw, 44px);
}

/* A close-up of one part of a screen */
.news-detail {
  margin: 24px 0 0;
  overflow: hidden;
  border-radius: var(--tx-radius-xl);
  box-shadow: var(--tx-shadow-card);
}

.news-detail img {
  display: block;
  width: 100%;
  height: auto;
}

.news-more {
  padding-block: clamp(56px, 8vw, 96px) 0;
}

.news-more .tx-section-head {
  margin-bottom: 28px;
}

.news-close {
  padding-block: clamp(56px, 8vw, 96px) clamp(40px, 6vw, 72px);
}

/* ---------- Unsubscribe ---------- */

.unsub {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.unsub .tx-auth-center {
  flex: 1;
  min-height: 0;
  padding-top: 24px;
}

.unsub__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.unsub .tx-status .tx-lede {
  margin-top: 12px;
}

.unsub .tx-status__text a {
  color: var(--tx-link);
  font-weight: var(--tx-weight-bold);
}

/* While the request runs, the spinner sits where the icon goes */
.unsub__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--tx-bg-track);
  border-top-color: var(--tx-text);
  border-radius: var(--tx-radius-full);
  animation: unsub-spin 0.8s linear infinite;
}

@keyframes unsub-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .unsub__spinner {
    animation-duration: 2s;
  }
}

/* Phones: no floating card; the message sits on the page and the buttons
   go to the bottom, within thumb reach */
@media (max-width: 559px) {
  .unsub .tx-auth-center {
    align-items: stretch;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .unsub .tx-auth-center__card {
    flex: 1;
    max-width: none;
    padding: 24px 0 0;
    background: transparent;
    box-shadow: none;
  }

  .unsub .tx-auth-center__card .tx-status__icon {
    background: var(--tx-bg-card);
  }

  .unsub__actions {
    margin-top: auto;
  }
}

/* Links inside the footer's sentences ("Also from us: Balance") */
.tx-site-footer__brand p a {
  color: var(--tx-link);
  font-weight: var(--tx-weight-bold);
  text-decoration: none;
}

.tx-site-footer__brand p a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Sign-in pages: log in, sign up, password ---------- */

/* Each page holds a few screens ("views"); only one shows at a time */
.auth-view {
  display: flex;
  flex-direction: column;
  gap: var(--tx-space-5);
}

.auth-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.auth-head .tx-lede {
  margin: 0;
}

/* The big round logo above "Welcome back" shows on phones only, where the
   side panel (and its logo) is hidden */
.auth-mark {
  display: none;
  width: 52px;
  height: 52px;
  margin-bottom: 6px;
}

.auth-back {
  align-self: flex-start;
  margin-bottom: 4px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form .tx-field-group {
  background: var(--tx-bg-card);
  box-shadow: var(--tx-shadow-card);
}

.auth-form .tx-btn[type='submit'] {
  margin-top: 8px;
}

.auth-forgot {
  align-self: flex-end;
  font-size: 14px;
}

.auth-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.auth-foot > p {
  margin: 0;
  color: var(--tx-text-soft);
  font-size: var(--tx-text-md);
}

.auth-foot .tx-footnote {
  font-size: var(--tx-text-xs);
}

/* Message screens (check your inbox, link doesn't work) sit centred */
.auth-view .tx-status {
  padding-top: 8px;
}

.auth-view .tx-status__text strong {
  overflow-wrap: anywhere;
}

/* Side panel */
.auth-panel .tx-display {
  max-width: 12ch;
}

.auth-panel__middle {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}

.auth-panel__card {
  max-width: 420px;
  padding: 18px 20px 8px;
  border-radius: var(--tx-radius-xl);
  box-shadow: 0 1px 2px rgba(28, 27, 25, 0.04), 0 18px 48px rgba(28, 27, 25, 0.08);
  transform: rotate(-1.5deg);
}

.auth-panel__card .home-shot__row > span:nth-child(2),
.auth-panel__card .home-shot__row > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.auth-panel__card .home-shot__row > span:last-child {
  align-items: flex-end;
}

.auth-panel__card small {
  color: var(--tx-text-muted);
  font-size: 11px;
  font-weight: var(--tx-weight-regular);
}

.auth-panel__card small.is-late {
  color: var(--tx-expense);
  font-weight: var(--tx-weight-bold);
}

.auth-panel__foot {
  margin: 0;
  color: var(--tx-text-soft);
  font-size: 14px;
}

/* Phones: one column that fills the screen, with the secondary links
   pushed to the bottom. */
/* Below about 960px the panel and the form no longer fit side by side.
   Rather than stack the panel under the form, drop it and show the page's
   own logo instead. */
@media (max-width: 959px) {
  .auth .auth-panel {
    display: none;
  }

  .auth-mark {
    display: block;
  }

  .auth-head--center {
    align-items: center;
    padding-top: 16px;
    text-align: center;
  }
}

@media (max-width: 767px) {
  /* 100vh on a phone counts the space behind the browser's address bar, so
     a page that tall always scrolls a little. 100dvh is the height you can
     actually see; 100vh stays as the fallback for older browsers. */
  .auth.tx-auth-split {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
  }

  .auth .tx-auth-split__main {
    box-sizing: border-box;
    align-items: stretch;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px max(20px, env(safe-area-inset-right, 0px))
      calc(28px + env(safe-area-inset-bottom, 0px))
      max(20px, env(safe-area-inset-left, 0px));
  }

  .auth .tx-auth-split__form {
    max-width: none;
  }

  .auth-view:not([hidden]) {
    flex: 1;
  }

  .auth-foot {
    margin-top: auto;
    padding-top: var(--tx-space-6);
    text-align: center;
  }
}

/* On the message screens everything sits centred, the links too */
.auth-view:has(> .tx-status) .auth-foot {
  text-align: center;
}

/* Headings get focus when a screen changes, so screen readers announce the
   new screen. That focus isn't something to click, so no outline. */
.auth-view h1:focus {
  outline: none;
}

/* Short phones (an iPhone SE is 667px tall): tighter spacing, a smaller
   logo and heading, so Log in and Create account still fit on one screen */
@media (max-width: 767px) and (max-height: 720px) {
  .auth .tx-auth-split__main {
    padding-top: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .auth-view {
    gap: 14px;
  }

  .auth-head {
    gap: 6px;
  }

  .auth-head--center {
    padding-top: 0;
  }

  .auth-mark {
    width: 40px;
    height: 40px;
    margin-bottom: 2px;
  }

  .auth-back {
    margin-bottom: 0;
  }

  .auth-view .tx-display {
    font-size: 30px;
  }

  .auth-view .tx-notice {
    padding: 10px 14px;
  }

  .auth-form {
    gap: 10px;
  }

  .auth-form .tx-btn[type='submit'] {
    margin-top: 4px;
  }

  .auth-foot {
    gap: 6px;
    padding-top: 16px;
  }
}

/* When another app sent you here, its message replaces the usual line
   under the heading, rather than adding another box to the screen */
.auth-sent-from:not([hidden]) + .tx-lede {
  display: none;
}

.auth-sent-from {
  color: var(--tx-link);
  font-weight: var(--tx-weight-bold);
}
