/**
 * Densidad visual en desktop (≥769px). Header/menú horizontal sin escala.
 * welcome-how-laptop.css: overrides de galería en welcome (final del body).
 * Cargar después de horizontal-layout/style.css (welcome: al final del body).
 */

:root {
  --iblod-density: 1;
}

/* Laptop: escala solo el contenido, no header ni menú horizontal (~zoom 75%) */
@media only screen and (min-width: 769px) {
  :root {
    --iblod-density: 0.75;
  }

  .page-body-wrapper,
  body.iblod-density-scope {
    font-size: 75%;
  }
}

@media only screen and (min-width: 769px) and (max-width: 1280px) {
  :root {
    --iblod-density: 0.72;
  }

  .page-body-wrapper,
  body.iblod-density-scope {
    font-size: 72%;
  }
}

@media only screen and (min-width: 769px) {
  .content-wrapper[style*="max-width"] {
    max-width: min(920px, 96vw) !important;
  }

  .card[style*="width: 760px"],
  .card[style*="width:760px"] {
    width: 100% !important;
    max-width: min(760px, 94vw) !important;
    box-sizing: border-box;
  }

  .swal2-modal {
    transform: none !important;
    width: min(360px, 92vw) !important;
  }

  .welcome-hero {
    min-height: 55vh;
    padding-top: 1rem;
  }

  .welcome-logo img {
    width: calc(180px * var(--iblod-density));
    height: calc(180px * var(--iblod-density));
  }

  .welcome-title {
    font-size: calc(2.5rem * var(--iblod-density));
  }

  .welcome-subtitle {
    font-size: calc(1.2rem * var(--iblod-density));
  }

  .welcome-description {
    font-size: calc(1rem * var(--iblod-density));
    margin-bottom: 2rem;
  }

  .welcome-button {
    font-size: calc(1.1rem * var(--iblod-density));
    padding: calc(1.2rem * var(--iblod-density)) calc(2.5rem * var(--iblod-density));
  }

  .welcome-stats {
    gap: calc(3rem * var(--iblod-density));
    margin: calc(4rem * var(--iblod-density)) 0;
    padding: calc(2rem * var(--iblod-density));
  }

  .stat-number {
    font-size: calc(2.5rem * var(--iblod-density));
  }

  .portfolios-section-title,
  .users-section-title,
  .how-title {
    font-size: calc(2rem * var(--iblod-density));
  }

  /* Welcome: pisa estilos inline del PHP (density al final del body) */
  body.iblod-density-scope .welcome-portfolios {
    --welcome-marquee-card-width: calc(320px * var(--iblod-density));
    --welcome-marquee-gap: clamp(0.75rem, calc(1.5vw * var(--iblod-density)), 1.125rem);
    --welcome-marquee-edge: clamp(0.75rem, calc(3vw * var(--iblod-density)), 1.5rem);
    margin: calc(3rem * var(--iblod-density)) 0;
  }

  body.iblod-density-scope .welcome-users {
    --welcome-marquee-card-width: calc(280px * var(--iblod-density));
    --welcome-marquee-gap: clamp(0.75rem, calc(1.5vw * var(--iblod-density)), 1.125rem);
    --welcome-marquee-edge: clamp(0.75rem, calc(3vw * var(--iblod-density)), 1.5rem);
    min-height: calc(225px * var(--iblod-density));
    margin: calc(3rem * var(--iblod-density)) 0;
  }

  body.iblod-density-scope .user-card {
    padding: calc(1.125rem * var(--iblod-density)) calc(0.75rem * var(--iblod-density));
  }

  body.iblod-density-scope .user-card-avatar {
    width: calc(100px * var(--iblod-density));
    height: calc(100px * var(--iblod-density));
    margin-bottom: calc(0.75rem * var(--iblod-density));
  }

  body.iblod-density-scope .portfolio-card-image {
    height: calc(200px * var(--iblod-density));
  }

  /* Galería welcome-how: css/welcome-how-laptop.css */

  .welcome-loader-logo-wrap,
  .welcome-loader-logo {
    width: calc(189px * var(--iblod-density));
    height: calc(189px * var(--iblod-density));
  }

  .welcome-loader-ring--right {
    width: calc(244px * var(--iblod-density));
    height: calc(244px * var(--iblod-density));
    margin-top: calc(-122px * var(--iblod-density));
    margin-left: calc(-122px * var(--iblod-density));
  }

  .welcome-loader-ring--left {
    width: calc(216px * var(--iblod-density));
    height: calc(216px * var(--iblod-density));
    margin-top: calc(-108px * var(--iblod-density));
    margin-left: calc(-108px * var(--iblod-density));
  }

  #titulo {
    font-size: calc(24px * var(--iblod-density)) !important;
  }

  #titulo-oferta,
  #titulo-presupuesto,
  .login-title,
  .registro-titulo {
    font-size: calc(1.5rem * var(--iblod-density)) !important;
  }

  .login-logo-text,
  .registro-logo-text {
    font-size: calc(2.9rem * var(--iblod-density)) !important;
  }

  .iblod-explorar-page .content-wrapper {
    width: 100% !important;
    max-width: min(920px, 96vw) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
  }

  .iblod-explorar-page .contenedor {
    width: 100%;
    max-width: min(800px, 100%);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  .iblod-explorar-page .portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .iblod-explorar-page .portfolio-grid .div-portafolio.col-xl-3,
  .iblod-explorar-page .portfolio-grid .div-portafolio.col-lg-3 {
    flex: 0 1 calc(25% - 1rem);
    max-width: calc(25% - 1rem);
    min-width: min(220px, 100%);
  }

  .iblod-explorar-page .div-portafolio {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
    flex: 0 0 auto;
  }

  .iblod-explorar-page .single-pen.portfolio-horizontal {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .iblod-explorar-page .portfolio-image-wrap {
    flex: 0 0 calc(220px * var(--iblod-density));
    width: calc(220px * var(--iblod-density));
    max-width: 38%;
  }

  .user-presentation-card {
    max-width: min(530px, 94vw);
  }

  .iblod-mi-perfil .profile-picture {
    width: calc(120px * var(--iblod-density));
    height: calc(120px * var(--iblod-density));
  }

  .iblod-mi-perfil .col-12.col-lg-4 {
    min-width: 0;
  }

  .iblod-mi-perfil .col-12.col-lg-4 .py-4 .clearfix {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.2rem 0.5rem;
    margin-bottom: 0.65rem;
  }

  .iblod-mi-perfil .col-12.col-lg-4 .py-4 .clearfix .float-left,
  .iblod-mi-perfil .col-12.col-lg-4 .py-4 .clearfix .float-right {
    float: none !important;
    max-width: 100%;
  }

  .iblod-mi-perfil .col-12.col-lg-4 .py-4 .clearfix .float-left {
    flex: 0 0 auto;
  }

  .iblod-mi-perfil .col-12.col-lg-4 .py-4 .clearfix .float-right {
    flex: 1 1 50%;
    text-align: right;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }

  .iblod-mi-perfil .border-bottom.text-center.pb-4 > .d-flex.justify-content-between {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .iblod-mi-perfil .border-bottom.text-center.pb-4 > .d-flex.justify-content-between > [class*="col-"] {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 4px !important;
    padding-right: 4px !important;
    text-align: center;
  }

  .iblod-mi-perfil .border-bottom.text-center.pb-4 > .d-flex.justify-content-between > [class*="col-"] h6,
  .iblod-mi-perfil .border-bottom.text-center.pb-4 > .d-flex.justify-content-between > [class*="col-"] p {
    margin-bottom: 0.15rem;
  }

  /* Login, validar teléfono (standalone; estilos inline en px/rem) */
  body.iblod-density-scope .validation-container {
    justify-content: center !important;
    padding: 1.5rem 1rem !important;
  }

  body.iblod-density-scope .validation-card {
    max-width: min(400px, 90vw) !important;
    padding: calc(2.25rem * var(--iblod-density)) calc(1.9rem * var(--iblod-density)) !important;
    border-radius: calc(18px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .validation-logo {
    margin-bottom: calc(1.5rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .validation-logo img {
    width: calc(108px * var(--iblod-density)) !important;
    height: calc(108px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .validation-title {
    font-size: calc(1.8rem * var(--iblod-density)) !important;
    margin-bottom: calc(0.75rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .validation-subtitle {
    font-size: calc(1rem * var(--iblod-density)) !important;
    margin-bottom: calc(1.85rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .validation-form .form-label {
    font-size: calc(0.95rem * var(--iblod-density)) !important;
    margin-bottom: calc(0.55rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .validation-form .form-input,
  body.iblod-density-scope .validation-form .form-select {
    padding: calc(0.85rem * var(--iblod-density)) calc(1rem * var(--iblod-density)) !important;
    font-size: 0.95rem !important;
    border-radius: calc(11px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .validation-form .form-group {
    margin-bottom: calc(1.15rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .validation-button {
    padding: calc(1rem * var(--iblod-density)) calc(1.65rem * var(--iblod-density)) !important;
    font-size: calc(1rem * var(--iblod-density)) !important;
    border-radius: calc(11px * var(--iblod-density)) !important;
  }

  /* Verificar código OTP (validar_telefono → verificar_codigo_*) */
  body.iblod-density-scope .phone-display {
    padding: calc(0.55rem * var(--iblod-density)) calc(1rem * var(--iblod-density)) !important;
    margin-bottom: calc(1.1rem * var(--iblod-density)) !important;
    font-size: calc(0.95rem * var(--iblod-density)) !important;
    border-radius: calc(9px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .code-inputs {
    gap: calc(0.5rem * var(--iblod-density)) !important;
    margin-bottom: calc(0.85rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .code-input {
    width: calc(46px * var(--iblod-density)) !important;
    height: calc(54px * var(--iblod-density)) !important;
    font-size: calc(1.45rem * var(--iblod-density)) !important;
    border-radius: calc(10px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .resend-section {
    margin-top: calc(0.85rem * var(--iblod-density)) !important;
    padding-top: calc(0.85rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .resend-section p {
    font-size: calc(0.85rem * var(--iblod-density)) !important;
    margin-bottom: calc(0.35rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .resend-link,
  body.iblod-density-scope .countdown {
    font-size: calc(0.85rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .change-phone-link {
    margin-top: calc(0.55rem * var(--iblod-density)) !important;
    font-size: calc(0.82rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .loading-spinner {
    margin: calc(0.5rem * var(--iblod-density)) auto !important;
  }

  /* Funnel elegir servicio / inspiración */
  body.iblod-density-scope .funnel-button {
    padding: calc(0.75rem * var(--iblod-density)) calc(0.95rem * var(--iblod-density)) !important;
    font-size: 0.85rem !important;
    border-radius: calc(11px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .funnel-back {
    font-size: calc(0.9rem * var(--iblod-density)) !important;
    padding: calc(0.55rem * var(--iblod-density)) calc(1.1rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .validation-benefits {
    margin-top: calc(1.5rem * var(--iblod-density)) !important;
    padding-top: calc(1.5rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .validation-benefits .benefit-item {
    font-size: calc(0.9rem * var(--iblod-density)) !important;
    margin-bottom: calc(0.6rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .content-wrapper.auth {
    padding: calc(2rem * var(--iblod-density)) 1rem !important;
  }

  body.iblod-density-scope .auth-form-col {
    width: 100% !important;
    max-width: min(400px, 90vw) !important;
  }

  body.iblod-density-scope .auth-form-light {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: calc(2.25rem * var(--iblod-density)) calc(1.75rem * var(--iblod-density)) !important;
    border-radius: calc(20px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .auth .brand-logo {
    margin-bottom: calc(0.75rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .iblod {
    font-size: calc(2.2rem * var(--iblod-density)) !important;
    padding-top: calc(10px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope #form-acceso-sistema h4 {
    font-size: calc(1.75rem * var(--iblod-density)) !important;
    margin-bottom: calc(0.35rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope #form-acceso-sistema h6 {
    font-size: calc(1rem * var(--iblod-density)) !important;
    margin-bottom: calc(1.35rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .form-control.form-control-lg {
    min-height: calc(52px * var(--iblod-density)) !important;
    font-size: calc(0.95rem * var(--iblod-density)) !important;
    padding: calc(0.8rem * var(--iblod-density)) calc(0.9rem * var(--iblod-density)) !important;
    border-radius: calc(12px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .auth-form-btn.btn-primary {
    min-height: calc(52px * var(--iblod-density)) !important;
    font-size: calc(0.95rem * var(--iblod-density)) !important;
    border-radius: calc(12px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .acceso-switch {
    margin-bottom: calc(1rem * var(--iblod-density)) !important;
    padding: calc(0.25rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .acceso-switch-btn {
    font-size: calc(0.88rem * var(--iblod-density)) !important;
    padding: calc(0.65rem * var(--iblod-density)) calc(0.7rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .code-input {
    width: calc(48px * var(--iblod-density)) !important;
    height: calc(56px * var(--iblod-density)) !important;
    font-size: calc(1.45rem * var(--iblod-density)) !important;
    border-radius: calc(11px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .code-inputs {
    gap: calc(0.55rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .btn-ghost {
    min-height: calc(44px * var(--iblod-density)) !important;
    border-radius: calc(11px * var(--iblod-density)) !important;
  }

  /* rem desde raíz html: no multiplicar otra vez por --iblod-density */
  body.iblod-density-scope #bloque-recuperar .auth-link,
  body.iblod-density-scope #btn-recuperar-cuenta {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
  }

  body.iblod-density-scope .text-center.mt-4.font-weight-light {
    margin-top: calc(1.25rem * var(--iblod-density)) !important;
    font-size: 0.8rem !important;
    line-height: 1.45 !important;
  }

  body.iblod-density-scope .text-center.mt-4.font-weight-light a {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
  }

  body.iblod-density-scope #bloque-recuperar {
    margin-top: 0.35rem !important;
    margin-bottom: 0.15rem !important;
  }

  /* Registro (registrarse.php): card + wizard, paridad con login */
  body.iblod-density-scope .content-wrapper.auth .col-lg-4.mx-auto {
    max-width: min(400px, 90vw) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .card {
    padding: calc(2.25rem * var(--iblod-density)) calc(1.75rem * var(--iblod-density)) calc(1.25rem * var(--iblod-density)) !important;
    border-radius: calc(20px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .card .card-body > h4.card-title {
    font-size: calc(1.5rem * var(--iblod-density)) !important;
    margin-bottom: calc(0.85rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .card label:not(.iblod),
  body.iblod-density-scope .content-wrapper.auth .card .col-form-label {
    font-size: calc(0.88rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .card .brand-logo .iblod {
    font-size: calc(2.2rem * var(--iblod-density)) !important;
    padding-top: calc(10px * var(--iblod-density)) !important;
    font-weight: 600 !important;
  }

  body.iblod-density-scope .content-wrapper.auth .card .form-control,
  body.iblod-density-scope .content-wrapper.auth .card .select2-container--default .select2-selection--single {
    min-height: calc(48px * var(--iblod-density)) !important;
    font-size: 0.95rem !important;
    border-radius: calc(12px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .card .form-control {
    padding: calc(0.75rem * var(--iblod-density)) calc(0.9rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .card .form-control::placeholder {
    font-size: 0.82rem !important;
    color: #98a2b3;
  }

  body.iblod-density-scope .content-wrapper.auth .form-control.form-control-lg::placeholder {
    font-size: 0.82rem !important;
    color: #98a2b3;
  }

  body.iblod-density-scope .content-wrapper.auth .card .select2-container--default .select2-selection--single {
    height: calc(48px * var(--iblod-density)) !important;
    padding: 0 calc(0.75rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .card .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(48px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .card .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(48px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .wizard > .steps a,
  body.iblod-density-scope .content-wrapper.auth .wizard > .steps a:hover,
  body.iblod-density-scope .content-wrapper.auth .wizard > .steps a:active {
    font-size: calc(0.82rem * var(--iblod-density)) !important;
    padding: calc(0.55rem * var(--iblod-density)) calc(0.75rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .wizard > .content {
    min-height: calc(16em * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .wizard > .actions a,
  body.iblod-density-scope .content-wrapper.auth .wizard > .actions a:hover,
  body.iblod-density-scope .content-wrapper.auth .wizard > .actions a:active {
    font-size: calc(0.88rem * var(--iblod-density)) !important;
    min-width: calc(100px * var(--iblod-density)) !important;
    padding: calc(0.6rem * var(--iblod-density)) calc(0.85rem * var(--iblod-density)) !important;
    border-radius: calc(12px * var(--iblod-density)) !important;
  }

  body.iblod-density-scope #btn-recibir-codigo.btn.btn-outline-info,
  body.iblod-density-scope #btn-recibir-codigo.btn.btn-outline-info.btn-fw {
    min-height: calc(48px * var(--iblod-density)) !important;
    font-size: calc(0.88rem * var(--iblod-density)) !important;
    border-radius: calc(12px * var(--iblod-density)) !important;
    padding: calc(0.55rem * var(--iblod-density)) calc(0.7rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .card .form-group {
    margin-bottom: calc(0.85rem * var(--iblod-density)) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .input-codigo-verificacion .form-control.form-control-lg {
    min-height: calc(48px * var(--iblod-density)) !important;
    font-size: 0.95rem !important;
    padding: calc(0.75rem * var(--iblod-density)) calc(0.9rem * var(--iblod-density)) !important;
    border-radius: calc(12px * var(--iblod-density)) !important;
  }
}

@media only screen and (max-width: 768px) {
  body.iblod-density-scope .validation-container {
    justify-content: flex-start !important;
    padding: 2rem 1rem 1.5rem !important;
  }
}

@media only screen and (min-width: 769px) and (max-width: 1280px) {
  .welcome-hero {
    min-height: 48vh;
  }

  body.iblod-density-scope .auth-form-col {
    max-width: min(380px, 88vw) !important;
  }

  body.iblod-density-scope .validation-card {
    max-width: min(380px, 88vw) !important;
  }

  body.iblod-density-scope .content-wrapper.auth .col-lg-4.mx-auto {
    max-width: min(380px, 88vw) !important;
  }

  body.iblod-density-scope .welcome-portfolios {
    --welcome-marquee-card-width: calc(300px * var(--iblod-density));
  }

  body.iblod-density-scope .welcome-users {
    --welcome-marquee-card-width: calc(260px * var(--iblod-density));
  }

}
