/* ============================================================================
   AIDO Apps — Landing template stylesheet
   Design tokens taken from Presupusta DESIGN.md (Forge & Field, light mode).
   To re-skin per app, only the :root accent variables usually need changing.
   ========================================================================== */

:root {
  /* ---- APP DATA: brand accents (Hipoteca Clara) ---- */
  --primary: #007AFF;
  --primary-container: #2A90FF;
  --secondary: #BA7517;
  --secondary-dark: #9C620F;

  /* ---- Neutrals (shared) ---- */
  --surface: #F9F9FF;
  --surface-low: #F0F3FF;
  --surface-container: #E7EEFF;
  --on-surface: #111C2D;
  --on-surface-variant: #424754;
  --outline: #727785;
  --outline-variant: #C2C6D6;
  --tertiary: #1FA671;       /* positive / accepted */
  --error: #BA1A1A;
  --white: #FFFFFF;

  /* ---- Scale ---- */
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --maxw: 1120px;
  --shadow-sm: 0 1px 2px rgba(17, 28, 45, .06), 0 4px 16px rgba(17, 28, 45, .06);
  --shadow-md: 0 8px 30px rgba(17, 28, 45, .12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--on-surface);
  background: var(--surface);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============================ HEADER ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(249, 249, 255, .8);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--outline-variant);
}
.brand { display: inline-flex; align-items: baseline; gap: 4px; font-weight: 800; letter-spacing: -0.03em; }
.brand__mark { color: var(--primary); font-size: 20px; }
.brand__sub { color: var(--on-surface); font-size: 20px; }
.site-nav { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); }
.site-nav a { font-size: 15px; font-weight: 500; color: var(--on-surface-variant); transition: color .15s; }
.site-nav a:hover { color: var(--on-surface); }
.site-nav__cta {
  background: var(--primary);
  color: var(--white) !important;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-weight: 600;
}
.site-nav__cta:hover { background: var(--primary-container); }
@media (max-width: 680px) {
  .site-nav a:not(.site-nav__cta) { display: none; }
}

/* ============================ HERO ============================ */
.hero {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(33,112,228,.12), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(253,118,26,.08), transparent 55%),
    var(--surface);
  padding: clamp(48px, 8vw, 96px) clamp(16px, 4vw, 40px);
}
.hero__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}
.platforms { display: flex; gap: 8px; margin-bottom: 20px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-container);
  color: var(--on-surface-variant);
  font-size: 13px; font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
}
.hero__title {
  font-size: clamp(34px, 5.5vw, 56px);
  font-weight: 800;
}
.hero__title span { color: var(--primary); display: block; }
.hero__lead {
  margin-top: 20px;
  font-size: clamp(16px, 2vw, 19px);
  color: var(--on-surface-variant);
  max-width: 540px;
}

.store-badges { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.store-badges--center { justify-content: center; }
.store-badge {
  display: inline-block;
  border-radius: 9px;
  transition: transform .15s, box-shadow .15s;
}
.store-badge svg { display: block; height: 52px; width: auto; border-radius: 9px; }
.store-badge:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.store-note { margin-top: 14px; font-size: 13px; color: var(--outline); }

/* Hero art: phone with app icon */
.hero__art { display: flex; justify-content: center; }
.phone {
  position: relative;
  width: 260px;
  aspect-ratio: 9 / 19;
  background: #0B1326;
  border-radius: 38px;
  padding: 12px;
  box-shadow: var(--shadow-md), 0 0 0 2px rgba(17,28,45,.04);
}
.phone__notch {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 22px; background: #0B1326; border-radius: var(--radius-full);
  z-index: 2;
}
.phone__screen {
  width: 100%; height: 100%;
  border-radius: 28px;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-container) 60%, #14346b 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px; text-align: center; overflow: hidden;
}
.phone__icon { width: 84px; height: 84px; border-radius: 20px; box-shadow: var(--shadow-md); }
.phone__appname { color: #fff; font-weight: 700; font-size: 22px; margin-top: 6px; }
.phone__appsub { color: rgba(255,255,255,.82); font-size: 13px; }

/* ============================ SECTIONS ============================ */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 104px) clamp(16px, 4vw, 40px);
}
.section__title { font-size: clamp(26px, 4vw, 38px); font-weight: 800; text-align: center; }
.section__lead {
  text-align: center; color: var(--on-surface-variant);
  font-size: 17px; margin: 14px auto 0; max-width: 560px;
}

/* ---- Steps ---- */
.steps__grid {
  list-style: none; padding: 0; margin: 48px 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.step {
  background: var(--white);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-full);
  background: var(--secondary); color: #fff; font-weight: 700; font-size: 16px;
  margin-bottom: 14px;
}
.step h3 { font-size: 17px; font-weight: 700; }
.step p { margin-top: 6px; color: var(--on-surface-variant); font-size: 14px; }

