/* Aleota Finance: components.
   Requires tokens/tokens.css and styles/base.css. One block per component;
   class names match the files in components/. */

/* =========================================================
   Button
   ========================================================= */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--color-text);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;                       /* comfortable touch target */
  padding: 0 var(--space-5);
  border: 2px solid var(--btn-border);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: var(--font-weight-bold);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary {
  --btn-bg: var(--color-accent);
  --btn-fg: var(--color-on-accent);
  box-shadow: 0 6px 16px var(--color-accent-glow);
}
.btn--primary:hover { --btn-bg: var(--color-accent-hover); }

.btn--secondary {
  --btn-bg: var(--color-surface);
  --btn-fg: var(--color-text);
  --btn-border: var(--color-text);
}
.btn--secondary:hover { --btn-bg: var(--color-bg-alt); }

.btn--ghost { --btn-fg: var(--color-text); padding-inline: var(--space-3); }
.btn--ghost:hover { --btn-bg: var(--color-bg-alt); }

.btn--on-dark {
  --btn-bg: transparent;
  --btn-fg: var(--color-text-on-dark);
  --btn-border: rgb(255 255 255 / 0.4);
}
.btn--on-dark:hover { --btn-bg: rgb(255 255 255 / 0.08); }

.btn--lg { min-height: 56px; padding-inline: var(--space-6); font-size: var(--text-lg); }
.btn--sm { min-height: 40px; padding-inline: var(--space-4); font-size: var(--text-sm); }
.btn--block { width: 100%; }

/* =========================================================
   Nav
   ========================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-nav-bg);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: 72px;
}
.nav__links {
  display: flex;
  gap: var(--space-5);
  list-style: none;
  padding: 0;
  margin: 0;
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-sm);
}
.nav__links a { text-decoration: none; color: var(--color-text-secondary); }
.nav__links a:hover { color: var(--color-text); }
.nav__actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.nav__phone {
  font-weight: var(--font-weight-bold);
  font-size: var(--text-sm);
  text-decoration: none;
  white-space: nowrap;
}
.nav__menu { display: none; }

@media (max-width: 900px) {
  .nav__links, .nav__phone { display: none; }
  .nav__menu { display: inline-flex; }
}
@media (max-width: 420px) {
  .nav__actions .btn--primary { display: none; }
}

/* Logo: gable icon (inline SVG) + wordmark set in Sora.
   Built in HTML rather than <img src="lockup.svg"> because the supplied
   lockup SVGs use live <text>, which can't load Sora inside an <img>. */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  text-decoration: none;
  color: var(--color-text);
  font-size: 1rem;           /* scale the whole logo with font-size */
}
.logo__icon { width: 2.1em; height: auto; flex: none; }
.logo__roof { fill: var(--palette-navy); }
.logo__door { fill: var(--palette-teal); }
.logo__text { display: grid; line-height: 1; font-family: var(--font-display); }
.logo__name { font-weight: 700; font-size: 1.5em; letter-spacing: 0.02em; }
.logo__sub {
  font-weight: 400;
  font-size: 0.72em;
  letter-spacing: 0.5em;
  margin-top: 0.35em;
  color: var(--palette-teal-brand);
}
.on-dark .logo { color: var(--color-text-on-dark); }
.on-dark .logo__roof { fill: var(--palette-white); }
.on-dark .logo__door { fill: var(--palette-teal-bright); }
.on-dark .logo__sub { color: var(--palette-teal-bright); }
.logo--sm { font-size: 0.85rem; }
.logo--lg { font-size: 1.4rem; }

/* =========================================================
   Hero (Lendi-style: headline + "what do you want to do?")
   ========================================================= */
.hero { padding-block: clamp(2.5rem, 1rem + 6vw, 5.5rem) var(--section-pad); }
.hero__grid {
  display: grid;
  gap: var(--space-7);
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
}
.hero__copy { display: grid; gap: var(--space-5); }
.hero__question {
  font-weight: var(--font-weight-bold);
  font-size: var(--text-lg);
  margin-top: var(--space-2);
}
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Goal selector: the primary entry point
   ========================================================= */
