/* Демо «Попробовать» — визуально как главная iOS Finside */

.ftry-app {
  --ftry-bg: #f2f2f7;
  --ftry-card: #ffffff;
  --ftry-sales: #1863dc;
  --ftry-balance: #4cae85;
  --ftry-expense: #ff0000;
  --ftry-receipts: #cca221;
  --ftry-tax: #848890;
  min-height: 100vh;
  background: var(--ftry-bg);
}

[data-bs-theme="dark"] .ftry-app {
  --ftry-bg: #000000;
  --ftry-card: #1c1c1e;
  --ftry-tax: #d1d5db;
}

.ftry-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--ftry-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-bs-theme="dark"] .ftry-nav {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.ftry-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
}

.ftry-scroll {
  max-width: 480px;
  margin: 0 auto;
  padding: 0.75rem 1rem 2.5rem;
}

.ftry-upload-card {
  background: var(--ftry-card);
  border-radius: 16px;
  padding: 1.25rem 1.1rem;
  margin-top: 0.5rem;
}

.ftry-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.ftry-subtitle {
  font-size: 0.9rem;
  color: var(--bs-secondary-color);
  margin-bottom: 1.1rem;
  line-height: 1.45;
}

.ftry-period-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ftry-period-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.ftry-period-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--ftry-card);
  color: var(--bs-secondary-color);
}

.ftry-hint-banner {
  font-size: 0.78rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 193, 7, 0.15);
  color: var(--bs-body-color);
  margin-bottom: 0.75rem;
}

