/* =========================================================
   Nitya Dharma — Homepage premium visual redesign
   Scoped to #nd-home-page (+ body:has for navbar/footer polish)
   Palette aligned with login/register redesign.
   Presentation only — no functional changes.
   ========================================================= */

#nd-home-page {
  --su-red: #E11D48;
  --su-deep: #BE123C;
  --su-wine: #881337;
  --su-pale: #FFF1F4;
  --su-bg: #F8FAFC;
  --su-white: #FFFFFF;
  --su-ink: #211A2B;
  --su-muted: #716977;
  --su-border: #E1E4EA;
  --su-soft-pink: #F1D5DB;
  --su-shadow: 0 12px 32px rgba(33, 26, 43, 0.08);
  --su-radius: 14px;

  color: var(--su-ink);
  background: var(--su-bg);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  isolation: isolate;
  overflow-x: clip;
}

#nd-home-page *,
#nd-home-page *::before,
#nd-home-page *::after {
  box-sizing: border-box;
}

/* Navbar polish removed — site-wide navbar_ui_redesign.css owns navbar visuals.
   Footer polish kept homepage-scoped below. */

/* ---------- Homepage-only footer polish ---------- */
body:has(#nd-home-page) footer {
  border-top: 1px solid #E1E4EA;
}

body:has(#nd-home-page) footer a {
  text-decoration: none;
}

body:has(#nd-home-page) footer a:hover {
  color: #E11D48 !important;
}

/* =========================================================
   HERO — premium dark wine / burgundy refinement
   CSS decoration only. Layout, fields, and actions unchanged.
   ========================================================= */

#nd-home-page .hero-section {
  position: relative;
  margin: 0;
  padding: 4.25rem 0 3.25rem;
  color: #FFF9F5;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(225, 29, 72, 0.16) 0%, transparent 58%),
    linear-gradient(165deg, #351024 0%, #641832 48%, #3D142C 100%);
  background-size: auto, cover;
  background-position: center top, center;
  overflow: hidden;
}

#nd-home-page .hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%23C9A227' stroke-width='1'%3E%3Ccircle cx='80' cy='80' r='70'/%3E%3Ccircle cx='80' cy='80' r='52'/%3E%3Ccircle cx='80' cy='80' r='34'/%3E%3Ccircle cx='80' cy='80' r='16'/%3E%3Cpath d='M80 10v140M10 80h140M27 27l106 106M133 27L27 133'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 180px 180px;
  background-repeat: repeat;
}

#nd-home-page .hero-section::after {
  display: none;
}

#nd-home-page .hero-section > .container {
  position: relative;
  z-index: 1;
}

#nd-home-page .hero-section h1 {
  margin: 0 auto 1rem;
  max-width: 18ch;
  color: #FFF9F5 !important;
  font-size: clamp(1.85rem, 3.6vw, 3.1rem); /* ~30–50px */
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

#nd-home-page .hero-section .lead {
  margin: 0 auto 2rem;
  max-width: 46rem;
  color: #EAD5DC !important;
  font-size: clamp(0.95rem, 1.5vw, 1.125rem);
  font-weight: 400;
  line-height: 1.65;
  opacity: 1;
}

/* Search card — light surface on dark hero for contrast */
#nd-home-page .search-hero-form {
  margin-top: 0.5rem;
  padding: 1.5rem 1.5rem 1.35rem;
  border: 1px solid rgba(255, 249, 245, 0.18);
  border-radius: var(--su-radius);
  background: var(--su-white);
  box-shadow: 0 18px 40px rgba(20, 6, 14, 0.35);
}

#nd-home-page .search-hero-form .form-select,
#nd-home-page .search-hero-form .form-select-lg,
#nd-home-page .search-hero-form .form-control,
#nd-home-page .search-hero-form .form-control-lg {
  min-height: 48px;
  border: 1px solid var(--su-border);
  border-radius: 10px;
  background: #F9FAFB;
  color: var(--su-ink);
  font-size: 0.95rem;
  box-shadow: none;
}

#nd-home-page .search-hero-form .form-select:focus,
#nd-home-page .search-hero-form .form-select-lg:focus,
#nd-home-page .search-hero-form .form-control:focus,
#nd-home-page .search-hero-form .form-control-lg:focus {
  border-color: var(--su-red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

#nd-home-page .search-hero-form .btn-primary,
#nd-home-page .search-hero-form .btn-primary.btn-lg,
#nd-home-page .search-hero-form button[type="submit"] {
  min-height: 48px;
  padding: 0.75rem 2rem;
  border: none !important;
  border-radius: 10px;
  background: linear-gradient(180deg, #E11D48 0%, #BE123C 100%) !important;
  color: #fff !important;
  font-size: 1rem;
  font-weight: 650;
  box-shadow: 0 10px 22px rgba(225, 29, 72, 0.32);
  transform: none;
}

#nd-home-page .search-hero-form .btn-primary:hover,
#nd-home-page .search-hero-form button[type="submit"]:hover {
  background: linear-gradient(180deg, #BE123C 0%, #881337 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(136, 19, 55, 0.38);
}

#nd-home-page .search-hero-form .btn-primary:focus-visible,
#nd-home-page .search-hero-form button[type="submit"]:focus-visible {
  outline: 2px solid #FFF9F5;
  outline-offset: 3px;
}