/* ---- Features ---- */
.features { background: var(--surface-low); max-width: none; }
.features > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.features__grid {
  margin-top: 48px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.feature {
  background: var(--white);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform .15s, box-shadow .15s;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: var(--radius-md);
  background: var(--surface-container); color: var(--primary);
  margin-bottom: 16px;
}
.feature h3 { font-size: 18px; font-weight: 700; }
.feature p { margin-top: 8px; color: var(--on-surface-variant); font-size: 15px; }

.states {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  margin-top: 44px;
}
.state {
  font-size: 13px; font-weight: 600; padding: 7px 16px;
  border-radius: var(--radius-full); border: 1px solid transparent;
}
.state--draft { background: #EEF0F4; color: var(--outline); }
.state--sent { background: rgba(0,88,190,.10); color: var(--primary); }
.state--accepted { background: rgba(31,166,113,.12); color: var(--tertiary); }
.state--rejected { background: rgba(186,26,26,.10); color: var(--error); }

/* ---- Screenshots ---- */
.screens__row {
  margin-top: 52px;
  display: flex; justify-content: center; flex-wrap: wrap; gap: clamp(20px, 4vw, 44px);
}
.phone--shot { width: 240px; margin: 0; }
.phone__screen--placeholder { background: var(--surface-container); position: relative; }
.phone__screen--placeholder img { width: 100%; height: 100%; object-fit: cover; border-radius: 28px; }
.placeholder-label {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: var(--primary); font-weight: 600; font-size: 14px;
  background: rgba(255,255,255,.9); padding: 6px 14px; border-radius: var(--radius-full);
  display: none;
}
.phone__screen--placeholder.is-empty .placeholder-label { display: inline-block; }

/* ---- Pricing ---- */
.pricing__grid {
  margin-top: 48px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.plan {
  position: relative;
  background: var(--white);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex; flex-direction: column;
}
.plan--featured { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow-md); }
.plan__badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--secondary); color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 14px; border-radius: var(--radius-full); white-space: nowrap;
}
.plan__name { font-size: 16px; font-weight: 700; color: var(--on-surface-variant); }
.plan__price { font-size: 30px; font-weight: 800; margin: 10px 0 18px; }
.plan__price span { font-size: 15px; font-weight: 500; color: var(--outline); }
.plan__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.plan__list li { position: relative; padding-left: 26px; font-size: 14.5px; color: var(--on-surface-variant); }
.plan__list li::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 16px; height: 16px; border-radius: var(--radius-full);
  background: var(--tertiary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/14px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/14px no-repeat;
}
.plan__list li.muted { color: var(--outline); }
.plan__list li.muted::before { background: var(--outline); }

/* ---- Final CTA ---- */
.cta-final {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-container) 100%);
  color: #fff;
  text-align: center;
  padding: clamp(56px, 9vw, 96px) clamp(16px, 4vw, 40px);
}
.cta-final h2 {
  font-size: clamp(24px, 4vw, 36px); font-weight: 800;
  max-width: 680px; margin: 0 auto 32px;
}

/* ============================ FOOTER ============================ */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px clamp(16px, 4vw, 40px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--outline-variant);
}
.site-footer__brand p { color: var(--on-surface-variant); font-size: 14px; margin-top: 6px; }
.site-footer__links { display: flex; gap: 24px; }
.site-footer__links a { color: var(--on-surface-variant); font-size: 14px; font-weight: 500; }
.site-footer__links a:hover { color: var(--primary); }
.site-footer__copy { width: 100%; color: var(--outline); font-size: 13px; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__copy { display: flex; flex-direction: column; align-items: center; }
  .hero__art { order: -1; }
  .store-badges { justify-content: center; }
  .steps__grid { grid-template-columns: repeat(2, 1fr); }
  .features__grid { grid-template-columns: repeat(2, 1fr); }
  .pricing__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .steps__grid, .features__grid, .pricing__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---- Hipoteca Clara: single free plan + disclaimer ---- */
.pricing__grid--single { grid-template-columns: minmax(0, 440px); justify-content: center; }
.disclaimer-note { text-align: center; color: var(--outline); font-size: 13px; max-width: 640px; margin: 28px auto 0; }

/* Screenshot device frame: match real screenshot ratio (no crop) */
.phone--shot { width: 232px; aspect-ratio: 780 / 1688; padding: 9px; border-radius: 30px; }
.phone--shot .phone__notch { display: none; }
.phone--shot .phone__screen { border-radius: 22px; }
.phone--shot .phone__screen--placeholder img { border-radius: 22px; }


/* Screenshot frame v2 - image defines size, ZERO crop (validated on Presupusta) */
.phone--shot { width: 232px; aspect-ratio: auto; height: auto; padding: 8px; border-radius: 30px; background: #0b1326; }
.phone--shot .phone__notch { display: none; }
.phone--shot .phone__screen { height: auto; aspect-ratio: auto; display: block; padding: 0; background: transparent; border-radius: 22px; overflow: hidden; }
.phone--shot .phone__screen--placeholder img { width: 100%; height: auto; display: block; object-fit: fill; border-radius: 22px; }
/* Empty placeholder (no screenshot yet): keep a phone-shaped card */
.phone--shot .phone__screen--placeholder.is-empty { aspect-ratio: 9 / 19; display: flex; align-items: center; justify-content: center; background: var(--surface-container); }