.goal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.goal-tile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-snug);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.goal-tile:hover {
  border-color: var(--color-text);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.goal-tile__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
}
.goal-tile__icon svg { width: 24px; height: 24px; }
.goal-tile__arrow { margin-left: auto; flex: none; width: 20px; height: 20px; color: var(--color-text-muted); }
.goal-tile small {
  display: block;
  font-weight: var(--font-weight-medium);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.goal-tile--featured { border-color: var(--color-accent); background: var(--color-accent-soft); }
.goal-tile--featured .goal-tile__icon { background: var(--color-surface); }
@media (max-width: 520px) {
  .goal-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Trust strip
   ========================================================= */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  align-items: center;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
}
.trust-strip__item { display: inline-flex; align-items: center; gap: var(--space-2); }
.trust-strip__item svg { width: 18px; height: 18px; color: var(--color-positive); }
.trust-strip--boxed {
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  justify-content: space-around;
}

.stars { display: inline-flex; gap: 2px; color: var(--palette-star); }
.stars svg { width: 16px; height: 16px; }

/* =========================================================
   Broker card (hero side + "meet your broker")
   ========================================================= */
.broker-card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.broker-card__photo {
  aspect-ratio: 4 / 3.4;
  background:
    radial-gradient(120% 90% at 80% 10%, var(--color-accent-soft), transparent 60%),
    linear-gradient(160deg, var(--color-bg-alt), var(--palette-line));
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
}
.broker-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.broker-card__body { padding: var(--space-5); display: grid; gap: var(--space-2); }
.broker-card__name { font-size: var(--text-lg); font-weight: var(--font-weight-bold); }
.broker-card__status {
  position: absolute;
  top: var(--space-4); left: var(--space-4);
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  box-shadow: var(--shadow-sm);
}
.broker-card__status::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-positive);
  box-shadow: 0 0 0 3px var(--color-positive-soft);
}

/* =========================================================
   Steps ("How it works")
   ========================================================= */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5);
  counter-reset: step;
  list-style: none;
  padding: 0;
}
.step {
  position: relative;
  display: grid;
  gap: var(--space-2);
  align-content: start;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  font-family: var(--font-display);
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-bottom: var(--space-2);
  border-radius: 50%;
  background: var(--color-surface-dark);
  color: var(--color-text-on-dark);
  font-weight: var(--font-weight-extrabold);
}
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 56px;
  right: calc(-1 * var(--space-5) + 12px);
  border-top: 2px dashed var(--palette-line);
}
.step__title { font-weight: var(--font-weight-bold); font-size: var(--text-lg); }
.step__time {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-positive);
}
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .step::after { display: none; }
}
@media (max-width: 480px) {
  .steps { grid-template-columns: 1fr; }
}

/* =========================================================
   Card (generic) + feature card
   ========================================================= */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: grid;
  gap: var(--space-3);
  align-content: start;
}
.card--raised { border-color: transparent; box-shadow: var(--shadow-md); }
.card.on-dark { background: var(--color-surface-dark); border-color: transparent; }
.feature-card__icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  color: var(--color-accent-text);
  margin-bottom: var(--space-2);
}
.feature-card__icon svg { width: 26px; height: 26px; }

/* =========================================================
   Calculator card (borrowing power)
   ========================================================= */
