:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-soft: #f6f3ec;
  --brand: #223f60;
  --brand-dark: #1a3452;
  --brand-2: #42617e;
  --accent: #b95f3f;
  --text: #17232f;
  --muted: #657384;
  --line: #d8e0e8;
  --line-strong: #c7d2de;
  --success-bg: #e9f5ef;
  --success-text: #1f5b3e;
  --error-bg: #f8e9ea;
  --error-text: #8b2930;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

#quemsomos,
#seguros,
#anossaaposta,
#contactos,
#formulario-contacto {
  scroll-margin-top: 96px;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.container {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
}

.topbar {
  background: var(--brand-dark);
  color: white;
  font-size: 0.95rem;
}

.topbar-item {
  display: grid;
  gap: 6px;
  align-content: start;
}

.topbar-label {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.topbar a {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}

.topbar .container {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 12px 0;
  flex-wrap: wrap;
}

header {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  display: block;
  width: auto;
  height: 74px;
  max-width: 100%;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

h1,
h2,
h3 {
  font-family: "IBM Plex Serif", serif;
  text-wrap: balance;
}

.brand strong,
.brand-name {
  display: block;
  color: var(--brand);
  font-size: 1.8rem;
  font-weight: 600;
}

.brand span,
.brand-subtitle {
  color: var(--muted);
}

.main-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--brand);
  background: rgba(34, 63, 96, 0.08);
}

.hero {
  background:
    radial-gradient(circle at top right, rgba(185, 95, 63, 0.14), transparent 30%),
    linear-gradient(180deg, #f8fbfe, #edf2f7);
  padding: 28px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 32px;
  align-items: center;
}

.hero-copy {
  max-width: 38rem;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(34, 63, 96, 0.14);
  background: rgba(255, 255, 255, 0.8);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumbs a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.08;
  color: var(--brand);
  max-width: 11ch;
}

p {
  margin: 0 0 16px;
  line-height: 1.78;
  color: var(--muted);
  font-size: 1.03rem;
  text-wrap: pretty;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 700;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--brand);
  color: white;
}

.btn-secondary {
  background: white;
  color: var(--brand);
  border: 1px solid var(--line);
}

.hero figure {
  margin: 0;
}

.hero-visual {
  min-width: 0;
}

.hero img {
  width: 100%;
  display: block;
  aspect-ratio: 6 / 5;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 40px rgba(23, 35, 47, 0.08);
}

.band {
  background: var(--brand);
  color: white;
  padding: 18px 0;
}

.band .container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.band strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.band span {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.55;
}

.section {
  padding: 52px 0;
}

.section.alt {
  background: white;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 760px;
  margin-bottom: 26px;
}

h2 {
  margin: 0 0 12px;
  font-size: 2rem;
  color: var(--brand);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
}

.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.service-card,
.faq-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 14px 30px rgba(23, 35, 47, 0.06);
}

h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  color: var(--brand);
}

.services ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.service-card p,
.faq-card p {
  margin: 0;
}

.service-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.faq-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.contact-strip {
  background: var(--brand);
  color: white;
  padding: 36px 0 44px;
}

.contact-strip .container {
  display: grid;
  gap: 28px;
}

.contact-strip h3 {
  color: white;
  font-size: 1.15rem;
}

