/**
 * Estilos página: Quiero ser Broker
 * Enfoque visual con gradients, chips y cards
 */

/* HERO */
.broker-hero {
  position: relative;
  background: linear-gradient(135deg, #003d82 0%, #002557 100%);
  color: #ffffff;
  padding: var(--spacing-4xl) var(--spacing-xl);
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  overflow: hidden;
}

.broker-hero__pattern {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
}

.broker-hero__pattern--one {
  background: #ff6b35;
  top: -140px;
  right: -120px;
}

.broker-hero__pattern--two {
  background: #00a86b;
  bottom: -160px;
  left: -120px;
}

.broker-hero__container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 2;
}

.broker-hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--spacing-3xl);
  align-items: center;
  position: relative;
}

.broker-hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--font-size-sm);
  color: var(--color-secondary);
  margin-bottom: var(--spacing-sm);
  font-weight: var(--font-weight-semibold);
}

.broker-hero h1 {
  font-size: clamp(2.5rem, 3vw, 3.6rem);
  line-height: 1.1;
  margin: 0 0 var(--spacing-md);
  font-weight: var(--font-weight-bold);
}

.broker-hero h1 span {
  color: var(--color-secondary);
}

.broker-hero__subtitle {
  margin: 0 0 var(--spacing-xl);
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 660px;
  line-height: 1.6;
}

.broker-hero__chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a568c;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: var(--font-weight-semibold);
  backdrop-filter: blur(8px);
}

.chip--accent {
  background: #1a568c;
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.broker-hero__cta {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.broker-hero__note {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-weight: var(--font-weight-medium);
}

.broker-hero__image-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
  position: relative;
  overflow: visible; /* permitir que la etiqueta salga por arriba */
  height: 460px;
  display: flex;
  align-items: stretch;
}

.broker-hero__image-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit; /* mantener esquinas redondeadas aunque el overflow esté visible */
}

.broker-hero__tag {
  position: absolute;
  top: -48px;
  right: var(--spacing-lg);
  background: #1a568c;
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.broker-hero__floating-card {
  position: absolute;
  left: var(--spacing-lg);
  bottom: var(--spacing-lg);
  background: rgba(0, 21, 49, 0.8);
  color: #fff;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  max-width: 78%;
}

.floating-card__title {
  margin: 0 0 var(--spacing-xs);
  font-weight: var(--font-weight-bold);
  font-size: 1rem;
}

.broker-hero__floating-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.broker-hero__floating-card li {
  position: relative;
  padding-left: 20px;
  font-size: 0.95rem;
}

.broker-hero__floating-card li::before {
  content: "•";
  position: absolute;
  left: 6px;
  color: var(--color-secondary);
  font-size: 1.1rem;
  top: -2px;
}

.broker-hero__image-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.28) 100%);
  pointer-events: none;
}

.broker-hero__stats {
  display: none;
}

.broker-stat {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: var(--spacing-lg);
  border-radius: 14px;
  backdrop-filter: blur(6px);
}

.broker-stat__number {
  display: block;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-secondary);
  margin-bottom: var(--spacing-xs);
}

/* Workflow timeline */
.broker-workflow {
  margin-top: var(--spacing-2xl);
  position: relative;
  padding: var(--spacing-lg) 0;
}

.broker-workflow--section {
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.broker-workflow__line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.28));
  border-radius: 999px;
}

.broker-workflow__steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacing-lg);
}

.workflow-step {
  background: #1a568c;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: var(--spacing-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(6px);
  position: relative;
}

.workflow-step__badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ff6b35;
  color: #fff;
  font-weight: var(--font-weight-bold);
  display: grid;
  place-items: center;
  font-size: 1rem;
  box-shadow: 0 10px 22px rgba(255, 107, 53, 0.35);
  position: absolute;
  left: 50%;
  top: -32px;
  transform: translateX(-50%);
}

.workflow-step__title {
  margin: var(--spacing-md) 0 0;
  text-align: center;
  font-weight: var(--font-weight-semibold);
  color: #ffffff;
}

.workflow-step__list {
  list-style: none;
  margin: var(--spacing-sm) 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  color: #f1f5f9;
  text-align: center;
}

@media (max-width: 900px) {
  .broker-value__grid {
    grid-template-columns: 1fr;
  }
}

.broker-workflow--light .workflow-step {
  background: #ffffff;
  border-color: rgba(0, 61, 130, 0.08);
  box-shadow: 0 16px 40px rgba(0, 61, 130, 0.12);
}

.broker-workflow--light .workflow-step__title {
  color: #0a2e63;
}

.broker-workflow--light .workflow-step__list {
  color: #244a73;
}

.broker-workflow--light .broker-workflow__line {
  background: linear-gradient(90deg, rgba(0, 61, 130, 0.1), rgba(255, 107, 53, 0.15), rgba(0, 61, 130, 0.1));
}

/* Chips flotantes en el hero (reemplazan la lista dentro de la imagen) */
.chip--floating {
  background: #1a568c;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.broker-hero__floating-card {
  display: none;
}