.ftry-hero-card {
  background: var(--ftry-card);
  border-radius: 16px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.ftry-hero-inner {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1rem 1rem 1rem 0.75rem;
  overflow: visible;
}

.ftry-rings {
  flex: 0 0 124px;
  width: 124px;
  height: 124px;
  min-width: 124px;
  min-height: 124px;
  -webkit-flex: 0 0 124px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.ftry-rings-img {
  display: block;
  width: 124px;
  height: 124px;
  max-width: none;
  flex-shrink: 0;
}

.ftry-hero-stats {
  flex: 1;
  min-width: 0;
}

.ftry-caption {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  line-height: 1.3;
}

.ftry-balance {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.ftry-balance--pos {
  color: var(--ftry-balance);
}

.ftry-balance--neg {
  color: var(--ftry-expense);
}

.ftry-receipts,
.ftry-receipts-text {
  color: var(--ftry-receipts);
  font-weight: 700;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.ftry-divider {
  width: 100px;
  margin: 0.5rem 0;
  opacity: 0.2;
}

.ftry-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.ftry-metric {
  background: var(--ftry-card);
  border-radius: 12px;
  padding: 0.65rem 0.55rem;
  min-height: 4.5rem;
}

[data-bs-theme="dark"] .ftry-metric {
  background: #232326;
}

.ftry-metric-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  margin-bottom: 0.2rem;
}

.ftry-metric-value {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  word-break: break-word;
}

.ftry-metric--sales .ftry-metric-value {
  color: var(--ftry-sales);
}

.ftry-metric--expense .ftry-metric-value {
  color: var(--ftry-expense);
}

.ftry-metric--tax .ftry-metric-value {
  color: var(--ftry-tax);
}

.ftry-metric-sub {
  font-size: 0.58rem;
  color: var(--bs-secondary-color);
  margin-top: 0.15rem;
  line-height: 1.2;
}

.ftry-section {
  margin-bottom: 1.1rem;
}

.ftry-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
  letter-spacing: -0.02em;
}

.ftry-fitness-card {
  background: var(--ftry-card);
  border-radius: 16px;
  padding: 0.85rem;
}

.ftry-expense-row {
  padding: 0.35rem 0.15rem;
}

.ftry-expense-row--border {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 0.35rem;
  padding-bottom: 0.55rem;
}

[data-bs-theme="dark"] .ftry-expense-row--border {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.ftry-expense-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.ftry-expense-label {
  font-size: 0.88rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ftry-expense-amount {
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.ftry-progress-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 0, 0, 0.08);
  overflow: hidden;
}

.ftry-progress-fill {
  height: 100%;
  border-radius: 2px;
}

.ftry-progress-fill--expense {
  background: rgba(255, 0, 0, 0.35);
}

.ftry-expense-pct {
  font-size: 0.68rem;
  color: var(--bs-secondary-color);
  opacity: 0.85;
  margin-top: 0.15rem;
}

.ftry-group-toggle {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: start;
  color: inherit;
  cursor: pointer;
}

.ftry-group-toggle:hover .ftry-expense-label {
  color: var(--ftry-sales);
}

.ftry-chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  opacity: 0.55;
  transition: transform 0.15s ease;
}

.ftry-group-toggle[aria-expanded="true"] .ftry-chevron {
  transform: rotate(90deg);
}

.ftry-group-toggle .ftry-expense-label {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.ftry-expense-child {
  margin-top: 0.55rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(255, 0, 0, 0.12);
}

.ftry-meta {
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  margin-top: 0.5rem;
}

.ftry-footer-cta {
  margin-top: 1.5rem;
  padding-top: 1rem;
}

@media (min-width: 576px) {
  .ftry-scroll {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* Standalone / checkout cover: upload prompt + results shell */
.checkout-cover {
  background-color: #133d2b;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  align-items: stretch;
}

.checkout-cover__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1 1 auto;
  width: 100%;
  min-height: 100%;
}

.checkout-cover__prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.checkout-cover__text {
  color: #ffd43b;
  font-size: 1.0625rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

@media (min-width: 992px) {
  .checkout-cover {
    align-self: stretch;
  }

  .checkout-cover__panel {
    min-height: 100vh;
    min-height: 100dvh;
  }
}

@media (max-width: 991.98px) {
  .checkout-cover {
    min-height: 0;
  }

  .checkout-cover__panel {
    min-height: 0;
  }

  .checkout-cover__prompt {
    padding: 1.75rem 1.25rem;
    max-width: none;
  }

  .checkout-cover__text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .checkout-cover__results {
    min-height: min(70vh, 36rem);
  }
}

.checkout-cover__error {
  color: #ffb4b4;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.checkout-cover__link {
  display: inline-block;
  color: #ffd43b;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 212, 59, 0.55);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
  animation: checkout-link-attention 1.4s ease-in-out 0.8s 2;
}

.checkout-cover__link:hover {
  color: #ffe066;
  border-bottom-color: #ffe066;
}

@keyframes checkout-link-attention {
  0%, 100% {
    transform: scale(1);
    text-shadow: none;
  }
  50% {
    transform: scale(1.08);
    text-shadow: 0 0 14px rgba(255, 212, 59, 0.65);
  }
}

@media (prefers-reduced-motion: reduce) {
  .checkout-cover__link {
    animation: none;
  }
}

.checkout-cover__loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
}

.checkout-cover__loading.htmx-request {
  display: flex;
}

.checkout-cover__results {
  flex: 1;
  align-self: stretch;
  width: 100%;
  min-height: 100%;
  background: var(--ftry-bg, #f2f2f7);
}

.checkout-cover__panel:has(.checkout-cover__results) {
  justify-content: flex-start;
  align-items: stretch;
}

.checkout-cover__results .ftry-scroll {
  padding-bottom: 2rem;
}

/* Full-page public demo (/finside/try/) */
.ftry-demo-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #133d2b;
}

.ftry-demo-page .ftry-nav {
  background: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.ftry-demo-page .ftry-nav-brand {
  color: #fff;
}

.ftry-demo-page.has-results {
  background: var(--ftry-bg, #f2f2f7);
}

.ftry-demo-page.has-results .checkout-cover {
  background: transparent;
}

.ftry-demo-page.has-results .ftry-nav {
  background: var(--ftry-bg, #f2f2f7);
  border-bottom-color: rgba(0, 0, 0, 0.06);
  color: inherit;
}

.ftry-demo-page.has-results .ftry-nav-brand {
  color: inherit;
}

.ftry-demo-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ftry-demo-shell .checkout-cover__panel {
  flex: 1;
}

.ftry-demo-shell .checkout-cover__results {
  min-height: calc(100vh - 3.5rem);
}