.calc {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.calc__inputs { padding: var(--space-6); display: grid; gap: var(--space-5); }
.calc__result {
  padding: var(--space-6);
  background: var(--color-surface-dark);
  color: var(--color-text-on-dark);
  display: grid;
  gap: var(--space-4);
  align-content: center;
}
.calc__figure {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.25rem);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: var(--tracking-tight);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.calc__range { font-size: var(--text-sm); color: var(--color-text-muted-on-dark); }
.calc__note { font-size: var(--text-xs); color: var(--color-text-muted-on-dark); }
@media (max-width: 820px) {
  .calc { grid-template-columns: 1fr; }
}

/* Form field */
.field { display: grid; gap: var(--space-2); }
.field__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.field__label { font-weight: var(--font-weight-semibold); font-size: var(--text-sm); }
.field__value { font-weight: var(--font-weight-bold); font-variant-numeric: tabular-nums; }
.field__hint { font-size: var(--text-xs); color: var(--color-text-muted); }

.input {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--space-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-lg);   /* >=16px stops iOS zoom */
}
.input:focus { outline: none; border-color: var(--color-text); }

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(var(--color-accent), var(--color-accent)) 0 / var(--fill, 50%) 100% no-repeat,
              var(--color-bg-alt);
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 3px solid var(--color-text);
  box-shadow: var(--shadow-sm);
}
.range::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 3px solid var(--color-text);
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--color-bg-alt);
  border-radius: var(--radius-pill);
}
.segmented button {
  min-height: 40px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  cursor: pointer;
}
.segmented button[aria-pressed="true"] {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

/* =========================================================
   Pill / badge
   ========================================================= */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
}
.pill--positive { background: var(--color-positive-soft); color: var(--color-positive); }
.pill--accent { background: var(--color-accent-soft); color: var(--color-accent-text); }

/* =========================================================
   Review card
   ========================================================= */
.review-card { gap: var(--space-4); }
.review-card blockquote { font-size: var(--text-lg); line-height: var(--leading-snug); font-weight: var(--font-weight-medium); }
.review-card__who { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.review-card__avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-accent-soft);
  color: var(--color-accent-text);
  font-weight: var(--font-weight-bold);
}

/* =========================================================
   Lender strip
   ========================================================= */
.lender-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-3);
}
.lender-strip__logo {
  display: grid;
  place-items: center;
  min-height: 64px;
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-muted);
  filter: grayscale(1);
}
.lender-strip__logo img { max-height: 28px; width: auto; }

/* =========================================================
   Guide card
   ========================================================= */
.guide-card {
  display: grid;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}
.guide-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.guide-card__art {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--color-accent-soft), var(--color-bg-alt));
}
.guide-card__art--teal { background: linear-gradient(135deg, var(--color-positive-soft), var(--color-bg-alt)); }
.guide-card__art--ink { background: linear-gradient(135deg, var(--palette-navy-soft), var(--palette-navy)); }
.guide-card__body { padding: var(--space-5); display: grid; gap: var(--space-2); }
.guide-card__title { font-weight: var(--font-weight-bold); font-size: var(--text-lg); line-height: var(--leading-snug); }

/* =========================================================
   CTA band
   ========================================================= */
.cta-band {
  background: var(--color-surface-dark);
  color: var(--color-text-on-dark);
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 1rem + 4vw, 4rem);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-6);
  align-items: center;
  position: relative;
  overflow: hidden;
}
.cta-band::after {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-accent-glow), transparent 70%);
  pointer-events: none;
}
.cta-band__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); position: relative; z-index: 1; }
@media (max-width: 760px) {
  .cta-band { grid-template-columns: 1fr; }
}

/* =========================================================
   Footer (contains required compliance details)
   ========================================================= */
.footer { padding-block: var(--space-8) var(--space-6); font-size: var(--text-sm); }
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--space-6);
}
.footer h4 {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-muted-on-dark);
  margin-bottom: var(--space-3);
}
.footer ul { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
.footer a { text-decoration: none; color: var(--color-text-on-dark); opacity: 0.9; }
.footer a:hover { opacity: 1; text-decoration: underline; }
.footer__legal {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid rgb(255 255 255 / 0.12);
  display: grid;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted-on-dark);
}
@media (max-width: 760px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   Sticky mobile CTA (shows on small screens only)
   ========================================================= */
.mobile-cta {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 60;
  padding: var(--space-3) var(--gutter) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -6px 20px rgb(11 31 58 / 0.08);
  gap: var(--space-2);
}
@media (max-width: 640px) {
  .mobile-cta { display: grid; grid-template-columns: auto 1fr; }
  body.has-mobile-cta { padding-bottom: 84px; }
}
