/* App landing page v2 */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-page {
  --app-section-y: 80px;
  --app-hero-y: 72px;
  --app-grid: 1100px;
  --app-body-lh: 1.72;
}

.app-page .section--app {
  padding-top: var(--app-section-y);
  padding-bottom: var(--app-section-y);
}

.app-page .section--app-hero {
  padding-top: var(--app-hero-y);
  padding-bottom: var(--app-hero-y);
}

.app-page .section--soft {
  background: var(--color-bg-soft);
}

.app-page .section--deep {
  background: var(--color-dark-deep);
  color: #fff;
}

.app-page .container--grid {
  max-width: var(--app-grid);
}

.app-flag {
  color: var(--color-accent-orange);
  font-weight: 700;
}

/* Phone frame */

.phone-frame {
  background: var(--color-dark-deep);
  border-radius: 36px;
  padding: 11px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  position: relative;
}

.phone-frame--mini {
  border-radius: 22px;
  padding: 7px;
  box-shadow: 0 12px 32px rgba(25, 58, 125, 0.12);
}

.phone-frame__screen {
  background: #0a0a0c;
  border-radius: 28px;
  overflow: hidden;
  aspect-ratio: 9 / 19.2;
  position: relative;
}

.phone-frame--mini .phone-frame__screen {
  border-radius: 18px;
  aspect-ratio: 9 / 16;
}

.phone-frame__screen--ui {
  background: #f4f4f4;
}

.phone-frame__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

/* Mini tab bar (Figma nav) */

.app-mini-nav {
  display: flex;
  justify-content: space-around;
  gap: 2px;
  padding: 8px 4px 6px;
  background: #fff;
  border-bottom: 1px solid #eee;
  font-size: 7px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.app-mini-nav--dark {
  background: #193A7D;
  border-bottom: none;
  color: rgba(255, 255, 255, 0.55);
}

.app-mini-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.1;
}

.app-mini-nav__item i {
  font-size: 12px;
}

.app-mini-nav__item.is-active {
  color: var(--color-accent-orange);
}

.app-mini-nav--dark .app-mini-nav__item.is-active {
  color: #fff;
}

/* Hero */

.app-hero {
  background: var(--gradient-dark);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.app-hero::before {
  content: '';
  position: absolute;
  width: 55%;
  height: 80%;
  top: 5%;
  right: -5%;
  background: var(--glow-orange);
  filter: blur(72px);
  pointer-events: none;
}

.app-hero > .container {
  position: relative;
  z-index: 1;
}

.app-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
}

.app-hero__content {
  max-width: 520px;
}

.app-hero .kicker { color: var(--color-text-muted-on-dark); }
.app-hero .h1 { color: #fff; }

.app-hero__sub {
  font-size: 15px;
  line-height: var(--app-body-lh);
  color: var(--color-text-muted-on-dark);
  margin: var(--space-5) 0 var(--space-6);
}

.app-hero__badge-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.app-hero__micro {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted-on-dark);
  letter-spacing: 0.3px;
}

.app-hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 440px;
  position: relative;
}

.app-hero-phone-wrap {
  position: relative;
  width: min(280px, 78vw);
  transform: rotate(-8deg);
  transition: transform 0.5s ease;
}

.app-hero-phone-wrap.is-active {
  transform: rotate(-4deg) scale(1.02);
}

.app-hero-glow {
  position: absolute;
  inset: -20% -30%;
  background: radial-gradient(ellipse at center, rgba(247, 136, 80, 0.55) 0%, transparent 68%);
  pointer-events: none;
  animation: glow-drift 8s ease-in-out infinite;
}

.app-hero-phone {
  position: relative;
  z-index: 1;
}

.app-hero-phone__ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #f4f4f4;
}

.app-hero-phone__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--color-text-dark);
  padding: 12px 14px 8px;
}

.app-hero-phone__state {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 14px 14px;
  overflow: hidden;
}

.app-hero-phone__amount {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--color-accent-blue);
  text-align: center;
  margin-bottom: var(--space-3);
}

.app-hero-slider {
  width: 100%;
  accent-color: var(--color-accent-orange);
  margin: var(--space-2) 0;
}

.app-hero-slider__labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.app-hero-phone__cta {
  width: 100%;
  font-size: 12px;
  padding: 10px 16px;
}

.app-hero-phone__offers-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow: auto;
}

.app-hero-phone__offers-view[hidden] {
  display: none !important;
}

