/* Responsive refinements shared by Home, Visa Check, and Admin.
   Load this file after style.css and modern-home.css. */

/* Modern fading image carousel */
.hero-background {
  background: #d9eaff;
}

.hero-background .hero-art-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
  opacity: 0;
  transform: scale(1.045);
  filter: saturate(1.06) contrast(1.025);
  transition: opacity 0.62s ease-in-out, transform 2.8s ease-out;
  will-change: opacity, transform;
}

.hero-background .hero-art-image.is-active {
  z-index: 1;
  opacity: 1;
  transform: scale(1);
}

.hero-slide-japan { object-position: center 54% !important; }
.hero-slide-europe { object-position: center 48% !important; }
.hero-slide-americas { object-position: center 48% !important; }
.hero-slide-oceania { object-position: center 51% !important; }

.hero-image-overlay {
  background:
    linear-gradient(90deg,
      rgba(247, 251, 255, 0.96) 0%,
      rgba(247, 251, 255, 0.87) 27%,
      rgba(247, 251, 255, 0.60) 43%,
      rgba(247, 251, 255, 0.12) 67%,
      rgba(5, 23, 55, 0.04) 100%),
    linear-gradient(0deg, rgba(7, 29, 67, 0.12), transparent 37%);
}

.hero-title-accent {
  color: #0b50bf;
}

.home-page .hero-title {
  font-size: clamp(2.35rem, 3.5vw, 3.2rem);
  line-height: 1.08;
  text-wrap: balance;
}

.hero-slider-controls {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 0.8rem;
}

.hero-slider-dot {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(11, 36, 80, 0.28);
  cursor: pointer;
  transition: width 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
}

.hero-slider-dot:hover,
.hero-slider-dot:focus-visible {
  background: #0b50bf;
  outline: 2px solid rgba(11, 80, 191, 0.18);
  outline-offset: 3px;
}

.hero-slider-dot.active {
  width: 1.45rem;
  background: #0b50bf;
}