.contact-card {
  padding: 22px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-strip p,
.contact-strip a {
  color: rgba(255, 255, 255, 0.86);
}

.contact-form-shell {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: start;
  padding: 32px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.contact-form-copy {
  max-width: 34rem;
}

.contact-form-copy h3 {
  margin-bottom: 12px;
}

.contact-form-copy p {
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0;
}

.contact-form-intro {
  display: none;
}

.contact-form-intro h3 {
  margin-bottom: 10px;
}

.contact-form-intro p {
  margin-bottom: 0;
}

.contact-form {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 18px;
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: 0 18px 36px rgba(13, 27, 43, 0.16);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.contact-form label {
  display: grid;
  gap: 8px;
}

.contact-form label span {
  color: var(--brand);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fffdfa;
  padding: 14px 15px;
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  appearance: none;
}

.contact-form textarea {
  resize: vertical;
  min-height: 170px;
}

.contact-form select {
  cursor: pointer;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #8a96a4;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(66, 97, 126, 0.14);
  background: #ffffff;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
}

.form-security {
  display: flex;
  justify-content: flex-start;
}

.form-security .cf-turnstile {
  max-width: 100%;
}

.contact-form .btn-primary {
  border: 0;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(26, 52, 82, 0.18);
}

.contact-form .btn-primary[disabled] {
  opacity: 0.72;
  cursor: wait;
}

.form-status {
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.96rem;
  line-height: 1.6;
}

.form-status strong {
  display: block;
  margin-bottom: 4px;
}

.form-status ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.form-status-success {
  background: var(--success-bg);
  color: var(--success-text);
}

.form-status-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 720px) {
  .brand img {
    height: 60px;
  }
}

.contact-strip a {
  text-decoration: none;
  font-weight: 700;
}

.footer {
  padding: 18px 0 32px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

@media (max-width: 920px) {
  .hero-grid,
  .two-col,
  .contact-form-shell,
  .contact-grid,
  .services,
  .faq-list {
    grid-template-columns: 1fr;
  }

  .band .container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
  }

  .main-nav a {
    background: rgba(34, 63, 96, 0.06);
  }

  .two-col {
    gap: 20px;
  }

  .section .two-col > div {
    padding: 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
  }

  .section.alt .two-col > div {
    background: #f8fafc;
  }

  .service-card,
  .faq-card {
    padding: 20px 18px;
    border-radius: 22px;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(1180px, calc(100vw - 24px));
  }

  .topbar {
    display: none;
  }

  .contact-form-shell {
    padding: 0;
    gap: 22px;
    border-radius: 0;
    background: transparent;
    border: 0;
  }

  .contact-form {
    width: min(100%, 22rem);
    margin: 0 auto;
    gap: 16px;
    padding: 18px 16px 16px;
    border-radius: 26px;
    background:
      radial-gradient(circle at top left, rgba(246, 243, 236, 0.92), transparent 52%),
      linear-gradient(180deg, #fdfcfa 0%, #f5f2eb 100%);
    border: 1px solid rgba(216, 224, 232, 0.72);
    box-shadow: 0 16px 34px rgba(10, 25, 43, 0.22);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions .btn {
    width: 100%;
    text-align: center;
  }

  header {
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 8px 20px rgba(23, 35, 47, 0.08);
  }

  .header-row {
    position: relative;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
  }

  .brand {
    width: auto;
    justify-content: flex-start;
  }

  .brand img {
    height: 44px;
  }

  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    flex-shrink: 0;
  }

  body.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  body.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--line);
    box-shadow: 0 18px 36px rgba(23, 35, 47, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
  }

  body.nav-open .main-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .main-nav a {
    width: 100%;
    min-height: 48px;
    justify-content: flex-start;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.25;
    background: rgba(34, 63, 96, 0.05);
  }

  h1 {
    max-width: 8ch;
    margin-bottom: 0;
    font-size: clamp(2.65rem, 13vw, 4.1rem);
    line-height: 0.94;
    color: white;
    text-shadow: 0 3px 18px rgba(10, 18, 28, 0.4);
  }

  p {
    font-size: 0.98rem;
    line-height: 1.7;
  }

  .hero {
    background: #ffffff;
    padding: 0 0 26px;
  }

  .hero .container {
    width: 100%;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
  }

  .hero-copy {
    max-width: none;
    margin-top: 0;
    padding: 0 16px;
  }

  .hero-visual {
    position: relative;
    order: -1;
  }

  .hero img {
    aspect-ratio: 0.88;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .hero-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 22, 38, 0.08) 14%, rgba(9, 22, 38, 0.54) 72%, rgba(9, 22, 38, 0.08) 100%);
  }

  .eyebrow {
    display: none;
  }

  .hero-copy p {
    display: none;
  }

  .hero-copy h1 {
    position: relative;
    z-index: 1;
    margin-top: -12rem;
    margin-bottom: 10.25rem;
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 1.5rem;
    padding: 0;
  }

  .actions .btn {
    width: 100%;
    min-height: 58px;
    border-radius: 14px;
    font-size: 1rem;
    box-shadow: 0 10px 24px rgba(23, 35, 47, 0.08);
  }

  .btn-primary {
    box-shadow: 0 12px 24px rgba(26, 52, 82, 0.22);
  }

  .band {
    background: linear-gradient(180deg, #f8f5ef 0%, #eef2f6 100%);
    padding: 14px 0 24px;
  }

  .band .container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .stat-card {
    min-height: 9.5rem;
    padding: 20px 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, #2b4d75 0%, #223f60 100%);
    border: 0;
    box-shadow: 0 14px 26px rgba(26, 52, 82, 0.18);
  }

  .band strong {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }

  .band span {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .section {
    padding: 38px 0;
    background: #ffffff;
  }

  .section-head {
    margin-bottom: 18px;
  }

  h2 {
    margin-bottom: 10px;
    font-size: clamp(1.7rem, 6.4vw, 2.15rem);
  }

  .section .two-col > div {
    padding: 20px 18px;
    border-radius: 22px;
  }

  .section .two-col {
    gap: 18px;
    padding: 20px 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
  }

  .section.alt .two-col {
    background: #f8fafc;
  }

  .section .two-col > div {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .section .two-col > div + div {
    padding-top: 18px;
    border-top: 1px solid rgba(141, 160, 179, 0.24);
  }

  .contact-grid {
    gap: 18px;
  }

  .contact-strip {
    background:
      radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 32%),
      linear-gradient(180deg, #17324f 0%, #1f4164 100%);
    padding: 34px 0 36px;
  }

  .contact-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .contact-card h3 {
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.84rem;
    letter-spacing: 0.04em;
  }

  .contact-card p,
  .contact-card a {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.05rem;
    line-height: 1.35;
  }

  .contact-form-copy {
    display: none;
  }

  .contact-form-intro {
    display: grid;
    gap: 10px;
  }

  .contact-form-intro h3 {
    color: var(--brand);
    font-size: clamp(2rem, 10vw, 2.6rem);
    line-height: 0.95;
  }

  .contact-form-intro p {
    font-size: 0.98rem;
    line-height: 1.45;
    color: var(--muted);
  }

  .contact-form label span {
    font-size: 0.95rem;
  }

  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    border-color: #8ea0b3;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    padding: 13px 14px;
    box-shadow: inset 0 1px 2px rgba(23, 35, 47, 0.03);
  }

  .contact-form textarea {
    min-height: 112px;
  }

  .contact-form .btn-primary {
    min-height: 54px;
    border-radius: 12px;
    box-shadow: 0 12px 22px rgba(26, 52, 82, 0.18);
  }
}

@media (max-width: 480px) {
  .container {
    width: min(1180px, calc(100vw - 20px));
  }

  .brand img {
    height: 40px;
  }

  .main-nav a {
    font-size: 0.92rem;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.35rem, 13vw, 3.45rem);
  }

  .hero-copy {
    padding: 0 14px;
  }

  .hero-copy h1 {
    margin-top: -10.75rem;
    margin-bottom: 9.25rem;
  }

  #quemsomos,
  #anossaaposta,
  #contactos,
  #formulario-contacto {
    scroll-margin-top: 84px;
  }

  .actions {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .band .container {
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-height: auto;
  }

  .contact-form {
    padding: 18px 14px 14px;
  }

  .contact-form-intro h3 {
    font-size: 2.1rem;
  }

  .contact-form input,
  .contact-form select,
  .contact-form textarea {
    font-size: 16px;
  }
}