/* Page-type chips — translucent wine surfaces on dark hero */
#nd-home-page .page-type-buttons {
  margin-top: 1.35rem;
  padding: 0;
}

#nd-home-page .page-type-buttons-container {
  gap: 0.55rem;
}

#nd-home-page .page-type-btn {
  background: rgba(255, 249, 245, 0.1) !important;
  border: 1px solid rgba(234, 213, 220, 0.35) !important;
  color: #FFF9F5 !important;
  border-radius: 999px !important;
  padding: 0.55rem 1.05rem !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  box-shadow: none;
  backdrop-filter: blur(4px);
}

#nd-home-page .page-type-btn:hover,
#nd-home-page .page-type-btn:focus-visible {
  background: rgba(225, 29, 72, 0.92) !important;
  border-color: rgba(255, 249, 245, 0.45) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

#nd-home-page .page-type-btn i {
  color: inherit;
}

/* =========================================================
   SECTIONS
   ========================================================= */

#nd-home-page .sample-listings-section,
#nd-home-page .trust-section,
#nd-home-page .how-it-works-section,
#nd-home-page .reviews-context-section,
#nd-home-page .cta-bridge-section {
  padding-top: 3.25rem;
  padding-bottom: 3.25rem;
}

#nd-home-page > .container {
  padding-top: 2.75rem;
  padding-bottom: 0.5rem;
}

#nd-home-page h2,
#nd-home-page h3,
#nd-home-page h4.h3,
#nd-home-page .sample-listings-section h2,
#nd-home-page .trust-section h3,
#nd-home-page .how-it-works-section h3 {
  color: var(--su-ink);
  font-weight: 720;
  letter-spacing: -0.015em;
}

#nd-home-page h2.h3,
#nd-home-page .sample-listings-section .h3 {
  font-size: clamp(1.45rem, 2.4vw, 1.95rem); /* ~23–31px */
}

#nd-home-page h3,
#nd-home-page h4.fw-bold {
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  color: var(--su-ink);
}

#nd-home-page .text-muted {
  color: var(--su-muted) !important;
}

/* Listing / expert cards */
#nd-home-page .listing-card,
#nd-home-page .pandit-card,
#nd-home-page .card {
  border: 1px solid var(--su-border);
  border-radius: var(--su-radius);
  background: var(--su-white);
  box-shadow: 0 6px 18px rgba(33, 26, 43, 0.05);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#nd-home-page .listing-card:hover,
#nd-home-page .pandit-card:hover,
#nd-home-page .card:hover {
  border-color: var(--su-soft-pink);
  box-shadow: 0 14px 28px rgba(33, 26, 43, 0.09);
  transform: translateY(-2px);
}

#nd-home-page .card .card-body h6,
#nd-home-page .listing-card .card-title-link,
#nd-home-page .listing-card h6 a {
  color: var(--su-ink);
  font-size: 1.05rem;
  font-weight: 650;
}

#nd-home-page .card .card-body h6 + .text-muted,
#nd-home-page .listing-card .text-muted {
  font-size: 0.84rem;
}

#nd-home-page .card img.rounded-circle {
  border: 2px solid var(--su-soft-pink);
  object-fit: cover;
}

/* Primary / danger CTAs within homepage */
#nd-home-page .btn-primary,
#nd-home-page .btn-danger {
  background-color: var(--su-red) !important;
  border-color: var(--su-red) !important;
  color: #fff !important;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: none;
}

#nd-home-page .btn-primary:hover,
#nd-home-page .btn-danger:hover {
  background-color: var(--su-deep) !important;
  border-color: var(--su-deep) !important;
}

#nd-home-page .btn-outline-primary,
#nd-home-page .btn-outline-danger {
  border-color: var(--su-red) !important;
  color: var(--su-red) !important;
  border-radius: 10px;
  font-weight: 600;
  background: transparent;
}

#nd-home-page .btn-outline-primary:hover,
#nd-home-page .btn-outline-danger:hover {
  background: var(--su-pale) !important;
  color: var(--su-deep) !important;
}

#nd-home-page .btn-success {
  border-radius: 10px;
}

/* Trust cards */
#nd-home-page .trust-section {
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF7F9 100%) !important;
}

#nd-home-page .trust-section .bg-white.rounded-4 {
  border: 1px solid var(--su-border);
  border-radius: var(--su-radius) !important;
  box-shadow: 0 8px 20px rgba(33, 26, 43, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#nd-home-page .trust-section .bg-white.rounded-4:hover {
  border-color: var(--su-soft-pink);
  box-shadow: 0 12px 26px rgba(33, 26, 43, 0.08);
}