.app-hero-phone--offers .app-hero-phone__slider-view {
  display: none;
}

.app-hero-offer {
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #eee;
  position: relative;
}

.app-hero-offer--featured {
  border-top: 3px solid var(--color-accent-orange);
}

.app-hero-phone--offers .app-hero-offer {
  animation: offer-in 0.45s ease backwards;
}

.app-hero-phone--offers .app-hero-offer:nth-child(2) { animation-delay: 0.08s; }
.app-hero-phone--offers .app-hero-offer:nth-child(3) { animation-delay: 0.16s; }

.app-hero-offer__lender {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-text-dark);
}

.app-hero-offer__range {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-accent-blue);
  margin-top: 2px;
}

.app-hero-offer__apr {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-text-dark);
  margin-top: 4px;
}

.app-hero-offer__meta {
  font-size: 9px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.app-hero-offer__apply {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: var(--color-accent-orange);
  padding: 4px 8px;
  border-radius: 6px;
}

.app-hero-phone__disclaimer {
  font-size: 8px;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: auto;
  padding-top: 4px;
}

.app-float-card {
  position: absolute;
  z-index: 2;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 24px rgba(247, 136, 80, 0.35);
  animation: float-card 5s ease-in-out infinite;
}

.app-float-card--offer {
  top: 6%;
  right: -14%;
  background: #fff;
  color: var(--color-accent-blue);
  transform: rotate(6deg);
}

.app-float-card--gap {
  bottom: 14%;
  left: -20%;
  background: var(--color-accent-orange);
  color: #fff;
  transform: rotate(-8deg);
  animation-delay: 1.2s;
}

/* Big numbers */

.app-numbers {
  text-align: center;
  position: relative;
  overflow: hidden;
}

.app-numbers__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.app-numbers__item {
  padding: var(--space-5);
}

.app-numbers__value {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.1;
  color: var(--color-accent-orange);
  white-space: nowrap;
  margin-bottom: var(--space-3);
}

.app-numbers__label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.app-numbers__note {
  margin-top: var(--space-6);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* Feature blocks (Offers / Planner) */

.app-feature__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: center;
}

.app-feature__grid--reverse .app-feature__copy {
  order: 2;
}

.app-feature__grid--reverse .app-feature__phone {
  order: 1;
}

.app-feature__lead {
  font-size: 15px;
  line-height: var(--app-body-lh);
  color: var(--color-text-muted);
  margin: var(--space-4) 0 var(--space-5);
  max-width: 480px;
}

.app-feature__lead--dark {
  color: var(--color-text-muted-on-dark);
}

.app-feature--planner .h2 {
  color: #fff;
}

.app-feature__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.app-feature__list li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: 14px;
  line-height: var(--app-body-lh);
  color: var(--color-text);
}

.app-feature__list li i {
  font-size: 20px;
  color: var(--color-accent-orange);
  flex-shrink: 0;
  margin-top: 2px;
}

.app-feature__list--dark li {
  color: rgba(255, 255, 255, 0.88);
}

.app-feature__phone {
  display: flex;
  justify-content: center;
}

.app-feature__phone .phone-frame {
  width: min(260px, 72vw);
  transform: rotate(-3deg);
  box-shadow: 0 20px 50px rgba(25, 58, 125, 0.15);
}

.app-feature--planner .phone-frame {
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.35);
}

/* Planner UI (in-phone mock) */

.app-planner-ui {
  position: absolute;
  inset: 0;
  padding: 0 0 16px;
  display: flex;
  flex-direction: column;
  background: #f4f4f4;
}

.app-planner-ui__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--color-text-dark);
  padding: 12px 16px 4px;
}

.app-planner-ui__shortfall {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -2px;
  color: var(--color-accent-orange);
  text-align: center;
  line-height: 1;
  margin: var(--space-3) 0 var(--space-2);
}

.app-planner-ui__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: var(--space-5);
}

.app-planner-ui__breakdown {
  margin: 0 16px;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid #eee;
}

.app-planner-ui__row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-dark);
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}

.app-planner-ui__row:last-child {
  border-bottom: none;
}

.app-planner-ui__row span:last-child {
  font-weight: 800;
  color: var(--color-accent-blue);
}

.app-planner-ui__cta {
  display: block;
  margin: auto 16px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--color-accent-blue);
  padding: 10px 14px;
  border-radius: 10px;
}

/* In-app steps block */

.app-steps {
  padding: 84px 56px;
}

.as-head {
  text-align: center;
  margin-bottom: 46px;
}

