:root {
  --brand-name: "Apps a Medida";
  --bg: #F8FAFC;
  --text: #0F172A;
  --muted: #475569;
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --accent: #DBEAFE;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --green: #0F766E;
  --amber: #B45309;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.09);
  --radius: 8px;
  --max-width: 1120px;
  --logo-size: clamp(92px, 12vw, 176px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: calc(var(--max-width) + 48px);
  margin: 0 auto;
  padding: 14px 24px;
  background: rgba(248, 250, 252, 0.88);
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand__mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font-weight: 800;
}

.brand__logo {
  display: block;
  width: var(--logo-size);
  height: var(--logo-size);
  max-width: var(--logo-size);
  max-height: var(--logo-size);
  object-fit: contain;
  flex: 0 0 var(--logo-size);
}

.brand__name,
.brand__tagline {
  display: block;
}

.brand__name {
  font-weight: 800;
  line-height: 1.1;
}

.brand__tagline {
  color: var(--muted);
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-weight: 600;
}

.nav-action {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.language-switcher {
  display: flex;
  gap: 6px;
}

.language-switcher__button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.language-switcher__button:hover,
.language-switcher__button:focus-visible,
.language-switcher__button.is-active {
  border-color: var(--border);
  background: #fff;
  transform: translateY(-1px);
}

.language-switcher__button.is-active {
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.flag {
  display: block;
  width: 18px;
  height: 13px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.flag--cat {
  background: repeating-linear-gradient(
    to bottom,
    #FCD34D 0,
    #FCD34D 2px,
    #B91C1C 2px,
    #B91C1C 4px
  );
}

.site-nav a:not(.button):hover,
.site-nav a:not(.button):focus-visible {
  color: var(--primary);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 92px 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: 54px;
  min-height: calc(100vh - 72px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: clamp(2.45rem, 6vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.08rem;
  line-height: 1.25;
}

.hero__lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.14rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 20px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover,
.button:focus-visible {
  background: var(--primary-dark);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.22);
  transform: translateY(-2px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.button--secondary {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

.button--secondary:hover,
.button--secondary:focus-visible {
  background: #EEF2FF;
  color: var(--primary-dark);
}

.button--small {
  min-height: 40px;
  padding: 9px 14px;
  color: #fff;
  font-size: 0.9rem;
}

.button--light {
  background: #fff;
  color: var(--primary-dark);
  border-color: #fff;
}

.app-mockup {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.app-mockup__topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: #0F172A;
  color: #fff;
}

.app-mockup__topbar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94A3B8;
}

.app-mockup__topbar span:first-child {
  background: #F97316;
}

.app-mockup__topbar span:nth-child(2) {
  background: #FBBF24;
}

.app-mockup__topbar span:nth-child(3) {
  background: #14B8A6;
}

.app-mockup__topbar strong {
  margin-left: auto;
  font-size: 0.82rem;
}

.app-mockup__body {
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 430px;
}

.mock-menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 18px;
  background: #F1F5F9;
}

.mock-menu span {
  height: 34px;
  border-radius: var(--radius);
  background: #CBD5E1;
}

.mock-menu .mock-menu__active {
  background: var(--primary);
}

.mock-content {
  padding: 24px;
}

.mock-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.mock-header small,
.mock-header strong {
  display: block;
}

.mock-header small {
  color: var(--muted);
}

.mock-header strong {
  font-size: 2.1rem;
  line-height: 1;
}

.mock-header button {
  align-self: start;
  border: 0;
  border-radius: var(--radius);
  background: var(--green);
  color: #fff;
  font-weight: 800;
  padding: 10px 13px;
}

.mock-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
}

.mock-card {
  min-height: 138px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.mock-card--wide {
  grid-row: span 2;
}

.mock-card__title {
  margin-bottom: 18px;
  font-size: 0.84rem;
  font-weight: 800;
}

.mock-card--wide span {
  display: block;
  height: 16px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #ECFDF5 72%, transparent 72%);
}

.status-line {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  margin: 14px 0;
}

.status-line b {
  border-radius: 999px;
  background: var(--amber);
}

.status-line i {
  height: 14px;
  border-radius: 999px;
  background: #E2E8F0;
}

.mock-chart {
  display: flex;
  align-items: end;
  gap: 12px;
}

.mock-chart div {
  width: 20%;
  border-radius: 6px 6px 0 0;
  background: var(--primary);
}

.mock-chart div:nth-child(1) { height: 48%; }
.mock-chart div:nth-child(2) { height: 72%; background: var(--green); }
.mock-chart div:nth-child(3) { height: 40%; background: var(--amber); }
.mock-chart div:nth-child(4) { height: 86%; }

.section--soft {
  max-width: none;
  background: #EFF6FF;
}

.section--soft > * {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 38px;
}

.section-heading p:not(.eyebrow),
.why-copy p,
.section-note {
  color: var(--muted);
}

.card-grid {
  display: grid;
  gap: 20px;
}

.card-grid--four {
  grid-template-columns: repeat(4, 1fr);
}

.card-grid--three {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid--two {
  grid-template-columns: repeat(2, 1fr);
}

.problem-card,
.service-card,
.example-card,
.timeline__item,
.faq-item,
.contact-form,
.direct-contact {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.problem-card,
.service-card,
.example-card {
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.problem-card:hover,
.service-card:hover,
.example-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.problem-card p,
.service-card p,
.example-card p,
.timeline__item p {
  color: var(--muted);
  margin-bottom: 0;
}

.faq-list {
  display: grid;
  gap: 16px;
}

.faq-item {
  padding: 24px;
}

.faq-item p {
  color: var(--muted);
  margin-bottom: 0;
}

.icon {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.service-card:nth-child(2) .icon,
.problem-card:nth-child(4) .icon {
  background: #CCFBF1;
  color: #0F766E;
}

.service-card:nth-child(3) .icon,
.problem-card:nth-child(3) .icon {
  background: #FEF3C7;
  color: #B45309;
}

.section-note {
  margin-top: 30px;
  text-align: center;
  font-size: 1.08rem;
  font-weight: 700;
}

.section-action {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.timeline__item {
  position: relative;
  padding: 24px;
}

.timeline__item span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.example-card {
  border-top: 4px solid var(--primary);
}

.section--split {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  align-items: center;
  gap: 48px;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.benefits span {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.benefits span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 10px;
  border-radius: 999px;
  background: var(--green);
}

.cta-section {
  max-width: none;
  margin: 0;
  text-align: center;
  background: #173B8F;
  color: #fff;
}

.cta-section h2,
.cta-section p {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.cta-section p {
  color: #DDEAFE;
  font-size: 1.12rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 24px;
  align-items: start;
}

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 26px;
}

.form-row {
  display: grid;
  gap: 7px;
}

.hidden {
  display: none;
}

.form-row--full,
.contact-form .button,
.form-status {
  grid-column: 1 / -1;
}

label {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 12px 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.form-row.is-invalid input,
.form-row.is-invalid textarea {
  border-color: #DC2626;
}

.error-message {
  min-height: 18px;
  color: #B91C1C;
  font-size: 0.8rem;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--green);
  font-weight: 800;
}

.direct-contact {
  padding: 28px;
}

.direct-contact__emails {
  display: grid;
  gap: 6px;
  margin: 4px 0 18px;
}

.direct-contact__emails a {
  display: inline-block;
  color: var(--primary-dark);
  font-size: 1.08rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.direct-contact p {
  color: var(--muted);
  margin-bottom: 0;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  max-width: calc(var(--max-width) + 48px);
  margin: 0 auto;
  padding: 36px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.site-footer strong {
  color: var(--text);
}

.site-footer p {
  margin: 4px 0 0;
}

.site-footer nav {
  display: flex;
  gap: 18px;
  font-weight: 700;
}

.site-footer nav a:hover,
.site-footer nav a:focus-visible {
  color: var(--primary);
}

.site-footer small {
  grid-column: 1 / -1;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 980px) {
  .hero,
  .section--split,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 66px;
  }

  .card-grid--four,
  .card-grid--three,
  .timeline {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-mockup {
    max-width: 680px;
  }
}

@media (max-width: 760px) {
  :root {
    --logo-size: 78px;
  }

  .site-header {
    padding: 12px 18px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 67px;
    right: 18px;
    left: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 12px;
  }

  .nav-action {
    justify-items: stretch;
    padding: 8px 12px 4px;
  }

  .language-switcher {
    justify-content: center;
  }

  .site-nav .button {
    width: 100%;
  }

  .section {
    padding: 68px 18px;
  }

  .hero {
    gap: 36px;
  }

  h1 {
    font-size: clamp(2.25rem, 13vw, 3.5rem);
  }

  .hero__actions,
  .hero__actions .button {
    width: 100%;
  }

  .app-mockup__body {
    grid-template-columns: 48px 1fr;
    min-height: 360px;
  }

  .mock-content {
    padding: 16px;
  }

  .mock-grid,
  .card-grid--four,
  .card-grid--three,
  .card-grid--two,
  .timeline,
  .benefits,
  .contact-form {
    grid-template-columns: 1fr;
  }

  .mock-card--wide {
    grid-row: auto;
  }

  .form-row--full,
  .contact-form .button,
  .form-status {
    grid-column: auto;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer nav {
    flex-wrap: wrap;
  }
}

@media (max-width: 440px) {
  :root {
    --logo-size: 64px;
  }

  .brand__tagline {
    display: none;
  }

  .mock-header,
  .hero__actions {
    flex-direction: column;
  }

  .mock-header button,
  .button {
    width: 100%;
  }
}