.broker-hero__floating-chips {
  display: none;
}

/* VALOR */
.broker-value {
  background: linear-gradient(180deg, #f9fafb 0%, #eef5ff 100%);
  padding: var(--spacing-4xl) var(--spacing-xl);
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  position: relative;
  overflow: hidden;
}

.broker-value__container {
  max-width: 1200px;
  margin: 0 auto;
}

.broker-value::before,
.broker-value::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  z-index: 0;
}

.broker-value::before {
  background: rgba(0, 61, 130, 0.18);
  top: 12%;
  left: -8%;
}

.broker-value::after {
  background: rgba(255, 107, 53, 0.14);
  bottom: -6%;
  right: -10%;
}

.broker-section-heading .eyebrow {
  color: var(--color-secondary);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--spacing-xs);
}

.broker-section-heading h2 {
  margin: 0 0 var(--spacing-sm);
  font-size: clamp(2rem, 2.6vw, 2.6rem);
  color: var(--color-primary);
}

.broker-heading__description {
  color: var(--color-gray-600);
  max-width: 760px;
  margin-bottom: var(--spacing-2xl);
}

.broker-value__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-xl);
  align-items: stretch;
}

.broker-card {
  background: linear-gradient(135deg, #003d82 0%, #002f66 100%);
  border-radius: 16px;
  padding: var(--spacing-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--spacing-md);
  align-items: start;
  height: 100%;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

/* Both cards share the same blue gradient */

.broker-card__badge {
  color: #fff;
}

.broker-card h3,
.broker-card .broker-list--checks li,
.broker-card .broker-card__hint {
  color: #ffffff;
}

.broker-card:not(.broker-card--primary) h3,
.broker-card:not(.broker-card--primary) .broker-list--checks li,
.broker-card:not(.broker-card--primary) .broker-card__hint {
  color: #ffffff;
}

.broker-card__badge {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--color-secondary);
  color: #fff;
  font-weight: var(--font-weight-bold);
  border-radius: 12px;
  font-size: 1.1rem;
  position: relative;
  overflow: hidden;
}

.broker-card__badge::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.45) 45%, rgba(255,255,255,0) 90%);
  transform: rotate(18deg);
  animation: badge-sheen 3s infinite;
}

@keyframes badge-sheen {
  0% { transform: translateX(-120%) rotate(18deg); }
  50% { transform: translateX(30%) rotate(18deg); }
  100% { transform: translateX(120%) rotate(18deg); }
}

.broker-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08), transparent 45%);
  pointer-events: none;
}

.broker-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.12);
}

.broker-card h3 {
  margin: 0 0 var(--spacing-sm);
  font-size: 1.3rem;
}

.broker-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.broker-list--checks li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  color: #ffffff;
}

.broker-list--checks li::before {
  content: "✔";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-secondary);
  font-weight: var(--font-weight-bold);
}

.broker-list--checks li {
  transition: transform var(--transition-fast);
}

.broker-card:hover .broker-list--checks li {
  transform: translateX(2px);
}

.broker-card:hover .broker-card__badge {
  transform: translateY(-2px);
}

.broker-card__hint {
  margin-top: var(--spacing-sm);
  color: #ffffff;
  font-size: var(--font-size-sm);
}

/* FORMULARIO */
.broker-form-section {
  position: relative;
  background: linear-gradient(135deg, #003d82 0%, #002557 100%);
  color: #ffffff;
  padding: var(--spacing-4xl) var(--spacing-md);
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  overflow: hidden;
}

.broker-form__container {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.broker-form__grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: clamp(20px, 2.4vw, 36px);
  align-items: center;
}

.broker-form__info h2 {
  font-size: clamp(1.8rem, 2.2vw, 2.3rem);
  margin: 0 0 var(--spacing-sm);
}

.broker-form__info {
  max-width: 520px;
}

.broker-form__summary {
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: var(--spacing-lg);
  line-height: 1.6;
}

.broker-form__steps {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-lg);
  display: grid;
  gap: var(--spacing-sm);
}

.broker-form__steps li {
  position: relative;
  padding-left: 26px;
  color: #dfe9ff;
}

.broker-form__steps li::before {
  content: "•";
  position: absolute;
  left: 6px;
  color: var(--color-secondary);
  font-size: 1.4rem;
  top: -2px;
}

.broker-form__legal,
.broker-form__privacy {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  margin-top: var(--spacing-md);
}

.broker-form__link {
  color: var(--color-secondary);
  text-decoration: underline;
}

.broker-form__card {
  background: #ffffff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16);
   width: 100%;
  max-width: 100%;
  margin-left: auto;
  position: relative;
  z-index: 3;
  align-self: start;
  top: 20px;
}

.broker-form__card .form-container {
  box-shadow: none;
  padding: 0;
}

.broker-form__card .form__title,
.broker-form__card .form__description {
  color: var(--color-primary);
}