/* Prevent accidental viewport-wide horizontal scroll on small screens. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

.container,
.container-fluid,
.row,
.card,
.card-body,
.card-header,
.navbar,
.navbar-collapse {
  min-width: 0;
}

.site-footer .footer-description,
.site-footer .footer-links a,
.site-footer .footer-bottom p {
  overflow-wrap: anywhere;
}

/* Tablet and mobile: header occupies its own document space, never over the hero. */
@media (max-width: 991.98px) {
  .site-navbar-container {
    max-width: 100%;
    padding-inline: 1rem;
    flex-wrap: wrap;
    column-gap: 0.65rem;
    row-gap: 0.5rem;
  }

  .home-page .site-header {
    position: relative;
    inset: auto;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 1px 0 rgba(216, 228, 243, 0.82);
  }

  .home-page .site-navbar,
  .inner-page .site-navbar {
    position: relative;
    min-height: 0;
    padding-block: 0.62rem;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid rgba(219, 229, 243, 0.9) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .site-brand {
    max-width: calc(100% - 3.7rem);
    margin-right: auto;
  }

  .site-navbar-toggler {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .site-navbar .navbar-collapse {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    margin-top: 0.55rem;
    padding: 0.85rem;
    overflow: visible;
  }

  .site-nav-pills {
    width: 100%;
    max-width: 100%;
  }

  .site-nav-pills .nav-item,
  .site-nav-pills .nav-link {
    min-width: 0;
  }

  .site-nav-pills .nav-link {
    white-space: normal;
    text-align: left;
  }

  .site-nav-actions {
    display: flex;
    width: 100%;
    align-items: center;
    margin-top: 0.75rem;
  }

  .nav-search-button,
  .site-nav-actions .admin-nav-link {
    min-height: 2.55rem;
  }

  .country-mega-menu {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none;
    margin: 0.4rem 0 0 !important;
    padding: 0.8rem !important;
    overflow: visible;
    box-shadow: none;
    border-radius: 0.85rem;
  }

  .country-menu-heading {
    flex-wrap: wrap;
  }

  .country-menu-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(38vh, 280px);
  }

  /* Put all hero content in normal flow on tablet/mobile. */
  .home-page .hero-section {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .home-page .hero-container {
    max-width: 100%;
    padding: 2.5rem 1.5rem 1.35rem;
  }

  .home-page .hero-copy-column {
    width: 100%;
    max-width: 620px;
  }

  .home-page .hero-title {
    max-width: 100%;
    font-size: clamp(2.15rem, 5.2vw, 3.25rem);
    line-height: 1.07;
    letter-spacing: -0.055em;
    text-wrap: balance;
  }

  .home-page .hero-description {
    max-width: 34rem;
  }

  .home-page .hero-information-card {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(370px, calc(100% - 3rem));
    max-width: 100%;
    margin: 0 1.5rem 1.4rem auto;
  }

  .quick-access-section {
    margin-top: -0.55rem;
  }

  .home-wide-container {
    padding-inline: 1rem;
  }

  .destination-highlights-section {
    padding-block: 1.1rem 1.3rem;
  }

  .destination-marquee-arrow {
    width: 2.35rem;
    height: 2.35rem;
  }
}

@media (max-width: 767.98px) {
  .site-navbar-container {
    padding-inline: 0.85rem;
  }

  .site-brand .brand-mark {
    width: 2.35rem;
    height: 2.35rem;
    flex-basis: 2.35rem;
    font-size: 1.23rem;
  }

  .site-brand .brand-name {
    font-size: clamp(0.98rem, 4vw, 1.12rem);
  }

  .site-brand .brand-tagline {
    max-width: 14.5rem;
    overflow: hidden;
    font-size: 0.56rem;
    text-overflow: ellipsis;
  }

  .site-navbar .navbar-collapse {
    padding: 0.7rem;
    border-radius: 1rem;
  }

  .country-menu-list {
    grid-template-columns: minmax(0, 1fr);
    max-height: 34vh;
  }

  .country-menu-option {
    min-height: 2.55rem;
  }

  .home-page .hero-section {
    overflow: hidden;
  }

  .home-page .hero-background .hero-art-image {
    object-position: 58% center;
  }

  .home-page .hero-image-overlay {
    background:
      linear-gradient(90deg,
        rgba(247, 251, 255, 0.97) 0%,
        rgba(247, 251, 255, 0.91) 54%,
        rgba(247, 251, 255, 0.66) 100%),
      linear-gradient(0deg, rgba(7, 29, 67, 0.1), transparent 42%);
  }

  .home-page .hero-container {
    padding: 2rem 1rem 1.2rem;
  }

  .home-page .hero-eyebrow {
    margin-bottom: 0.55rem !important;
    font-size: 0.62rem;
    letter-spacing: 0.105em;
  }

  .home-page .hero-title br {
    display: none;
  }

  .home-page .hero-title {
    max-width: 100%;
    margin-bottom: 0.85rem !important;
    font-size: clamp(2rem, 8.5vw, 2.75rem);
    line-height: 1.06;
    letter-spacing: -0.055em;
    text-wrap: balance;
  }

  .home-page .hero-description {
    max-width: 100%;
    margin-bottom: 1.15rem !important;
    font-size: 0.88rem;
    line-height: 1.58;
  }

  .home-page .hero-actions {
    gap: 0.6rem !important;
    margin-bottom: 1.2rem !important;
  }

  .home-page .hero-actions .btn {
    min-height: 2.65rem;
    padding: 0.62rem 0.92rem;
    font-size: 0.78rem;
  }

  .home-page .hero-trust-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.7rem 0.85rem;
    margin-top: 0.1rem;
  }

  .home-page .hero-trust-divider {
    display: none;
  }

  .home-page .hero-trust-item {
    min-width: calc(50% - 0.6rem);
    gap: 0.42rem;
    font-size: 0.64rem;
  }

  .home-page .hero-trust-icon {
    width: 1.9rem;
    height: 1.9rem;
    flex-basis: 1.9rem;
  }

  .hero-slider-controls {
    margin-top: 0.9rem !important;
    margin-bottom: 0.2rem;
  }

  .home-page .hero-information-card {
    width: calc(100% - 2rem);
    margin: 0 1rem 1.15rem;
    padding: 0.65rem 0.7rem;
    gap: 0.55rem;
  }

  .hero-information-icon {
    width: 2.15rem;
    height: 2.15rem;
    flex-basis: 2.15rem;
  }

  .hero-information-copy strong {
    font-size: 0.75rem;
  }

  .hero-information-copy > span {
    font-size: 0.65rem;
  }

  .quick-access-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.45rem;
    border-radius: 1.05rem;
  }

  .quick-access-item {
    min-height: 6rem;
    padding: 0.55rem 0.25rem;
  }

  .quick-access-item::after {
    display: none;
  }

  .quick-access-item:nth-child(odd):not(:last-child) {
    border-right: 1px solid #e5ebf4;
  }

  .quick-access-item:not(:nth-last-child(-n + 2)) {
    border-bottom: 1px solid #e5ebf4;
  }

  .quick-access-item:nth-child(5) {
    grid-column: 1 / -1;
    border-right: 0 !important;
    border-bottom: 0 !important;
  }

  .quick-access-item strong {
    font-size: 0.74rem;
    white-space: normal;
  }

  .quick-access-item > span:last-child {
    font-size: 0.64rem;
    text-wrap: balance;
  }

  .destination-highlights-section .home-wide-container {
    padding-inline: 0.5rem;
  }

  .destination-marquee-track {
    animation-duration: 46s;
  }

  .destination-marquee-group {
    gap: 0.65rem;
    padding-right: 0.65rem;
  }

  .destination-card {
    flex-basis: min(77vw, 280px);
    min-height: 190px;
    padding: 0.75rem;
  }

  .destination-card h3 {
    font-size: 0.96rem;
  }

  .destination-card p {
    font-size: 0.68rem;
  }

  .destination-marquee-arrow {
    width: 2rem;
    height: 2rem;
    font-size: 0.8rem;
  }

  /* Visa-check page */
  .visa-check-main {
    padding-top: 1.65rem !important;
    padding-bottom: 2.75rem !important;
  }

  .visa-check-intro {
    margin-bottom: 1.5rem !important;
  }

  .visa-check-intro .display-5 {
    font-size: clamp(1.8rem, 7vw, 2.45rem);
    line-height: 1.12;
    text-wrap: balance;
  }

  .visa-check-intro p {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .visa-search-panel .card-body,
  .applicant-result-panel .card-body {
    padding: 1rem !important;
  }

  .visa-search-panel,
  .applicant-result-panel,
  .admin-form-card,
  .admin-records-card {
    border-radius: 1rem;
  }

  .visa-search-panel .form-control,
  .visa-search-panel .form-select,
  .visa-search-panel .wvc-country-toggle {
    min-height: 2.8rem;
    font-size: 0.9rem;
  }

  .visa-search-panel .form-select-lg.wvc-country-toggle {
    min-height: 3rem;
  }

  .applicant-result-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem;
  }

  .applicant-result-header h2 {
    font-size: 1rem;
  }

  .result-stat-box {
    min-height: 4.35rem;
    padding: 0.75rem;
  }

  .applicant-detail-row {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0;
  }

  .applicant-detail-row span,
  .applicant-detail-row strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: left;
  }

  .country-result {
    justify-content: flex-start;
  }

  .result-download-row {
    align-items: stretch !important;
  }

  .result-pdf-button {
    width: 100%;
    min-height: 2.6rem;
  }

  /* Admin dashboard */
  .admin-main {
    padding-top: 1.35rem !important;
    padding-bottom: 2rem !important;
  }

  .admin-main > .container {
    padding-inline: 0.75rem;
  }

  .admin-page-heading {
    align-items: stretch !important;
    margin-bottom: 1.25rem !important;
  }

  .admin-page-heading h1 {
    font-size: clamp(1.7rem, 6.8vw, 2.3rem);
    line-height: 1.12;
  }

  .admin-page-heading .btn,
  .admin-page-heading .btn-group {
    width: 100%;
  }

  .admin-page .card-header,
  .admin-page .card-body,
  .admin-page .card-footer {
    padding: 1rem !important;
  }

  .admin-page .card-header .d-flex.align-items-center {
    align-items: flex-start !important;
  }

  .admin-page .section-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
  }

  .admin-form-section {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }

  .admin-form-section-title {
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.9rem;
  }

  .admin-page .form-control,
  .admin-page .form-select,
  .admin-page .wvc-country-toggle {
    min-width: 0;
    font-size: 0.9rem;
  }

  .record-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    gap: 0.6rem;
  }

  .record-toolbar .input-group,
  .record-toolbar .form-select {
    width: 100%;
    min-width: 0;
  }

  .admin-table {
    min-width: 720px;
  }

  .admin-page .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .admin-page .card-footer > .d-flex {
    width: 100%;
  }

  .admin-page .card-footer .btn {
    flex: 1 1 auto;
  }

  /* Shared footer */
  .site-footer .container {
    padding-inline: 1rem;
  }

  .site-footer .row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1.5rem;
  }

  .site-footer .footer-brand {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .site-footer .footer-heading {
    font-size: 0.82rem;
  }

  .site-footer .footer-links a {
    font-size: 0.77rem;
    line-height: 1.55;
  }

  .site-footer .footer-bottom {
    margin-top: 1.5rem !important;
    padding-top: 1rem !important;
  }

  .site-footer .footer-bottom p {
    font-size: 0.72rem;
    line-height: 1.5;
  }
}