.as-kick {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--color-accent-blue);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.as-h2 {
  font-weight: 900;
  font-size: 34px;
  letter-spacing: -1.4px;
  color: var(--color-text-dark);
  margin: 0;
}

.as-grid {
  display: flex;
  gap: 50px;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  justify-content: center;
}

.as-stepper {
  flex: 1;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.strow {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  width: 100%;
}

.strow.act {
  background: #FAFAF8;
  box-shadow: 0 8px 24px rgba(25, 58, 125, 0.08);
}

.stn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eef2fb;
  color: var(--color-accent-blue);
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: 0.2s;
}

.strow.act .stn {
  background: var(--color-accent-orange);
  color: #fff;
  box-shadow: 0 6px 16px rgba(247, 136, 80, 0.4);
}

.strow h3 {
  font-weight: 800;
  font-size: 15px;
  color: var(--color-text-dark);
  margin: 0 0 3px;
}

.strow p {
  font-size: 12.5px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

.strow:focus-visible {
  outline: 2px solid var(--color-accent-orange);
  outline-offset: 2px;
}

.as-panel {
  flex-shrink: 0;
  width: 340px;
  height: 300px;
  border-radius: 22px;
  background: #FAFAF8;
  border: 1px solid #eee;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.as-panel .blob {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(247, 136, 80, 0.14), transparent 70%);
  pointer-events: none;
}

.pane {
  display: none;
  width: 100%;
}

.pane.on {
  display: block;
  animation: app-step-pane-fadein 0.35s ease;
}

@keyframes app-step-pane-fadein {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.apply-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 auto 18px;
}

/* Security */

.app-security__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--header-to-content);
}

.app-security__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--card-padding);
  background: #fff;
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border-light);
}

.app-security__title {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-text-dark);
}

.app-security__desc {
  font-size: 14px;
  line-height: var(--app-body-lh);
  color: var(--color-text-muted);
}

.app-security__desc a {
  color: var(--color-accent-blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Final CTA */

.app-cta {
  text-align: center;
}

.app-cta .h2 {
  color: #fff;
  margin-bottom: var(--space-4);
}

.app-cta .section-sub {
  color: rgba(255, 255, 255, 0.92);
  max-width: 480px;
  margin: 0 auto var(--space-6);
}

.app-cta .app-badge-link {
  display: inline-block;
}

/* Animations */

@keyframes glow-drift {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes float-card {
  0%, 100% { transform: rotate(6deg) translateY(0); }
  50% { transform: rotate(6deg) translateY(-10px); }
}

.app-float-card--gap {
  animation-name: float-card-gap;
}

@keyframes float-card-gap {
  0%, 100% { transform: rotate(-8deg) translateY(0); }
  50% { transform: rotate(-8deg) translateY(-10px); }
}

@keyframes offer-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-feature__phone .phone-frame {
  animation: float-subtle 6s ease-in-out infinite;
}

.app-feature--planner .phone-frame {
  animation-delay: 0.6s;
}

@keyframes float-subtle {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(-3deg) translateY(-8px); }
}

/* Responsive */

@media (max-width: 1024px) {
  .app-hero__grid,
  .app-feature__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .app-feature__grid--reverse .app-feature__copy,
  .app-feature__grid--reverse .app-feature__phone {
    order: unset;
  }

  .app-hero__content,
  .app-feature__copy {
    max-width: 100%;
    margin: 0 auto;
  }

  .app-feature__lead {
    margin-left: auto;
    margin-right: auto;
  }

  .app-feature__list li {
    text-align: left;
  }

  .app-hero__badge-wrap {
    align-items: center;
  }

  .app-steps {
    padding: 84px 32px;
  }

  .as-grid {
    flex-direction: column;
  }

  .as-panel {
    width: 100%;
    max-width: 340px;
  }

  .app-security__grid {
    grid-template-columns: 1fr;
  }

  .app-numbers__grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

@media (max-width: 600px) {
  .app-page {
    --app-section-y: 56px;
    --app-hero-y: 56px;
  }

  .app-float-card--offer { right: -4%; font-size: 10px; }
  .app-float-card--gap { left: -4%; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-hero-glow,
  .app-float-card,
  .app-feature__phone .phone-frame {
    animation: none !important;
  }

  .pane.on { animation: none; }

  .app-hero-phone-wrap {
    transform: rotate(-6deg);
  }

  .app-hero-phone--offers .app-hero-offer {
    animation: none;
  }
}