.broker-form__card .form-field__label {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

.broker-form__privacy {
  background: #f9fafb;
  color: var(--color-gray-700);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-md);
  border: 1px solid var(--color-gray-200);
}

/* Ajustes HubSpot embed para que encaje en la tarjeta */
#broker-hubspot-form {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* Contenedor del embed para controlar ancho y centrado */
#broker-hubspot-form .hs-embed.form-container {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

/* Asegurar que HubSpot no estire el form más allá del contenedor */
#broker-hubspot-form .hs-embed form,
#broker-hubspot-form .hs-embed .hs-form {
  width: 100% !important;
  max-width: 100% !important;
}

#broker-hubspot-form .hs-embed fieldset {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 14px;
  border: none;
  padding: 0;
  margin: 0;
  max-width: 100% !important;
  min-width: 0;
}

#broker-hubspot-form .hs-embed .hs-form-field {
  margin-bottom: 0;
  min-width: 0;
}

#broker-hubspot-form .hs-embed .hs-fieldtype-textarea,
#broker-hubspot-form .hs-embed .hs-form-booleancheckbox,
#broker-hubspot-form .hs-embed .hs-richtext,
#broker-hubspot-form .hs-embed .legal-consent-container,
#broker-hubspot-form .hs-embed .hs_recaptcha,
#broker-hubspot-form .hs-embed .actions {
  grid-column: 1 / -1;
}

#broker-hubspot-form .hs-embed input,
#broker-hubspot-form .hs-embed textarea,
#broker-hubspot-form .hs-embed select {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

#broker-hubspot-form label,
#broker-hubspot-form .hs-richtext {
  font-size: 14px;
  color: #0f1b40;
  font-weight: 600;
  line-height: 1.35;
}

#broker-hubspot-form .hs-input {
  width: 100% !important;
  border: 1px solid #d9dce7;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#broker-hubspot-form .hs-input:focus {
  outline: none;
  border-color: #ff6a3d;
  box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.18);
}

#broker-hubspot-form .hs-error-msg {
  color: #d83434;
  font-size: 13px;
  margin-top: 6px;
}

#broker-hubspot-form .hs-richtext p {
  margin: 0 0 6px 0;
  line-height: 1.5;
}

#broker-hubspot-form .hs-richtext strong {
  color: #0f1b40;
}

#broker-hubspot-form .actions {
  margin-top: 4px;
}

#broker-hubspot-form .hs-button {
  width: 100%;
  background: #ff6a3d;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

#broker-hubspot-form .hs-button:hover {
  background: #ff5a28;
  box-shadow: 0 10px 30px rgba(255, 106, 61, 0.25);
  transform: translateY(-1px);
}

#broker-hubspot-form .hs-button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Compactar el texto introductorio del embed para que no alargue la tarjeta */
#broker-hubspot-form .hs-richtext:first-of-type {
  display: none; /* Oculta el título duplicado del embed */
}

#broker-hubspot-form .hs-richtext:not(:first-of-type) {
  margin-bottom: 6px;
  font-size: 13px;
  color: #384364;
}

#broker-hubspot-form .hs_recaptcha {
  transform: scale(0.92);
  transform-origin: top left;
}

#broker-hubspot-form .hs-form.stacked {
  margin-bottom: 0;
}

.broker-form__privacy--editable {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  color: var(--color-gray-700);
  background: #ffffff;
  padding: var(--spacing-md);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-gray-300);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.broker-form__privacy--editable:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 61, 130, 0.18);
}

.broker-form__card .form {
  pointer-events: auto;
}

.broker-form__card, .broker-form__card * {
  pointer-events: auto !important;
}

/* Compact layout for broker form */
.broker-form__card .form {
  gap: var(--spacing-md);
}

.broker-form__card .form__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-md);
}

.broker-form__card .form-field {
  margin: 0;
}

.broker-form__card .form-field input,
.broker-form__card .form-field select,
.broker-form__card .form-field textarea {
  min-height: 44px;
  padding: 10px 12px;
}

/* Make checkbox row span full width */
.broker-form__card .form-field:nth-child(5) {
  grid-column: 1 / -1;
}

/* Ensure privacy block and buttons sit closer */
.broker-form__privacy {
  margin-top: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.broker-form__card .btn {
  margin-top: 0;
}


@media (max-width: 768px) {
  .broker-form__card .form__fields {
    grid-template-columns: 1fr;
  }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .broker-hero__grid,
  .broker-form__grid {
    grid-template-columns: 1fr;
  }
  .broker-hero__image-card {
    height: 360px;
  }

  .broker-hero {
    padding: var(--spacing-3xl) var(--spacing-lg);
  }

  .broker-value,
  .broker-form-section {
    padding: var(--spacing-3xl) var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  .broker-hero__chips {
    grid-template-columns: 1fr;
  }

  .broker-hero__cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .broker-hero__image-card {
    order: -1;
    height: 320px;
  }

  .broker-form__card {
    padding: var(--spacing-lg);
  }
}
