/* Responsive final pass. Loaded after the visual/editor style layers. */

:root {
  --mobile-gutter: clamp(16px, 5vw, 40px);
  --mobile-header: 72px;
}

html {
  scroll-padding-top: var(--mobile-header);
  overflow-x: hidden;
}

body {
  max-width: 100%;
  overflow-x: hidden;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

.contact-phone-icon > svg {
  display: block;
  width: 21px;
  height: 21px;
}

/* Real inline SVG arrows. They stay sharp at every size and do not depend on
   a text glyph or on pseudo-elements that can look different per device. */
.icon-arrow {
  display: block;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  overflow: visible;
}

.button > span:not(.contact-phone-icon),
.service-card > a > span,
.software-card-content > a > span,
.software-fit-note > a > span,
.footer-demo-link > span {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  font-size: 0;
  line-height: 0;
}

.carousel-controls > button,
.software-photo-arrow,
.brand-announcement-navigation > button {
  font-size: 0;
}

.carousel-controls > button > .icon-arrow,
.software-photo-arrow > .icon-arrow,
.brand-announcement-navigation > button > .icon-arrow {
  width: 16px;
  height: 16px;
}

.contact-form-icon {
  font-size: 0;
}

.contact-form-icon > .icon-arrow {
  width: 20px;
  height: 20px;
}

.nav-call-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

/* Tablet navigation remains comfortable without squeezing every link into a row. */
@media (max-width: 1080px) {
  .shell { width: min(100% - 48px, 1160px); }
  .nav-wrap { gap: 18px; }
  .site-header .brand img { width: 158px; }

  .menu-toggle {
    display: grid;
    place-content: center;
    gap: 4px;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 8px;
    border: 1px solid rgba(20,125,255,.25);
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(145deg, #147dff, #0751d8);
    box-shadow: 0 8px 20px rgba(20,125,255,.25);
    cursor: pointer;
  }

  .menu-toggle span {
    width: 21px;
    margin: 0;
    transition: transform .2s ease, opacity .2s ease;
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .main-nav {
    position: fixed;
    z-index: 101;
    inset: 80px 16px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    width: auto;
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    padding: 10px;
    border: 1px solid rgba(180,207,233,.8);
    border-radius: 22px;
    background: rgba(255,255,255,.985);
    box-shadow: 0 24px 70px rgba(8,31,67,.28);
    animation: mobileMenuIn .2s ease both;
  }

  body.menu-open::before {
    content: "";
    position: fixed;
    z-index: 99;
    inset: 0;
    background: rgba(3,20,45,.42);
    backdrop-filter: blur(3px);
  }

  .main-nav.open { display: flex; }

  .main-nav > a {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: #193a60;
    font-size: 14px;
    font-weight: 800;
  }

  .main-nav > a:not(.nav-whatsapp):not(.nav-call):hover,
  .main-nav > a.active {
    border-color: #d6eaff;
    color: #0759c9;
    background: #edf5ff;
  }

  .main-nav > a:not(.nav-whatsapp):not(.nav-call) + a:not(.nav-whatsapp):not(.nav-call) {
    border-top-color: #edf2f7;
  }

  .main-nav > .nav-whatsapp,
  .main-nav > .nav-call {
    justify-content: flex-start;
    width: 100%;
    min-height: 56px;
    margin-top: 8px;
    padding: 10px 13px;
    border: 0;
    border-radius: 14px;
  }

  .main-nav > .nav-whatsapp { background: linear-gradient(135deg,#20c979,#079b62); }
  .main-nav > .nav-call { background: linear-gradient(135deg,#147dff,#0751d8); }
  .main-nav > .nav-whatsapp + .nav-call { margin-top: 0; }
  .main-nav > .nav-whatsapp > .nav-whatsapp-icon,
  .main-nav > .nav-call > .nav-call-icon { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 11px; }
  .main-nav > .nav-call > span:last-child,
  .main-nav > .nav-whatsapp > span:last-child { text-align: left; }
  .main-nav > a:not(.nav-call)::after { display: none; }
}

@keyframes mobileMenuIn {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 980px) {
  .hero { min-height: auto; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .hero-copy { max-width: 760px; }
  .hero-brand { width: min(760px, 100%); min-height: 0; margin-inline: auto; }
  .about-grid,
  .contact-card { grid-template-columns: minmax(0, 1fr); }
  .about-media { max-width: 760px; }
  .contact-card { gap: 36px; }

  .software-card-grid,
  .service-grid,
  .reviews-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .software-card-grid .software-card:last-child,
  .service-grid .service-card:last-child,
  .reviews-board .review-card:last-child {
    grid-column: 1 / -1;
    width: calc(50% - 9px);
    justify-self: center;
  }
}

@media (max-width: 700px) {
  :root { --mobile-header: 68px; }
  .shell { width: calc(100% - (var(--mobile-gutter) * 2)); }
  .site-header { padding-top: env(safe-area-inset-top); }
  .nav-wrap { height: var(--mobile-header); }
  .site-header .brand img { width: clamp(130px, 42vw, 158px); height: 54px; }
  .main-nav {
    inset: calc(var(--mobile-header) + env(safe-area-inset-top) + 8px) 12px auto;
    max-height: calc(100vh - var(--mobile-header) - 20px);
    max-height: calc(100dvh - var(--mobile-header) - 20px);
  }

  .hero { padding: calc(var(--mobile-header) + env(safe-area-inset-top) + 34px) 0 52px; }
  .hero-grid { gap: 28px; }
  .hero-copy,
  .hero-brand,
  .section-heading > *,
  .software-heading,
  .software-card,
  .service-card,
  .contact-copy,
  .contact-form { min-width: 0; }
  .hero .eyebrow { max-width: 100%; margin-bottom: 19px; font-size: 9px; line-height: 1.35; }
  .hero h1 { max-width: 13ch; font-size: clamp(40px, 11vw, 58px); line-height: 1.02; }
  .hero-lead { margin-top: 21px; font-size: 15px; line-height: 1.65; }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 27px;
  }

  .hero-actions .button { width: 100%; }
  .hero-points { display: grid; gap: 9px; margin-top: 27px; font-size: 11px; }
  .hero-brand { margin-top: 3px; }

  .dashboard-frame {
    width: 100%;
    border-width: 4px;
    border-radius: 18px;
    transform: none !important;
    animation: none !important;
  }

  .dashboard-bar { height: 34px; padding-inline: 10px; }
  .dashboard-bar span { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .carousel-track,
  .carousel-slide { height: clamp(255px, 72vw, 330px); }
  .carousel-slide-head { inset: 9px 9px auto; min-height: 39px; }
  .carousel-slide-head span { max-width: 42%; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
  .carousel-caption { padding: 46px 12px 11px; }
  .carousel-caption strong { font-size: 13px; }
  .carousel-caption span { font-size: 9px; line-height: 1.35; }
  .carousel-controls { height: 46px; }
  .carousel-controls > button { width: 34px; height: 34px; }

  .trust-strip { padding: 18px 0; }
  .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 10px; }
  .trust-intro { grid-column: 1 / -1; font-size: 12px; }
  .trust-stat { min-height: 42px; gap: 8px; padding-left: 10px; }
  .trust-stat span { font-size: 9px; line-height: 1.3; }

  .section { padding: 70px 0; }
  .section h2,
  .software-heading h2,
  .section-heading h2 { font-size: clamp(34px, 9.5vw, 44px); line-height: 1.04; }
  .software-heading { margin-bottom: 30px; }
  .software-heading > p,
  .section-heading > p { font-size: 14px; line-height: 1.7; }

  .software-card-grid,
  .service-grid,
  .reviews-board { grid-template-columns: 1fr; gap: 15px; }
  .software-card-grid .software-card:last-child,
  .service-grid .service-card:last-child,
  .reviews-board .review-card:last-child { grid-column: auto; width: auto; }

  .software-card { display: flex; min-width: 0; border-radius: 17px; transform-style: flat; }
  .software-card:hover,
  .service-card:hover,
  .review-card:hover { transform: none; }
  .software-card-logo { height: 78px; padding: 10px 20px; }
  .software-card-logo img { height: 58px; }
  .software-card-photo,
  .software-photo-carousel { height: clamp(190px, 58vw, 235px); }
  .software-card-content { padding: 21px 20px 23px; }
  .software-card-content h3 { margin-top: 7px; font-size: 22px; }
  .software-card-content p { font-size: 12px; line-height: 1.65; }
  .software-card-content ul { margin: 16px 0 20px; }
  .software-card-content a { min-height: 26px; }

  .software-fit-note { gap: 18px; margin-top: 18px; padding: 19px; border-radius: 16px; }
  .software-fit-note > div { gap: 11px; }
  .software-fit-note strong { font-size: 14px; line-height: 1.3; }
  .software-fit-note p { font-size: 11px; line-height: 1.6; }
  .software-fit-note > a { width: 100%; }

  .section-heading { gap: 12px; margin-bottom: 28px; }
  .service-card { min-height: 0; padding: 143px 20px 70px; border-radius: 17px; }
  .service-card-media { height: 118px; border-radius: 17px 17px 0 0; }
  .service-card .number { left: 16px; top: 14px; }
  .service-card h3 { font-size: 23px; }
  .service-card p { margin: 0 0 15px; font-size: 12px; line-height: 1.65; }
  .service-card ul { margin: 14px 0 0; }
  .service-card > a { left: 20px; bottom: 21px; min-height: 30px; display: inline-flex; align-items: center; }

  .about-grid { gap: 38px; }
  .about-media > img { height: clamp(250px, 70vw, 340px); border-radius: 18px; }
  .about-media > .about-award-card { top: 12px; left: 10px; width: min(218px, calc(100% - 20px)); }
  .about-copy .lead { font-size: 15px; line-height: 1.7; }
  .about-identity-note { font-size: 12px; line-height: 1.65; }
  .values { margin-top: 24px; }
  .values > div { gap: 12px; padding: 14px 0; }
  .values > div:hover { padding-left: 0; transform: none; }
  .values strong { font-size: 13px; }

  .company-location { margin-top: 38px; padding: 9px; border-radius: 18px; }
  .company-location-copy { padding: 16px 11px 18px; }
  .company-location-copy h3 { font-size: clamp(27px, 8vw, 36px); }
  .company-location-copy .button { width: 100%; }
  .company-map,
  .company-map iframe { min-height: 250px; }

  .contact { padding-top: 0; }
  .contact-card { gap: 28px; padding: 28px 16px; border-radius: 21px; }
  .contact-copy h2 { font-size: clamp(35px, 9.5vw, 46px); }
  .contact-copy > p:not(.eyebrow) { font-size: 14px; line-height: 1.7; }
  .contact-primary-contact { margin-top: 24px; }
  .contact-direct-actions { grid-template-columns: 1fr; }
  .contact-direct-actions > a { min-height: 58px; }
  .contact-form { padding: 18px; border-radius: 15px; }

  .contact-form input,
  .contact-form textarea,
  .contact-form select,
  .review-form input,
  .review-form textarea,
  .review-form select { min-height: 46px; font-size: 16px; }
  .contact-form textarea,
  .review-form textarea { min-height: 118px; }
  .contact-form .button { width: 100%; }
  .contact-form .privacy { width: 100%; align-items: flex-start; gap: 8px; line-height: 1.4; }
  .contact-form .privacy input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }

  .news-board-section { padding: 58px 0 64px; }
  .news-card-media { height: 164px; }
  .news-card-body { padding: 17px; }
  .news-card h3 { font-size: 19px; }
  .reviews-section { padding-top: 65px; }
  .review-card { min-height: 0; padding: 20px; }
  .review-submit-cta { align-items: stretch; flex-direction: column; gap: 18px; padding: 20px; }
  .review-submit-cta .button { width: 100%; }

  .custom-block { padding: 62px 0; }
  .custom-block-inner { grid-template-columns: 1fr; gap: 28px; }
  .custom-block.layout-image-right .custom-block-media { order: 0; }
  .custom-block-media.size-medium img,
  .custom-block-media.size-large img { height: min(400px, 80vw); }
  .custom-cta .custom-block-inner { padding: 25px 19px; }

  .site-footer { padding: 52px 0 22px !important; }
  .site-footer .footer-main { grid-template-columns: 1fr; gap: 28px; }
  .footer-brand-block { grid-column: auto; }
  .footer-logo-frame { width: min(205px, 100%); height: 84px; }
  .site-footer .footer-bottom { align-items: flex-start; flex-direction: column; gap: 15px; margin-top: 36px; }
  .site-footer .footer-bottom div { flex-wrap: wrap; gap: 9px 15px; }

  /* Safe viewport sizing for mobile browser address bars. */
  .public-review-modal,
  .news-detail-modal { padding: 10px; }
  .public-review-dialog,
  .news-detail-dialog {
    width: 100%;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 18px;
  }
  .public-review-dialog { padding: 19px; }
  .public-review-heading { gap: 12px; }
  .public-review-heading h3 { font-size: 24px; }
  .public-review-close { flex: 0 0 40px; width: 40px; height: 40px; }
  .public-review-dialog .review-form .field-row,
  .demo-dialog .demo-form .field-row,
  .review-form .field-row { grid-template-columns: 1fr; }
  .review-form-safe { margin: 0 0 12px; }
  .review-success-dialog { padding: 32px 20px 25px; }
  .news-detail-layout { grid-template-columns: 1fr; }
  .news-detail-media { min-height: 0; height: clamp(205px, 48vw, 290px); }
  .news-detail-copy { padding: 25px 19px 21px; }
  .news-detail-copy h3 { font-size: clamp(29px, 8vw, 38px); }
  .news-detail-copy > p:not(.eyebrow) { font-size: 13px; line-height: 1.7; }
  .news-detail-footer { align-items: stretch; flex-direction: column; margin-top: 21px; padding-top: 17px; }
  .news-detail-footer .button { width: 100%; }

  .demo-dialog { padding: 0; }
  .demo-modal-heading { padding: 20px 18px 18px; border-radius: 18px 18px 0 0; }
  .demo-modal-title-wrap { gap: 10px; }
  .demo-modal-heading h3 { font-size: 24px; }
  .demo-modal-heading p:last-of-type { font-size: 11px; line-height: 1.45; }
  .demo-modal-icon { flex-basis: 36px; width: 36px; height: 36px; }
  .demo-guide { grid-template-columns: 1fr; margin: 14px 18px 10px; }
  .demo-availability { margin-inline: 18px; }
  .demo-dialog .demo-form { padding: 0 18px 20px; }
  .demo-dialog .demo-form .button { width: 100%; }
}

@media (max-width: 380px) {
  .site-header .brand img { width: 128px; }
  .menu-toggle { flex-basis: 42px; width: 42px; height: 42px; }
  .hero h1 { font-size: 39px; }
  .trust-grid { grid-template-columns: 1fr; }
  .trust-intro { grid-column: auto; }
  .trust-stat { border-left: 0 !important; border-top: 1px solid var(--line); padding: 11px 0 0; }
  .carousel-slide-head img { width: 75px; }
  .carousel-slide-head span { font-size: 7px; }
  .contact-form,
  .public-review-dialog { padding-inline: 15px; }
}

.demo-form-section-label {
  margin: 18px 0 10px;
  color: #0b5fc9;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (max-width: 700px) {
  #demo-modal.public-review-modal {
    align-items: flex-start;
    padding: max(10px, env(safe-area-inset-top)) 10px 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .demo-dialog {
    width: 100%;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    border-radius: 21px;
  }

  .demo-modal-heading {
    position: sticky;
    z-index: 3;
    top: 0;
    padding: 18px 16px 16px;
    border-radius: 21px 21px 0 0;
  }

  .demo-modal-title-wrap { gap: 10px; padding-right: 38px; }
  .demo-modal-heading h3 { font-size: 24px; }
  .demo-modal-heading p:last-of-type { font-size: 11px; line-height: 1.45; }
  .demo-modal-badge { margin-top: 8px; font-size: 8px; }
  .demo-modal-icon { flex-basis: 36px; width: 36px; height: 36px; }
  .demo-modal-heading .public-review-close { top: 14px; right: 14px; width: 40px; height: 40px; }

  .demo-guide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 14px 16px 10px;
  }

  .demo-step {
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-height: 70px;
    padding: 8px 4px;
    text-align: center;
  }

  .demo-step b { flex-basis: 24px; width: 24px; height: 24px; font-size: 10px; }
  .demo-step strong { font-size: 9px; line-height: 1.2; }
  .demo-step small { display: none; }

  .demo-availability {
    align-items: flex-start;
    margin: 0 16px 16px;
    padding: 11px 12px;
    font-size: 10px;
    line-height: 1.4;
  }

  .demo-dialog .demo-form { padding: 0 16px 20px; }
  .demo-form-intro { margin-bottom: 15px !important; font-size: 12px !important; line-height: 1.5; }
  .demo-form-section-label { margin: 17px 0 9px; font-size: 10px; }
  .demo-dialog .demo-form .field-row { grid-template-columns: 1fr; gap: 0; }
  .demo-dialog .demo-form label { margin-bottom: 14px; font-size: 12px; gap: 7px; }
  .demo-dialog .demo-form input,
  .demo-dialog .demo-form select,
  .demo-dialog .demo-form textarea {
    min-height: 50px;
    padding: 12px 13px;
    border-radius: 12px;
    font-size: 16px;
  }

  .demo-dialog .demo-form textarea { min-height: 105px; }
  .demo-dialog .demo-field-note { margin-top: 1px; font-size: 10px; line-height: 1.4; }
  .demo-dialog .demo-duration { min-height: 50px; margin-bottom: 14px; border-radius: 12px; font-size: 11px; }
  .demo-dialog .demo-duration strong { font-size: 13px; }
  .demo-dialog .demo-form .privacy { align-items: flex-start; gap: 9px; margin: 2px 0 14px; font-size: 11px; line-height: 1.45; }
  .demo-dialog .demo-form .privacy input { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; }
  .demo-dialog .demo-form .button { width: 100%; min-height: 52px; margin-top: 5px; font-size: 14px; }
  .demo-dialog #demo-form-note { margin-top: 11px; font-size: 11px; line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-toggle span,
  .software-card,
  .service-card,
  .review-card,
  .about-media > img { transition: none !important; }
}

/* Popup de demo y formación: lectura y escritura más cómodas. */
.training-notice-modal { z-index: 140; }
.training-notice-dialog { width: min(500px, 100%); }
.training-notice-icon { color: #fff; background: linear-gradient(135deg, #f08b3e, #c84b35); box-shadow: 0 12px 25px rgba(200, 75, 53, .22); }
.demo-dialog { width: min(940px, calc(100vw - 32px)); }
.demo-dialog .demo-form { padding-inline: 42px; }
.demo-dialog .demo-form label { font-size: 12px; gap: 8px; }
.demo-dialog .demo-form input,
.demo-dialog .demo-form select,
.demo-dialog .demo-form textarea {
  min-height: 52px;
  padding: 14px 15px;
  font-size: 15px;
}
.demo-dialog .demo-form textarea { min-height: 135px; }
.demo-dialog .demo-form .button { min-height: 54px; font-size: 14px; }

@media (max-width: 700px) {
  .demo-dialog { width: 100%; }
  .demo-dialog .demo-form { padding-inline: 18px; }
  .demo-dialog .demo-form label { font-size: 12px; }
  .demo-dialog .demo-form input,
  .demo-dialog .demo-form select,
  .demo-dialog .demo-form textarea { font-size: 16px; }
}

/* Rediseño del popup de demo y formación inspirado en la maqueta aportada. */
#demo-modal .demo-dialog {
  width: min(1120px, calc(100vw - 34px));
  max-height: calc(100vh - 34px);
  padding: 0;
  overflow: auto;
  border: 1px solid #d7e5f2;
  border-radius: 24px;
  background: #f7fbff;
}
#demo-modal .demo-modal-heading {
  position: relative;
  min-height: 260px;
  margin: 0;
  padding: 48px 47% 40px 48px;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(135deg, #09275f 0%, #064e99 60%, #087eaa 100%);
}
#demo-modal .demo-modal-heading::before {
  content: '';
  position: absolute;
  width: 70%;
  height: 180%;
  right: 9%;
  top: -50%;
  transform: rotate(31deg);
  background: rgba(20, 138, 220, .2);
  border-left: 1px solid rgba(135, 227, 255, .32);
}
#demo-modal .demo-modal-heading::after {
  content: '·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·';
  position: absolute;
  right: 22px;
  top: 24px;
  width: 125px;
  color: rgba(151, 221, 255, .45);
  font-size: 15px;
  letter-spacing: 8px;
  line-height: 24px;
  opacity: .7;
}
#demo-modal .demo-modal-title-wrap { position: relative; z-index: 2; align-items: flex-start; }
#demo-modal .demo-modal-icon { flex: 0 0 42px; color: #fff; background: linear-gradient(135deg, #2b8df2, #0b65df); }
#demo-modal .demo-modal-heading .eyebrow { color: #64e8ff; font-size: 12px; letter-spacing: .16em; }
#demo-modal .demo-modal-heading h3 { max-width: 650px; margin: 7px 0 10px; color: #fff; font-size: clamp(34px, 4vw, 51px); line-height: 1.04; }
#demo-modal .demo-modal-heading p:last-of-type { max-width: 600px; color: #e2f2ff; font-size: 15px; line-height: 1.6; }
#demo-modal .demo-modal-badge { padding: 8px 13px; color: #9cefff; background: rgba(55, 172, 244, .2); font-size: 11px; }
#demo-modal .demo-modal-heading > .public-review-close { position: absolute; z-index: 5; top: 20px; right: 20px; color: #e0f6ff; background: rgba(255, 255, 255, .13); }
#demo-modal .demo-modal-heading > .public-review-close:hover { color: #0a3b74; background: #fff; }
.demo-modal-art { position: absolute; z-index: 2; right: 5%; bottom: 15px; width: 35%; height: 205px; }
.demo-art-screen { position: absolute; right: 12%; top: 8px; display: grid; grid-template-columns: 92px 1fr; gap: 11px; align-items: center; width: 235px; height: 145px; padding: 23px 18px; transform: rotate(2deg); border: 2px solid rgba(216, 239, 255, .8); border-radius: 13px; background: linear-gradient(135deg, #dff1ff, #8db9e8); box-shadow: 0 18px 30px rgba(1, 19, 54, .28); }
.demo-art-play { display: grid; place-items: center; width: 74px; height: 59px; border-radius: 8px; color: #04b9d1; background: rgba(255, 255, 255, .75); font-size: 24px; }
.demo-art-screen i { display: block; width: 72px; height: 9px; border-radius: 99px; background: rgba(71, 147, 220, .38); }
.demo-art-screen i + i { width: 56px; }
.demo-art-calendar { position: absolute; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 20px); gap: 6px; width: 107px; padding: 28px 12px 12px; border-radius: 12px; background: #f3fbff; box-shadow: 0 15px 25px rgba(1, 19, 54, .28); }
.demo-art-calendar::before { content: ''; position: absolute; inset: 0 0 auto; height: 28px; border-radius: 12px 12px 0 0; background: #08b6d0; }
.demo-art-calendar::after { content: ''; position: absolute; top: 9px; left: 22px; width: 7px; height: 13px; border: 2px solid #fff; border-bottom: 0; border-radius: 4px 4px 0 0; box-shadow: 52px 0 0 -2px #fff; }
.demo-art-calendar span { width: 20px; height: 20px; border-radius: 4px; background: #cfe4f8; }
#demo-modal .demo-guide { position: relative; z-index: 3; grid-template-columns: 1.15fr .9fr 1.15fr; gap: 28px; margin: 22px 28px 28px; }
#demo-modal .demo-guide::before { content: ''; position: absolute; z-index: -1; top: 50%; right: 9%; left: 9%; border-top: 1px solid #c4d9ec; }
#demo-modal .demo-step { min-height: 76px; padding: 14px 18px; border: 1px solid #dce9f4; border-radius: 13px; background: #fff; box-shadow: 0 7px 18px rgba(13, 69, 113, .08); }
#demo-modal .demo-step b { flex: 0 0 34px; width: 34px; height: 34px; background: linear-gradient(135deg, #177af1, #0751c7); font-size: 14px; }
#demo-modal .demo-step strong { color: #142f59; font-size: 13px; }
#demo-modal .demo-step small { color: #7289a4; font-size: 11px; }
.demo-content-grid { display: grid; grid-template-columns: 255px minmax(0, 1fr); gap: 14px; margin: 0 28px 28px; }
.demo-sidebar { min-height: 740px; padding: 54px 24px 30px; border: 1px solid #e0ecf5; border-radius: 15px; color: #496686; background: linear-gradient(180deg, #eef8ff, #f8fbfe); text-align: center; }
.demo-sidebar-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 20px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #1680f2, #0c66d8); box-shadow: 0 9px 20px rgba(20, 125, 255, .2); font-size: 28px; }
.demo-sidebar h4 { margin: 0 0 13px; color: #122f5a; font-size: 16px; }
.demo-sidebar > p { margin: 0 0 5px; font-size: 14px; line-height: 1.65; }
.demo-sidebar > strong { display: block; color: #496686; font-size: 14px; line-height: 1.55; }
.demo-sidebar-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 48px 0 28px; padding: 17px 10px 14px; border-top: 1px solid #ccdfef; border-bottom: 1px solid #ccdfef; }
.demo-sidebar-calendar b { grid-column: 1 / -1; margin-bottom: 7px; color: #1671d4; font-size: 9px; letter-spacing: .1em; }
.demo-sidebar-calendar i { width: 15px; height: 15px; border-radius: 3px; background: #cfe4f8; }
.demo-sidebar hr { border: 0; border-top: 1px solid #ccdfef; }
.demo-sidebar-message { margin-top: 28px; margin-bottom: 13px; color: #1478e5; background: #dceeff; box-shadow: none; }
.demo-sidebar-message + p { color: #516e91; font-size: 14px; }
.demo-form { min-width: 0; padding: 0 !important; border: 1px solid #e0eaf3; border-radius: 15px; background: #fff; box-shadow: 0 10px 25px rgba(20, 78, 119, .05); }
.demo-form-intro { padding: 23px 29px 0; color: #6a82a0 !important; font-size: 12px !important; }
.demo-form-section-label { display: flex; align-items: center; gap: 11px; margin: 25px 0 14px; padding: 0 29px; color: #0967dd; font-size: 14px; letter-spacing: .08em; }
.demo-form-section-label span { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #187bf1, #0752c8); font-size: 13px; letter-spacing: 0; }
.demo-form > label, .demo-form > .field-row { margin-inline: 29px; }
.demo-form > .field-row { gap: 26px; }
.demo-form label { color: #19355f; font-size: 12px !important; }
.demo-form input, .demo-form select, .demo-form textarea { min-height: 52px !important; padding: 14px 15px !important; border: 1px solid #c6d9eb !important; border-radius: 10px !important; color: #19355f; background: #fff !important; font-size: 14px !important; }
.demo-form textarea { min-height: 100px !important; }
.demo-form .demo-duration { min-height: 52px; padding: 0 16px; border: 1px solid #acd3fa; border-radius: 10px; color: #6590bd; background: #f2f8ff; font-size: 12px; }
.demo-form .demo-duration strong { color: #1472dd; font-size: 15px; }
.demo-form .privacy { display: flex; align-items: center; gap: 9px; margin-top: 22px; color: #526d8e; font-size: 12px !important; }
.demo-form .privacy input { min-height: auto !important; width: 18px; height: 18px; padding: 0 !important; }
.demo-form > .button { display: flex; justify-content: center; width: calc(100% - 58px); margin: 25px 29px 0; min-height: 53px; border-radius: 10px; background: linear-gradient(135deg, #1164ef, #0874dc); box-shadow: 0 10px 20px rgba(17, 100, 239, .2); font-size: 15px; }
.demo-form #demo-form-note { margin: 14px 29px 26px; color: #91a7c1; font-size: 11px; text-align: center; }

@media (max-width: 800px) {
  #demo-modal .demo-dialog { width: 100%; max-height: calc(100dvh - 20px); border-radius: 18px; }
  #demo-modal .demo-modal-heading { min-height: 225px; padding: 34px 24px 30px; border-radius: 18px 18px 0 0; }
  #demo-modal .demo-modal-heading h3 { max-width: 90%; font-size: 31px; }
  #demo-modal .demo-modal-heading p:last-of-type { max-width: 62%; font-size: 12px; }
  .demo-modal-art { right: 2%; bottom: 8px; width: 42%; transform: scale(.72); transform-origin: right bottom; }
  #demo-modal .demo-guide { grid-template-columns: 1fr; gap: 9px; margin: 16px 16px 18px; }
  #demo-modal .demo-guide::before { display: none; }
  .demo-content-grid { grid-template-columns: 1fr; margin: 0 16px 16px; }
  .demo-sidebar { order: 2; min-height: 0; padding: 28px 20px; }
  .demo-sidebar-calendar { display: none; }
  .demo-sidebar-message { display: none; }
  .demo-form { order: 1; }
  .demo-form-intro { padding: 19px 18px 0; }
  .demo-form-section-label { padding-inline: 18px; }
  .demo-form > label, .demo-form > .field-row { margin-inline: 18px; }
  .demo-form > .field-row { gap: 0; }
  .demo-form > .button { width: calc(100% - 36px); margin-inline: 18px; }
  .demo-form #demo-form-note { margin-inline: 18px; }
}

/* El acceso especial de formación usa exactamente la misma composición visual que el popup de demo. */
.formation-modal .demo-dialog { width: min(1120px, calc(100vw - 34px)); max-height: calc(100vh - 34px); padding: 0; overflow: auto; border: 1px solid #d7e5f2; border-radius: 24px; background: #f7fbff; }
.formation-modal .demo-modal-heading { position: relative; min-height: 260px; margin: 0; padding: 48px 47% 40px 48px; overflow: hidden; border-radius: 24px 24px 0 0; background: linear-gradient(135deg, #09275f 0%, #064e99 60%, #087eaa 100%); }
.formation-modal .demo-modal-heading::before { content: ''; position: absolute; width: 70%; height: 180%; right: 9%; top: -50%; transform: rotate(31deg); background: rgba(20, 138, 220, .2); border-left: 1px solid rgba(135, 227, 255, .32); }
.formation-modal .demo-modal-heading::after { content: '·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·'; position: absolute; right: 22px; top: 24px; width: 125px; color: rgba(151, 221, 255, .45); font-size: 15px; letter-spacing: 8px; line-height: 24px; opacity: .7; }
.formation-modal .demo-modal-title-wrap { position: relative; z-index: 2; align-items: flex-start; }
.formation-modal .demo-modal-icon { flex: 0 0 42px; color: #fff; background: linear-gradient(135deg, #2b8df2, #0b65df); }
.formation-modal .demo-modal-heading .eyebrow { color: #64e8ff; font-size: 12px; letter-spacing: .16em; }
.formation-modal .demo-modal-heading h3 { max-width: 650px; margin: 7px 0 10px; color: #fff; font-size: clamp(34px, 4vw, 51px); line-height: 1.04; }
.formation-modal .demo-modal-heading p:last-of-type { max-width: 600px; color: #e2f2ff; font-size: 15px; line-height: 1.6; }
.formation-modal .demo-modal-badge { padding: 8px 13px; color: #9cefff; background: rgba(55, 172, 244, .2); font-size: 11px; }
.formation-modal .demo-modal-heading > .public-review-close { position: absolute; z-index: 5; top: 20px; right: 20px; color: #e0f6ff; background: rgba(255, 255, 255, .13); }
.formation-modal .demo-modal-heading > .public-review-close:hover { color: #0a3b74; background: #fff; }
.formation-modal .demo-guide { position: relative; z-index: 3; grid-template-columns: 1.15fr .9fr 1.15fr; gap: 28px; margin: 22px 28px 28px; }
.formation-modal .demo-guide::before { content: ''; position: absolute; z-index: -1; top: 50%; right: 9%; left: 9%; border-top: 1px solid #c4d9ec; }
.formation-modal .demo-step { min-height: 76px; padding: 14px 18px; border: 1px solid #dce9f4; border-radius: 13px; background: #fff; box-shadow: 0 7px 18px rgba(13, 69, 113, .08); }
.formation-modal .demo-step b { flex: 0 0 34px; width: 34px; height: 34px; background: linear-gradient(135deg, #177af1, #0751c7); font-size: 14px; }
.formation-modal .demo-step strong { color: #142f59; font-size: 13px; }
.formation-modal .demo-step small { color: #7289a4; font-size: 11px; }
.formation-modal .demo-content-grid .demo-form { min-width: 0; padding: 0 !important; border: 1px solid #e0eaf3; border-radius: 15px; background: #fff; box-shadow: 0 10px 25px rgba(20, 78, 119, .05); }
.formation-modal .demo-content-grid .demo-form-intro { padding: 23px 29px 0; color: #6a82a0 !important; font-size: 12px !important; }
.formation-modal .demo-content-grid .demo-form-section-label { display: flex; align-items: center; gap: 11px; margin: 25px 0 14px; padding: 0 29px; color: #0967dd; font-size: 14px; letter-spacing: .08em; }
.formation-modal .demo-content-grid .demo-form-section-label span { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #187bf1, #0752c8); font-size: 13px; letter-spacing: 0; }
.formation-modal .demo-content-grid .demo-form > label, .formation-modal .demo-content-grid .demo-form > .field-row { margin-inline: 29px; }
.formation-modal .demo-content-grid .demo-form > .field-row { gap: 26px; }
.formation-modal .demo-content-grid .demo-form label { color: #19355f; font-size: 12px !important; }
.formation-modal .demo-content-grid .demo-form input, .formation-modal .demo-content-grid .demo-form select, .formation-modal .demo-content-grid .demo-form textarea { min-height: 52px !important; padding: 14px 15px !important; border: 1px solid #c6d9eb !important; border-radius: 10px !important; color: #19355f; background: #fff !important; font-size: 14px !important; }
.formation-modal .demo-content-grid .demo-form .privacy input { min-height: auto !important; width: 18px; height: 18px; padding: 0 !important; }
.formation-modal .demo-content-grid .demo-form > .button { display: flex; justify-content: center; width: calc(100% - 58px); margin: 25px 29px 0; min-height: 53px; border-radius: 10px; background: linear-gradient(135deg, #1164ef, #0874dc); box-shadow: 0 10px 20px rgba(17, 100, 239, .2); font-size: 15px; }
.formation-modal #formation-form-note { margin: 14px 29px 26px; color: #91a7c1; font-size: 11px; text-align: center; }

@media (max-width: 800px) {
  .formation-modal .demo-dialog { width: 100%; max-height: calc(100dvh - 20px); border-radius: 18px; }
  .formation-modal .demo-modal-heading { min-height: 225px; padding: 34px 24px 30px; border-radius: 18px 18px 0 0; }
  .formation-modal .demo-modal-heading h3 { max-width: 90%; font-size: 31px; }
  .formation-modal .demo-modal-heading p:last-of-type { max-width: 62%; font-size: 12px; }
  .formation-modal .demo-guide { grid-template-columns: 1fr; gap: 9px; margin: 16px 16px 18px; }
  .formation-modal .demo-guide::before { display: none; }
  .formation-modal .demo-content-grid .demo-form-intro { padding: 19px 18px 0; }
  .formation-modal .demo-content-grid .demo-form-section-label { padding-inline: 18px; }
  .formation-modal .demo-content-grid .demo-form > label, .formation-modal .demo-content-grid .demo-form > .field-row { margin-inline: 18px; }
  .formation-modal .demo-content-grid .demo-form > .field-row { gap: 0; }
  .formation-modal .demo-content-grid .demo-form > .button { width: calc(100% - 36px); margin-inline: 18px; }
.formation-modal #formation-form-note { margin-inline: 18px; }
}

/* Los popups altos se desplazan en su propia capa, también en móviles con barra del navegador. */
.public-review-modal:not(.hidden) {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: 100dvh;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.public-review-modal .public-review-dialog {
  flex: 0 0 auto;
  max-height: none;
  margin: 0;
  overflow: visible;
}
.public-review-modal .demo-dialog { width: min(1120px, calc(100vw - 32px)); }
.public-review-modal .public-review-backdrop { position: fixed; }

@media (max-width: 700px) {
  .public-review-modal:not(.hidden) { padding-inline: 10px; }
  .public-review-modal .public-review-dialog,
  .public-review-modal .demo-dialog { width: 100%; }
}

/* Adaptación visual del popup a la referencia: cabecera ilustrada, pasos y columna lateral. */
#demo-modal .demo-dialog { width: min(1120px, calc(100vw - 34px)); max-height: calc(100vh - 34px); padding: 0; overflow: auto; border: 1px solid #d7e5f2; border-radius: 24px; background: #f7fbff; }
#demo-modal .demo-modal-heading { position: relative; min-height: 260px; margin: 0; padding: 48px 47% 40px 48px; overflow: hidden; border-radius: 24px 24px 0 0; background: linear-gradient(135deg, #09275f 0%, #064e99 60%, #087eaa 100%); }
#demo-modal .demo-modal-heading::before { content: ''; position: absolute; width: 70%; height: 180%; right: 9%; top: -50%; transform: rotate(31deg); background: rgba(20, 138, 220, .2); border-left: 1px solid rgba(135, 227, 255, .32); }
#demo-modal .demo-modal-heading::after { content: '·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·'; position: absolute; right: 22px; top: 24px; width: 125px; color: rgba(151, 221, 255, .45); font-size: 15px; letter-spacing: 8px; line-height: 24px; opacity: .7; }
#demo-modal .demo-modal-title-wrap { position: relative; z-index: 2; align-items: flex-start; }
#demo-modal .demo-modal-icon { flex: 0 0 42px; color: #fff; background: linear-gradient(135deg, #2b8df2, #0b65df); }
#demo-modal .demo-modal-heading .eyebrow { color: #64e8ff; font-size: 12px; letter-spacing: .16em; }
#demo-modal .demo-modal-heading h3 { max-width: 650px; margin: 7px 0 10px; color: #fff; font-size: clamp(34px, 4vw, 51px); line-height: 1.04; }
#demo-modal .demo-modal-heading p:last-of-type { max-width: 600px; color: #e2f2ff; font-size: 15px; line-height: 1.6; }
#demo-modal .demo-modal-badge { padding: 8px 13px; color: #9cefff; background: rgba(55, 172, 244, .2); font-size: 11px; }
#demo-modal .demo-modal-heading > .public-review-close { position: absolute; z-index: 5; top: 20px; right: 20px; color: #e0f6ff; background: rgba(255, 255, 255, .13); }
#demo-modal .demo-modal-heading > .public-review-close:hover { color: #0a3b74; background: #fff; }
.demo-modal-art { position: absolute; z-index: 2; right: 5%; bottom: 15px; width: 35%; height: 205px; }
.demo-art-screen { position: absolute; right: 12%; top: 8px; display: grid; grid-template-columns: 92px 1fr; gap: 11px; align-items: center; width: 235px; height: 145px; padding: 23px 18px; transform: rotate(2deg); border: 2px solid rgba(216, 239, 255, .8); border-radius: 13px; background: linear-gradient(135deg, #dff1ff, #8db9e8); box-shadow: 0 18px 30px rgba(1, 19, 54, .28); }
.demo-art-play { display: grid; place-items: center; width: 74px; height: 59px; border-radius: 8px; color: #04b9d1; background: rgba(255, 255, 255, .75); font-size: 24px; }
.demo-art-screen i { display: block; width: 72px; height: 9px; border-radius: 99px; background: rgba(71, 147, 220, .38); }
.demo-art-screen i + i { width: 56px; }
.demo-art-calendar { position: absolute; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 20px); gap: 6px; width: 107px; padding: 28px 12px 12px; border-radius: 12px; background: #f3fbff; box-shadow: 0 15px 25px rgba(1, 19, 54, .28); }
.demo-art-calendar::before { content: ''; position: absolute; inset: 0 0 auto; height: 28px; border-radius: 12px 12px 0 0; background: #08b6d0; }
.demo-art-calendar::after { content: ''; position: absolute; top: 9px; left: 22px; width: 7px; height: 13px; border: 2px solid #fff; border-bottom: 0; border-radius: 4px 4px 0 0; box-shadow: 52px 0 0 -2px #fff; }
.demo-art-calendar span { width: 20px; height: 20px; border-radius: 4px; background: #cfe4f8; }
#demo-modal .demo-guide { position: relative; z-index: 3; grid-template-columns: 1.15fr .9fr 1.15fr; gap: 28px; margin: 22px 28px 28px; }
#demo-modal .demo-guide::before { content: ''; position: absolute; z-index: -1; top: 50%; right: 9%; left: 9%; border-top: 1px solid #c4d9ec; }
#demo-modal .demo-step { min-height: 76px; padding: 14px 18px; border: 1px solid #dce9f4; border-radius: 13px; background: #fff; box-shadow: 0 7px 18px rgba(13, 69, 113, .08); }
#demo-modal .demo-step b { flex: 0 0 34px; width: 34px; height: 34px; background: linear-gradient(135deg, #177af1, #0751c7); font-size: 14px; }
#demo-modal .demo-step strong { color: #142f59; font-size: 13px; }
#demo-modal .demo-step small { color: #7289a4; font-size: 11px; }
.demo-content-grid { display: grid; grid-template-columns: 255px minmax(0, 1fr); gap: 14px; margin: 0 28px 28px; }
.demo-sidebar { min-height: 740px; padding: 54px 24px 30px; border: 1px solid #e0ecf5; border-radius: 15px; color: #496686; background: linear-gradient(180deg, #eef8ff, #f8fbfe); text-align: center; }
.demo-sidebar-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 20px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #1680f2, #0c66d8); box-shadow: 0 9px 20px rgba(20, 125, 255, .2); font-size: 28px; }
.demo-sidebar h4 { margin: 0 0 13px; color: #122f5a; font-size: 16px; }
.demo-sidebar > p { margin: 0 0 5px; font-size: 14px; line-height: 1.65; }
.demo-sidebar > strong { display: block; color: #496686; font-size: 14px; line-height: 1.55; }
.demo-sidebar-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 48px 0 28px; padding: 17px 10px 14px; border-top: 1px solid #ccdfef; border-bottom: 1px solid #ccdfef; }
.demo-sidebar-calendar b { grid-column: 1 / -1; margin-bottom: 7px; color: #1671d4; font-size: 9px; letter-spacing: .1em; }
.demo-sidebar-calendar i { width: 15px; height: 15px; border-radius: 3px; background: #cfe4f8; }
.demo-sidebar hr { border: 0; border-top: 1px solid #ccdfef; }
.demo-sidebar-message { margin-top: 28px; margin-bottom: 13px; color: #1478e5; background: #dceeff; box-shadow: none; }
.demo-sidebar-message + p { color: #516e91; font-size: 14px; }
.demo-content-grid .demo-form { min-width: 0; padding: 0 !important; border: 1px solid #e0eaf3; border-radius: 15px; background: #fff; box-shadow: 0 10px 25px rgba(20, 78, 119, .05); }
.demo-content-grid .demo-form-intro { padding: 23px 29px 0; color: #6a82a0 !important; font-size: 12px !important; }
.demo-content-grid .demo-form-section-label { display: flex; align-items: center; gap: 11px; margin: 25px 0 14px; padding: 0 29px; color: #0967dd; font-size: 14px; letter-spacing: .08em; }
.demo-content-grid .demo-form-section-label span { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #187bf1, #0752c8); font-size: 13px; letter-spacing: 0; }
.demo-content-grid .demo-form > label, .demo-content-grid .demo-form > .field-row { margin-inline: 29px; }
.demo-content-grid .demo-form > .field-row { gap: 26px; }
.demo-content-grid .demo-form label { color: #19355f; font-size: 12px !important; }
.demo-content-grid .demo-form input, .demo-content-grid .demo-form select, .demo-content-grid .demo-form textarea { min-height: 52px !important; padding: 14px 15px !important; border: 1px solid #c6d9eb !important; border-radius: 10px !important; color: #19355f; background: #fff !important; font-size: 14px !important; }
.demo-content-grid .demo-form textarea { min-height: 100px !important; }
.demo-content-grid .demo-form .demo-duration { min-height: 52px; padding: 0 16px; border: 1px solid #acd3fa; border-radius: 10px; color: #6590bd; background: #f2f8ff; font-size: 12px; }
.demo-content-grid .demo-form .demo-duration strong { color: #1472dd; font-size: 15px; }
.demo-content-grid .demo-form .privacy { display: flex; align-items: center; gap: 9px; margin-top: 22px; color: #526d8e; font-size: 12px !important; }
.demo-content-grid .demo-form .privacy input { min-height: auto !important; width: 18px; height: 18px; padding: 0 !important; }
.demo-content-grid .demo-form > .button { display: flex; justify-content: center; width: calc(100% - 58px); margin: 25px 29px 0; min-height: 53px; border-radius: 10px; background: linear-gradient(135deg, #1164ef, #0874dc); box-shadow: 0 10px 20px rgba(17, 100, 239, .2); font-size: 15px; }
.demo-content-grid .demo-form #demo-form-note { margin: 14px 29px 26px; color: #91a7c1; font-size: 11px; text-align: center; }

@media (max-width: 800px) {
  #demo-modal .demo-dialog { width: 100%; max-height: calc(100dvh - 20px); border-radius: 18px; }
  #demo-modal .demo-modal-heading { min-height: 225px; padding: 34px 24px 30px; border-radius: 18px 18px 0 0; }
  #demo-modal .demo-modal-heading h3 { max-width: 90%; font-size: 31px; }
  #demo-modal .demo-modal-heading p:last-of-type { max-width: 62%; font-size: 12px; }
  .demo-modal-art { right: 2%; bottom: 8px; width: 42%; transform: scale(.72); transform-origin: right bottom; }
  #demo-modal .demo-guide { grid-template-columns: 1fr; gap: 9px; margin: 16px 16px 18px; }
  #demo-modal .demo-guide::before { display: none; }
  .demo-content-grid { grid-template-columns: 1fr; margin: 0 16px 16px; }
  .demo-sidebar { order: 2; min-height: 0; padding: 28px 20px; }
  .demo-sidebar-calendar, .demo-sidebar-message { display: none; }
  .demo-content-grid .demo-form { order: 1; }
  .demo-content-grid .demo-form-intro { padding: 19px 18px 0; }
  .demo-content-grid .demo-form-section-label { padding-inline: 18px; }
  .demo-content-grid .demo-form > label, .demo-content-grid .demo-form > .field-row { margin-inline: 18px; }
  .demo-content-grid .demo-form > .field-row { gap: 0; }
  .demo-content-grid .demo-form > .button { width: calc(100% - 36px); margin-inline: 18px; }
  .demo-content-grid .demo-form #demo-form-note { margin-inline: 18px; }
}

/* Prioridad final: el scroll lo gestiona el popup completo y no una caja anidada. */
#demo-modal .demo-dialog,
.formation-modal .demo-dialog { max-height: none; overflow: visible; }

/* Popups de demo y formación: diseño estable en pantallas táctiles y móviles pequeños. */
body.modal-open { overflow: hidden; }
#demo-modal:not(.hidden),
.formation-modal:not(.hidden) {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
#demo-modal .demo-dialog,
.formation-modal .demo-dialog {
  flex: 0 0 auto;
  width: min(1120px, calc(100vw - 24px));
  max-height: none;
  overflow: visible;
  margin: 0;
}
#demo-modal .demo-modal-heading,
.formation-modal .demo-modal-heading { isolation: isolate; }
#demo-modal .demo-form .g-recaptcha,
.formation-modal .demo-form .g-recaptcha {
  display: flex;
  justify-content: center;
  min-height: 78px;
  overflow: visible;
}

@media (max-width: 800px) {
  #demo-modal:not(.hidden),
  .formation-modal:not(.hidden) {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
  }
  #demo-modal .demo-dialog,
  .formation-modal .demo-dialog {
    width: 100%;
    border-radius: 20px;
  }
  #demo-modal .demo-modal-heading,
  .formation-modal .demo-modal-heading {
    min-height: 0;
    padding: 26px 20px 23px;
    border-radius: 20px 20px 0 0;
  }
  #demo-modal .demo-modal-title-wrap,
  .formation-modal .demo-modal-title-wrap { padding-right: 25px; }
  #demo-modal .demo-modal-heading h3,
  .formation-modal .demo-modal-heading h3 {
    max-width: 100%;
    margin-top: 6px;
    font-size: clamp(28px, 8vw, 36px);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }
  #demo-modal .demo-modal-heading p:last-of-type,
  .formation-modal .demo-modal-heading p:last-of-type {
    max-width: 100%;
    font-size: 13px;
    line-height: 1.5;
  }
  #demo-modal .demo-modal-badge,
  .formation-modal .demo-modal-badge { max-width: 100%; font-size: 10px; line-height: 1.35; white-space: normal; }
  #demo-modal .demo-modal-art,
  .formation-modal .demo-modal-art { display: none; }
  #demo-modal .demo-modal-heading > .public-review-close,
  .formation-modal .demo-modal-heading > .public-review-close {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
  }
  #demo-modal .demo-guide,
  .formation-modal .demo-guide {
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 14px 12px 15px;
  }
  #demo-modal .demo-guide::before,
  .formation-modal .demo-guide::before { display: none; }
  #demo-modal .demo-step,
  .formation-modal .demo-step { min-height: 0; padding: 10px 12px; }
  #demo-modal .demo-step strong,
  .formation-modal .demo-step strong { font-size: 12px; }
  #demo-modal .demo-step small,
  .formation-modal .demo-step small { font-size: 10px; }
  #demo-modal .demo-content-grid,
  .formation-modal .demo-content-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0 12px 12px;
  }
  #demo-modal .demo-sidebar,
  .formation-modal .demo-sidebar {
    order: 2;
    min-height: 0;
    padding: 22px 16px;
  }
  #demo-modal .demo-sidebar-calendar,
  .formation-modal .demo-sidebar-calendar,
  #demo-modal .demo-sidebar-message,
  .formation-modal .demo-sidebar-message { display: none; }
  #demo-modal .demo-content-grid .demo-form,
  .formation-modal .demo-content-grid .demo-form {
    order: 1;
    border-radius: 14px;
  }
  #demo-modal .demo-content-grid .demo-form-intro,
  .formation-modal .demo-content-grid .demo-form-intro { padding: 18px 16px 0; font-size: 12px !important; line-height: 1.5; }
  #demo-modal .demo-content-grid .demo-form-section-label,
  .formation-modal .demo-content-grid .demo-form-section-label {
    gap: 8px;
    margin-top: 21px;
    margin-bottom: 12px;
    padding-inline: 16px;
    font-size: 12px;
    line-height: 1.25;
  }
  #demo-modal .demo-content-grid .demo-form-section-label span,
  .formation-modal .demo-content-grid .demo-form-section-label span { flex-basis: 26px; width: 26px; height: 26px; font-size: 12px; }
  #demo-modal .demo-content-grid .demo-form > label,
  #demo-modal .demo-content-grid .demo-form > .field-row,
  .formation-modal .demo-content-grid .demo-form > label,
  .formation-modal .demo-content-grid .demo-form > .field-row { margin-inline: 16px; }
  #demo-modal .demo-content-grid .demo-form > .field-row,
  .formation-modal .demo-content-grid .demo-form > .field-row { grid-template-columns: 1fr; gap: 0; }
  #demo-modal .demo-content-grid .demo-form label,
  .formation-modal .demo-content-grid .demo-form label { font-size: 12px !important; line-height: 1.35; }
  #demo-modal .demo-content-grid .demo-form input,
  #demo-modal .demo-content-grid .demo-form select,
  #demo-modal .demo-content-grid .demo-form textarea,
  .formation-modal .demo-content-grid .demo-form input,
  .formation-modal .demo-content-grid .demo-form select,
  .formation-modal .demo-content-grid .demo-form textarea {
    min-height: 52px !important;
    padding: 14px 13px !important;
    font-size: 16px !important;
    line-height: 1.25;
  }
  #demo-modal .demo-content-grid .demo-form textarea,
  .formation-modal .demo-content-grid .demo-form textarea { min-height: 105px !important; }
  #demo-modal .demo-content-grid .demo-form .demo-duration,
  .formation-modal .demo-content-grid .demo-form .demo-duration { min-height: 52px; margin-bottom: 12px; font-size: 12px; }
  #demo-modal .demo-content-grid .demo-form .privacy,
  .formation-modal .demo-content-grid .demo-form .privacy { align-items: flex-start; margin-top: 17px; font-size: 12px !important; line-height: 1.45; }
  #demo-modal .demo-content-grid .demo-form .privacy input,
  .formation-modal .demo-content-grid .demo-form .privacy input { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; }
  #demo-modal .demo-content-grid .demo-form > .button,
  .formation-modal .demo-content-grid .demo-form > .button {
    width: calc(100% - 32px);
    min-height: 54px;
    margin: 22px 16px 0;
    padding-inline: 15px;
    font-size: 15px;
  }
  #demo-modal .demo-content-grid .demo-form #demo-form-note,
  .formation-modal .demo-content-grid .demo-form #formation-form-note { margin: 13px 16px 20px; line-height: 1.5; }
  #demo-modal .demo-form .g-recaptcha,
  .formation-modal .demo-form .g-recaptcha { min-height: 72px; align-items: flex-start; }
  #demo-modal .demo-form .g-recaptcha > div,
  .formation-modal .demo-form .g-recaptcha > div { transform: scale(.9); transform-origin: center top; }
  #demo-modal .neo-custom-select-trigger,
  .formation-modal .neo-custom-select-trigger { min-height: 52px; padding-inline: 13px; font-size: 16px; }
  #demo-modal .neo-custom-select-menu,
  .formation-modal .neo-custom-select-menu { max-height: min(240px, 34vh); }
}

@media (max-width: 380px) {
  #demo-modal .demo-modal-heading,
  .formation-modal .demo-modal-heading { padding-inline: 16px; }
  #demo-modal .demo-guide,
  .formation-modal .demo-guide,
  #demo-modal .demo-content-grid,
  .formation-modal .demo-content-grid { margin-inline: 9px; }
  #demo-modal .demo-content-grid .demo-form-intro,
  #demo-modal .demo-content-grid .demo-form-section-label,
  .formation-modal .demo-content-grid .demo-form-intro,
  .formation-modal .demo-content-grid .demo-form-section-label { padding-inline: 13px; }
  #demo-modal .demo-content-grid .demo-form > label,
  #demo-modal .demo-content-grid .demo-form > .field-row,
  .formation-modal .demo-content-grid .demo-form > label,
  .formation-modal .demo-content-grid .demo-form > .field-row { margin-inline: 13px; }
  #demo-modal .demo-content-grid .demo-form > .button,
  .formation-modal .demo-content-grid .demo-form > .button { width: calc(100% - 26px); margin-inline: 13px; }
  #demo-modal .demo-content-grid .demo-form #demo-form-note,
  .formation-modal .demo-content-grid .demo-form #formation-form-note { margin-inline: 13px; }
  #demo-modal .demo-form .g-recaptcha > div,
  .formation-modal .demo-form .g-recaptcha > div { transform: scale(.84); }
}

@media (max-width: 800px) and (orientation: landscape) {
  #demo-modal:not(.hidden),
  .formation-modal:not(.hidden) { padding-block: 6px; }
  #demo-modal .demo-modal-heading,
  .formation-modal .demo-modal-heading { padding-block: 19px; }
  #demo-modal .demo-modal-heading h3,
  .formation-modal .demo-modal-heading h3 { font-size: clamp(25px, 6vw, 32px); }
  #demo-modal .demo-modal-heading p:last-of-type,
  .formation-modal .demo-modal-heading p:last-of-type { font-size: 12px; }
  #demo-modal .demo-guide,
  .formation-modal .demo-guide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #demo-modal .demo-step,
  .formation-modal .demo-step { padding: 9px; }
  #demo-modal .demo-step strong,
  .formation-modal .demo-step strong,
  #demo-modal .demo-step small,
  .formation-modal .demo-step small { white-space: normal; }
}

@media (max-width: 340px) {
  #demo-modal .demo-modal-heading,
  .formation-modal .demo-modal-heading { padding-inline: 13px; }
  #demo-modal .demo-modal-heading h3,
  .formation-modal .demo-modal-heading h3 { font-size: 26px; }
  #demo-modal .demo-modal-heading p:last-of-type,
  .formation-modal .demo-modal-heading p:last-of-type { font-size: 12px; }
  #demo-modal .demo-form .g-recaptcha > div,
  .formation-modal .demo-form .g-recaptcha > div { transform: scale(.76); }
}