#nd-home-page .trust-section .text-danger {
  color: var(--su-red) !important;
}

#nd-home-page .trust-section h5 {
  color: var(--su-ink);
  font-size: 1.1rem;
}

/* How it works */
#nd-home-page .how-it-works-section {
  background: var(--su-white) !important;
  border-top: 1px solid var(--su-border);
  border-bottom: 1px solid var(--su-border);
}

#nd-home-page .step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-inline: auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--su-wine), var(--su-red));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(225, 29, 72, 0.25);
}

#nd-home-page .step-badge span {
  color: #fff;
  line-height: 1;
}

#nd-home-page .how-it-works-section h4,
#nd-home-page .how-it-works-section .h5 {
  color: var(--su-ink);
  font-size: 1.1rem;
}

#nd-home-page .how-it-works-section .bi {
  color: var(--su-muted) !important;
}

/* Reviews + CTA bridge */
#nd-home-page .reviews-context-section {
  background: var(--su-pale);
}

#nd-home-page .cta-bridge-section {
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF1F4 100%) !important;
}

#nd-home-page .cta-bridge-section .btn-danger,
#nd-home-page .cta-bridge-section .btn-outline-danger {
  min-height: 46px;
  padding-left: 1.75rem !important;
  padding-right: 1.75rem !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 991.98px) {
  #nd-home-page .hero-section {
    padding: 3.25rem 0 2.5rem;
  }

  #nd-home-page .search-hero-form {
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  #nd-home-page .hero-section {
    padding: 2.75rem 0 2.15rem;
  }

  #nd-home-page .hero-section h1 {
    font-size: clamp(1.85rem, 7.2vw, 2.125rem); /* ~30–34px */
    max-width: none;
  }

  #nd-home-page .hero-section .lead {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  #nd-home-page .search-hero-form {
    padding: 1.1rem;
  }

  #nd-home-page .search-hero-form .btn-primary,
  #nd-home-page .search-hero-form button[type="submit"] {
    width: 100%;
  }

  /* Mobile chips: compact 3×2 grid (no horizontal scroll) */
  #nd-home-page .page-type-buttons {
    margin-top: 1.1rem;
    padding: 0 !important;
  }

  #nd-home-page .page-type-buttons-container {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    justify-content: stretch;
    align-items: stretch;
    overflow: visible !important;
    overflow-x: visible !important;
    -webkit-overflow-scrolling: auto;
    scrollbar-width: auto;
    padding-bottom: 0 !important;
    width: 100%;
    max-width: 100%;
  }

  /* Keep .ui-hidden chips fully removed from the grid */
  #nd-home-page .page-type-btn.ui-hidden {
    display: none !important;
  }

  #nd-home-page .page-type-btn:not(.ui-hidden) {
    flex-shrink: 1;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-align: center;
    white-space: normal !important;
    line-height: 1.25 !important;
    min-height: 2.5rem;
    height: 100%;
    padding: 0.4rem 0.35rem !important;
    font-size: 0.75rem !important; /* 12px */
    font-weight: 600 !important;
    border-radius: 12px !important;
  }

  #nd-home-page .page-type-btn:not(.ui-hidden) i {
    font-size: 0.85rem !important;
    flex-shrink: 0;
  }

  #nd-home-page .sample-listings-section,
  #nd-home-page .trust-section,
  #nd-home-page .how-it-works-section,
  #nd-home-page .cta-bridge-section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  #nd-home-page > .container {
    padding-top: 2rem;
  }

  #nd-home-page .cta-bridge-section .btn {
    width: 100%;
    margin: 0.35rem 0 !important;
  }

  #nd-home-page .card {
    margin-bottom: 0.25rem;
  }
}

@media (max-width: 480px) {
  #nd-home-page .hero-section {
    padding: 2.25rem 0 1.85rem;
  }

  #nd-home-page .search-hero-form .form-select-lg,
  #nd-home-page .search-hero-form .form-control-lg {
    font-size: 16px; /* avoid iOS zoom */
  }

  /* ~390–480px: keep compact 3-column / 2-row chip grid */
  #nd-home-page .page-type-buttons-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
  }

  #nd-home-page .page-type-btn:not(.ui-hidden) {
    font-size: 0.72rem !important; /* ~11.5px */
    padding: 0.35rem 0.3rem !important;
    min-height: 2.35rem;
  }
}

/* Narrow phones: prefer 2-column to avoid clipping */
@media (max-width: 375.98px) {
  #nd-home-page .page-type-buttons-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }

  #nd-home-page .page-type-btn:not(.ui-hidden) {
    font-size: 0.6875rem !important; /* 11px */
    padding: 0.35rem 0.4rem !important;
    min-height: 2.4rem;
  }
}

@media (max-width: 360px) {
  #nd-home-page .hero-section h1 {
    font-size: 1.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #nd-home-page *,
  #nd-home-page *::before,
  #nd-home-page *::after {
    animation: none !important;
    transition: none !important;
  }
}