@media (max-width: 420px) {
  .site-navbar-container {
    padding-inline: 0.7rem;
  }

  .site-brand {
    gap: 0.4rem !important;
  }

  .site-brand .brand-mark {
    width: 2.05rem;
    height: 2.05rem;
    flex-basis: 2.05rem;
    font-size: 1.08rem;
  }

  .site-brand .brand-name {
    font-size: 0.92rem;
  }

  .site-brand .brand-tagline {
    max-width: 12.5rem;
    font-size: 0.5rem;
  }

  .site-navbar-toggler {
    padding: 0.3rem 0.42rem;
  }

  .home-page .hero-container {
    padding-inline: 0.9rem;
  }

  .home-page .hero-title {
    font-size: clamp(1.85rem, 8.4vw, 2.25rem);
  }

  .home-page .hero-actions {
    align-items: stretch !important;
  }

  .home-page .hero-actions .btn {
    flex: 1 1 auto;
    padding-inline: 0.7rem;
  }

  .home-page .hero-trust-item {
    min-width: calc(50% - 0.5rem);
    font-size: 0.61rem;
  }

  .quick-access-item {
    min-height: 5.7rem;
  }

  .quick-access-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.75rem;
  }

  .destination-card {
    flex-basis: 78vw;
    min-height: 175px;
  }

  .visa-check-intro .display-5 {
    font-size: 1.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-background .hero-art-image {
    transition: none;
    transform: none;
  }

  .hero-slider-dot {
    transition: none;
  }
}


