/* Focused responsive corrections for the existing NinoDirect layouts.
   Keep the current theme and content intact; this file only repairs sizing,
   stacking, clipping and visibility issues. */

/* The server-rendered public footer is pale, so the white-filtered brand mark
   and low-contrast muted copy otherwise disappear against it. */
.nd-public-footer .footer-brand {
  filter: none !important;
}
.nd-public-footer .text-muted,
.nd-public-footer .text-gray-700,
.nd-public-footer li,
.nd-public-footer p {
  color: #506690 !important;
}
.nd-public-footer a {
  color: #335eea;
}
/* The original muted text and badge colors were barely visible on navy. */
section.bg-dark .text-muted,
section.bg-dark .text-gray-700,
section.bg-dark .badge {
  color: #cbd5e1 !important;
}

/* Keep the Apply menu inside the viewport and above nearby page content. */
.nd-public-nav {
  overflow: visible;
}
.nd-public-nav .dropdown-menu {
  z-index: 1040;
  max-width: calc(100vw - 2rem);
  max-height: max(140px, calc(100dvh - var(--nd-consent-height, 0px) - 7rem));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.nd-public-nav .dropdown-menu .list-group-item > .icon {
  flex: 0 0 24px;
}
.nd-public-nav .dropdown-menu .list-group-item > div:last-child {
  min-width: 0;
}

/* Do not let the scroll-reveal helper hide whole sections, rows, cards or
   footers when a visitor lands mid-page or the observer has not fired yet. */
.nd-motion-ready,
.nd-motion-ready.nd-motion-visible {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* The homepage keeps its custom white, two-column hero; relax its unusually
   wide desktop gap before the stacked mobile breakpoint to prevent squeezing. */
.nd-home-hero {
  min-height: 0;
}
.nd-home-hero .nd-hero-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .9fr);
  gap: clamp(24px, 5vw, 64px);
}
.nd-home-hero .nd-hero-grid > *,
.nd-home-hero .nd-feature-copy {
  min-width: 0;
}

/* Keep decorative transitions in their own vertical space rather than
   letting oversized SVGs paint across the next section at narrow widths. */
.nd-home-divider {
  position: relative;
  z-index: 0;
  margin: 0;
}
.nd-home-divider svg {
  max-width: 100%;
}

/* Form fields and action rows should shrink with their grid column, rather
   than forcing horizontal page overflow at narrow widths. */
form,
fieldset,
form .row > *,
form .form-group {
  min-width: 0;
}
.form-control,
.form-select,
textarea {
  max-width: 100%;
}
.text-gray-800,
.alert {
  overflow-wrap: anywhere;
}

/* The helper places the existing consent notice before the navigation.
   Give it real document space instead of covering page content or actions. */
.cc-window.cc-banner,
.cc-window.cc-floating {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 0;
  box-sizing: border-box;
  flex-wrap: wrap;
  z-index: 1060 !important;
}
.cc-window .cc-message {
  min-width: 0;
  flex: 1 1 240px;
  overflow-wrap: anywhere;
}
.cc-window .cc-compliance {
  flex: 0 0 auto;
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  .nd-home-hero .nd-hero-grid {
    gap: clamp(24px, 4vw, 48px);
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .9fr);
  }
}

@media (max-width: 991.98px) {
  .nd-public-nav .navbar-collapse {
    max-height: max(140px, calc(100dvh - var(--nd-consent-height, 0px) - 2rem));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nd-public-nav .dropdown-menu {
    position: static;
    width: 100%;
    max-width: 100%;
    max-height: none;
    overflow: visible;
    margin: .25rem 0 .75rem;
    box-shadow: none;
  }
  .nd-public-nav .navbar-collapse .dropdown-menu .list-group-item {
    padding-inline: .75rem;
  }
}

@media (max-width: 767.98px) {
  .nd-home-hero .nd-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
  .nd-home-hero .nd-featured {
    width: 100%;
    max-width: 480px;
  }
  .nd-home-hero .nd-hero-image {
    width: 100%;
    margin-left: 0;
  }

  /* On small screens the postcode field and its adjacent action were kept
     at intrinsic col-auto widths, which can push beyond the form column. */
  .form-group > .row.g-3 > .col-auto {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
  }
  .form-group > .row.g-3 > .col-auto .form-control,
  .form-group > .row.g-3 > .col-auto .btn {
    width: 100%;
  }

  .cc-window.cc-banner {
    padding: 1rem;
    gap: .75rem;
    flex-direction: row;
    align-items: center;
  }
  .cc-window.cc-banner .cc-message {
    margin: 0;
    font-size: .9375rem;
    line-height: 1.5;
  }
  .cc-window.cc-banner .cc-compliance .cc-btn {
    padding: .65rem 1rem;
  }
}

@media (max-width: 359.98px) {
  .nd-public-nav .navbar-brand-img {
    max-width: 132px;
  }
  .nd-public-nav .navbar-toggler {
    margin-left: .35rem;
    padding-inline: .5rem;
  }
  .nd-home-hero .nd-feature,
  .nd-home-hero .nd-account {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 10px;
  }
  .nd-home-hero .nd-feature-icon,
  .nd-home-hero .nd-feature-icon--blue {
    width: 60px;
    height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nd-motion-ready,
  .nd-motion-ready.nd-motion-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