/* Clear card rhythm for the continuously moving destination ribbon. */
.destination-marquee-track {
  gap: 0;
}

.destination-marquee-group {
  gap: 1.15rem !important;
  padding-right: 1.15rem !important;
}

.destination-card {
  flex-shrink: 0;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1.35rem rgba(16, 43, 83, 0.10);
}

@media (max-width: 767.98px) {
  .destination-marquee-group {
    gap: 0.9rem !important;
    padding-right: 0.9rem !important;
  }
}

/* --------------------------------------------------------------------------
   Final interaction polish: consistent action buttons and clean destination loop
   -------------------------------------------------------------------------- */

/* Make destination cards discrete and prevent background tiling at card edges. */
.destination-marquee-track {
  gap: 0 !important;
  animation-duration: 54s;
  animation-timing-function: linear;
}

.destination-marquee-group {
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
  gap: 1.15rem !important;
  padding-right: 1.15rem !important;
}

.destination-marquee-group-copy {
  pointer-events: none;
}

.destination-card {
  flex: 0 0 clamp(240px, 18.1vw, 285px);
  margin: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  border-radius: 1rem;
  isolation: isolate;
}

.destination-southasia {
  background-image: url("https://images.unsplash.com/photo-1564507592333-c60657eea523?auto=format&fit=crop&w=900&q=85");
}

.destination-alpine {
  background-image: url("https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?auto=format&fit=crop&w=900&q=85");
}

.destination-southeastasia {
  background-image: url("https://images.unsplash.com/photo-1528181304800-259b08848526?auto=format&fit=crop&w=900&q=85");
}

/* Both marquees keep moving when hovered or focused. Reduced-motion remains respected. */
html body .destination-marquee-shell:hover .destination-marquee-track,
html body .destination-marquee-shell:focus-within .destination-marquee-track {
  animation-play-state: running !important;
}

/* Consistent royal-blue action buttons throughout the site.
   Input clear controls and password visibility controls stay neutral utilities. */
body .btn:not(.visa-clear-button):not(.login-password-toggle) {
  color: #fff !important;
  background: linear-gradient(135deg, #0b5ed7 0%, #0845a6 100%) !important;
  border: 1px solid #0b50bf !important;
  box-shadow: 0 0.45rem 1rem rgba(8, 69, 166, 0.16);
  font-weight: 750;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

body .btn:not(.visa-clear-button):not(.login-password-toggle):hover,
body .btn:not(.visa-clear-button):not(.login-password-toggle):focus-visible {
  color: #fff !important;
  background: linear-gradient(135deg, #084db5 0%, #073982 100%) !important;
  border-color: #0845a6 !important;
  box-shadow: 0 0.6rem 1.2rem rgba(8, 69, 166, 0.22);
  transform: translateY(-1px);
}

body .btn:not(.visa-clear-button):not(.login-password-toggle):active {
  color: #fff !important;
  background: #073982 !important;
  border-color: #073982 !important;
  transform: translateY(0);
}

body .btn:not(.visa-clear-button):not(.login-password-toggle):disabled,
body .btn:not(.visa-clear-button):not(.login-password-toggle)[aria-disabled="true"] {
  color: #fff !important;
  background: #6689c4 !important;
  border-color: #6689c4 !important;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

/* A more polished PDF export action inside Primary Applicant Details. */
.result-download-row .result-pdf-button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 0.83rem;
  letter-spacing: -0.01em;
}

.pdf-button-icon {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0.55rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  font-size: 1rem;
}

.result-download-row .result-pdf-button:disabled {
  box-shadow: none;
}

@media (max-width: 767.98px) {
  .destination-marquee-track {
    animation-duration: 54s;
  }

  .destination-marquee-group {
    gap: 0.9rem !important;
    padding-right: 0.9rem !important;
  }

  .destination-card {
    flex-basis: 78vw;
  }

  .result-download-row .result-pdf-button {
    width: 100%;
  }
}
