/* Responsive overrides only. Shared/global rules live in styles.css. */

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }
}

/* Keep the homepage contact action readable and position only that tab. */
[data-site-nav] .contact-nav-link,
[data-site-nav] .contact-nav-link:hover,
[data-site-nav] .contact-nav-link:focus,
[data-site-nav] .contact-nav-link:active {
  background: #17b6c2 !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

@media (min-width: 768px) {
  header [data-site-nav] {
    flex: 1 1 auto !important;
    margin-right: 0 !important;
  }

  [data-site-nav] .header-auth-link {
    margin-left: auto !important;
  }

  [data-site-nav] .contact-nav-link {
    margin-left: 0 !important;
  }
}

@media (min-width: 1024px) {
  [data-site-nav] .profiles-nav-tab {
    color: #486477 !important;
    font-size: 20px !important;
    font-weight: 900 !important;
  }
}

@media (max-width: 767px) {
  header > div {
    min-height: 4.25rem;
    padding: .75rem 1rem !important;
  }

  .brand-logo-nav {
    width: min(48vw, 10.75rem) !important;
  }

  [data-menu-toggle] {
    min-height: 2.75rem;
    min-width: 4.5rem;
    padding: .65rem 1rem !important;
  }

  [data-site-nav] {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-y: auto !important;
    gap: .8rem !important;
    padding: 5.5rem 1.15rem 2rem !important;
    background: #061424 !important;
    box-shadow: none !important;
  }

  [data-site-nav] a {
    display: block !important;
    width: 100% !important;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    border-radius: 1.35rem !important;
    background: rgba(255, 255, 255, .07) !important;
    padding: 1rem 1.1rem !important;
    color: #fff !important;
    font-size: 1.18rem !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
    text-align: left !important;
  }

  html[data-auth-state="signed-in"] [data-site-nav] [data-account-link],
  html[data-auth-state="signed-in"] [data-site-nav] [data-nav-sign-out] {
    display: block !important;
    width: 100% !important;
  }

  [data-site-nav] a[href="/apply"],
  [data-site-nav] a[href="/apply.html"] {
    background: #fff !important;
    color: #061424 !important;
    text-align: center !important;
  }

  main,
  section,
  footer {
    max-width: 100% !important;
  }

  main > section,
  footer {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .max-w-7xl,
  .max-w-6xl,
  .max-w-5xl,
  .max-w-4xl,
  .max-w-3xl,
  .max-w-2xl {
    max-width: 100% !important;
  }

  .rounded-\[2\.4rem\],
  .rounded-\[2\.3rem\],
  .rounded-\[2\.2rem\],
  .rounded-\[2rem\] {
    border-radius: 1.45rem !important;
  }

  .p-9,
  .p-8,
  .p-7,
  .p-6 {
    padding: 1.25rem !important;
  }

  .px-8,
  .px-7,
  .px-6,
  .px-5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .py-18,
  .py-16,
  .py-14,
  .py-12 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .grid[class*="sm:grid-cols"],
  .grid[class*="md:grid-cols"],
  .grid[class*="lg:grid-cols"],
  .grid[class*="xl:grid-cols"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .flex[class*="sm:flex-row"],
  .flex[class*="md:flex-row"],
  .flex[class*="lg:flex-row"] {
    flex-direction: column !important;
  }

  h1,
  .text-6xl,
  .text-5xl {
    font-size: clamp(2rem, 10vw, 2.55rem) !important;
    line-height: .98 !important;
  }

  h2,
  .text-4xl {
    font-size: clamp(1.9rem, 9vw, 2.45rem) !important;
    line-height: 1.04 !important;
  }

  .text-3xl {
    font-size: clamp(1.42rem, 6.5vw, 1.75rem) !important;
    line-height: 1.12 !important;
  }

  .text-2xl {
    font-size: clamp(1.22rem, 5.8vw, 1.5rem) !important;
    line-height: 1.18 !important;
  }

  .text-xl,
  .text-lg {
    font-size: 1rem !important;
    line-height: 1.6 !important;
  }

  a.rounded-full,
  button.rounded-full,
  form button[type="submit"] {
    width: 100% !important;
    min-height: 3.15rem !important;
    justify-content: center !important;
    text-align: center !important;
  }

  button[data-menu-toggle] {
    width: auto !important;
    min-width: 4.5rem !important;
  }

  label {
    min-width: 0 !important;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    width: 100% !important;
    min-height: 3rem;
    font-size: 16px !important;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 1.2rem !important;
    min-width: 1.2rem !important;
    height: 1.2rem !important;
    min-height: 1.2rem !important;
    margin-top: .1rem;
    flex: 0 0 auto !important;
  }

  input[type="file"] {
    min-height: auto !important;
    padding: .85rem !important;
    line-height: 1.35 !important;
  }

  textarea {
    min-height: 8rem;
  }

  .photo-upload-card label {
    min-height: 8.5rem !important;
  }

  #home {
    padding: .85rem .75rem 2rem !important;
  }

  #home .hero-card {
    border-radius: 1.35rem !important;
  }

  #home .hero-card > div:first-child {
    display: flex !important;
    min-height: auto !important;
    flex-direction: column !important;
    padding: 1.35rem 1rem 1.65rem !important;
  }

  #home .brand-logo-hero {
    width: min(100%, 17rem) !important;
  }

  #home .text-4xl {
    font-size: clamp(1.85rem, 8.8vw, 2.1rem) !important;
    line-height: 1.08 !important;
  }

  #home p.max-w-lg {
    max-width: 100% !important;
  }

  #home .hero-phone {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    aspect-ratio: 390 / 844 !important;
    width: min(100%, 15.25rem) !important;
    max-width: 15.25rem !important;
    max-height: none !important;
    margin: 2rem auto 0 !important;
    transform: none !important;
  }

  #home .phone-frame {
    border-width: 6px !important;
    border-radius: 2.1rem !important;
    padding: .45rem !important;
  }

  #home .phone-frame > div {
    border-radius: 1.55rem !important;
    padding: .55rem !important;
  }

  #home .brand-logo-phone {
    width: 7rem !important;
  }

  #home .hero-phone article img {
    height: 16.75rem !important;
  }

  #home .hero-phone article .p-4 {
    padding: 1rem !important;
  }

  #home .teal-bar,
  #home .purple-bar {
    padding: 1.2rem 1rem !important;
  }

  #home .connect-panel {
    padding: 1.5rem 1rem !important;
  }

  #home .connect-features {
    max-width: 100% !important;
  }

  #home .connect-features article {
    grid-template-columns: 3.25rem minmax(0, 1fr) !important;
    gap: .85rem !important;
  }

  #home .connect-features .icon-box {
    width: 2.9rem !important;
    height: 2.9rem !important;
    border-radius: 1rem !important;
  }

  #home .connect-features p {
    font-size: .95rem !important;
    line-height: 1.35 !important;
  }
}

@media (min-width: 481px) and (max-width: 767px) {
  main > section,
  footer {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  #home .hero-phone {
    max-width: 15.75rem !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  main > section,
  footer,
  header > div {
    padding-left: 1.75rem !important;
    padding-right: 1.75rem !important;
  }

  #home .hero-card > div:first-child {
    display: grid !important;
    min-height: 38rem !important;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 330px) !important;
    align-items: center !important;
    column-gap: 1.5rem !important;
  }

  #home .hero-phone {
    position: relative !important;
    right: auto !important;
    top: auto !important;
    max-width: 17.25rem !important;
    margin-left: 0 !important;
    transform: translateX(-.75rem) !important;
  }

  #home .brand-logo-hero {
    width: min(100%, 25rem) !important;
  }
}

@media (min-width: 1024px) {
  [data-site-nav] {
    display: flex !important;
  }
}

/* Responsive hardening pass: phones, tablets, and dense forms */
@media (max-width: 639px) {
  body {
    min-width: 0;
  }

  header {
    position: sticky;
    top: 0;
    z-index: 9990;
  }

  main {
    width: 100%;
  }

  .mx-auto {
    max-width: 100% !important;
  }

  .grid,
  .flex {
    min-width: 0;
  }

  #online-application,
  #mail-photo-form,
  #pay-application-form,
  form[id*="signin"],
  form[id*="signup"] {
    width: 100% !important;
  }

  #online-application .grid,
  #mail-photo-form .grid,
  #pay-application-form .grid,
  .auth-card .grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #online-application label,
  #mail-photo-form label,
  #pay-application-form label {
    width: 100%;
  }

  #online-application .flex:has(input[type="checkbox"]),
  #mail-photo-form .flex:has(input[type="checkbox"]),
  #pay-application-form .flex:has(input[type="checkbox"]) {
    flex-direction: row !important;
    align-items: flex-start !important;
  }

  #online-application input[type="checkbox"],
  #online-application input[type="radio"],
  #mail-photo-form input[type="checkbox"],
  #mail-photo-form input[type="radio"],
  #pay-application-form input[type="checkbox"],
  #pay-application-form input[type="radio"] {
    width: 1.2rem !important;
    min-width: 1.2rem !important;
    height: 1.2rem !important;
    min-height: 1.2rem !important;
  }

  input[type="file"]::file-selector-button {
    margin: 0 .75rem .35rem 0;
    border: 0;
    border-radius: 999px;
    background: #5b35c8;
    color: #fff;
    padding: .65rem .9rem;
    font-weight: 900;
  }

  #profile-modal {
    padding: .75rem !important;
  }

  #profile-modal .profile-modal-top,
  #profile-modal .profile-modal-details-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #profile-modal .profile-modal-main-photo {
    min-height: 0 !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: min(115vw, 32rem) !important;
    object-fit: contain;
    object-position: center center;
  }

  #mail-photo-upload {
    margin-top: 1.5rem !important;
  }

  #mail-photo-upload label[for^="mail-photo"] {
    min-height: 6rem !important;
    padding: 1rem !important;
  }

  .cookie-banner,
  [data-cookie-banner] {
    left: 1rem !important;
    right: 1rem !important;
    bottom: 1rem !important;
    max-width: calc(100vw - 2rem) !important;
  }

  footer nav {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .75rem !important;
    text-align: left !important;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .grid[class*="lg:grid-cols"],
  .grid[class*="xl:grid-cols"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #online-application,
  #pay-application-form,
  #mail-photo-form {
    width: 100% !important;
  }

  input[type="checkbox"],
  input[type="radio"] {
    width: 1.15rem !important;
    min-width: 1.15rem !important;
    height: 1.15rem !important;
    min-height: 1.15rem !important;
  }
}

@media (min-width: 1024px) {
  main > section > .mx-auto,
  main > .mx-auto {
    width: 100%;
  }

  #online-application,
  #mail-photo-form,
  #pay-application-form {
    max-width: 100%;
  }
}

/* Tablet navigation and form polish */
@media (max-width: 1023px) {
  [data-menu-toggle] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  [data-site-nav].hidden {
    display: none !important;
  }

  [data-site-nav]:not(.hidden) {
    display: flex !important;
  }

  [data-site-nav] {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-y: auto !important;
    flex-direction: column !important;
    gap: .85rem !important;
    padding: 5.75rem 1.25rem 2rem !important;
    background: #061424 !important;
    box-shadow: none !important;
  }

  [data-site-nav] a {
    display: block !important;
    width: 100% !important;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    border-radius: 1.35rem !important;
    background: rgba(255, 255, 255, .07) !important;
    padding: 1rem 1.1rem !important;
    color: #fff !important;
    font-size: clamp(1.05rem, 3vw, 1.3rem) !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
    text-align: left !important;
  }

  [data-site-nav] a[href="/apply"],
  [data-site-nav] a[href="/apply.html"] {
    background: #fff !important;
    color: #061424 !important;
    text-align: center !important;
  }

}

@media (max-width: 639px) {
  [data-auth-form] {
    width: 100% !important;
    padding: 1.35rem !important;
  }

  [data-auth-form] input,
  [data-auth-form] button {
    width: 100% !important;
  }

  .grid > label,
  .grid > div,
  .grid > article,
  .grid > aside,
  .grid > form,
  .grid > section {
    min-width: 0 !important;
  }

  .overflow-x-auto {
    max-width: 100% !important;
  }

  table {
    width: 100% !important;
  }
}

@media (max-width: 767px) {
  main:has(#online-application) {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  main:has(#online-application) > section:first-child {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  #online-application {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 1.5rem;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  #online-application > *,
  #online-application .grid > * {
    max-width: 100%;
    min-width: 0;
  }

  #online-application h2 {
    max-width: 100%;
    font-size: clamp(1.35rem, 6vw, 1.7rem) !important;
    line-height: 1.08 !important;
    overflow-wrap: anywhere;
  }
}

@media (min-width: 1024px) {
  [data-site-nav] a {
    color: var(--bw-text-secondary) !important;
  }

  [data-site-nav] a:hover {
    color: var(--bw-primary) !important;
  }

  [data-site-nav] a[href="/apply"],
  [data-site-nav] a[href="/apply.html"] {
    background: var(--bw-primary) !important;
    color: #ffffff !important;
  }

  [data-site-nav] a[href="/apply"]:hover,
  [data-site-nav] a[href="/apply.html"]:hover {
    background: var(--bw-primary) !important;
    color: #ffffff !important;
  }
}

@media (max-width: 1023px) {
  [data-site-nav] {
    background: rgba(248, 247, 252, .98) !important;
    color: var(--bw-text) !important;
    backdrop-filter: blur(20px);
  }

  [data-site-nav] a {
    border-color: var(--bw-border) !important;
    background: var(--bw-surface) !important;
    color: var(--bw-text) !important;
    box-shadow: 0 8px 24px rgba(23, 182, 194, .08);
  }

  [data-site-nav] a:hover {
    border-color: var(--bw-primary) !important;
    background: var(--bw-lavender) !important;
    color: var(--bw-primary-dark) !important;
  }

  [data-site-nav] a[href="/apply"],
  [data-site-nav] a[href="/apply.html"] {
    border-color: var(--bw-primary) !important;
    background: var(--bw-primary) !important;
    color: #ffffff !important;
  }
}

/* =========================================================
   Profiles directory responsive system
   Shared profile styles are defined in styles.css.
   ========================================================= */

/* iPhone / small mobile: 320px - 430px */
@media (max-width: 430px) {
  .home-discovery-hero {
    padding: 3.5rem 1rem 3rem !important;
  }

  .home-discovery-hero-inner {
    margin: 0 auto;
  }

  .home-discovery-hero h1 {
    font-size: clamp(2.65rem, 13vw, 3.55rem);
  }

  .home-hero-actions {
    flex-direction: column;
  }

  .home-primary-action,
  .home-secondary-action {
    width: 100%;
  }

  .featured-profiles-section {
    padding: 3rem 1rem !important;
  }

  .featured-profiles-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .featured-profiles-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .featured-profile-card {
    max-width: 100%;
  }

  .featured-profile-photo-wrap {
    height: clamp(17rem, 86vw, 20rem);
  }

  .featured-profile-heading h3 {
    font-size: clamp(1.3rem, 6vw, 1.55rem);
    white-space: nowrap;
  }

  .home-profile-cta {
    grid-template-columns: minmax(0, 1fr);
    margin: 0 1rem 3rem;
    padding: 1.4rem;
  }

  .home-profile-cta > a {
    width: 100%;
  }

  #home .hero-card .brand-logo-hero {
    display: none !important;
  }

  #home .hero-card div:has(> .brand-logo-hero) + div {
    margin-top: 0 !important;
  }

  #home .hero-phone article h1 {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    font-size: clamp(1.35rem, 6vw, 1.55rem) !important;
    line-height: 1.05;
    letter-spacing: 0;
    white-space: nowrap;
    text-overflow: clip;
  }

  #home .connect-panel {
    padding-bottom: calc(32px + env(safe-area-inset-bottom)) !important;
  }

  input.sr-only.sr-only,
  select.sr-only.sr-only,
  textarea.sr-only.sr-only {
    width: 1px !important;
    min-width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
  }

  .profiles-directory-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #profiles-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .profiles-filter-toggle {
    display: flex !important;
  }

  .profiles-filter-panel {
    display: none !important;
  }

  [data-filter-aside][data-filters-open="true"] .profiles-filter-panel {
    display: grid !important;
  }

  .approved-profile-card {
    width: 100%;
    max-width: 100%;
  }

  #profiles-grid .approved-profile-photo {
    width: 100%;
    height: clamp(17rem, 88vw, 20rem) !important;
    max-height: none;
    object-fit: contain;
    object-position: center center !important;
  }

  .approved-profile-content,
  .approved-profile-card > div {
    padding: 1.25rem;
  }

  .approved-profile-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    column-gap: .75rem;
    align-items: start;
    padding-right: 0;
  }

  .approved-profile-header > :not(.approved-profile-heart) {
    min-width: 0;
    grid-column: 1;
  }

  .approved-profile-name {
    grid-column: 1 / -1 !important;
    width: 100%;
    max-width: none;
    overflow: visible;
    font-size: clamp(1.25rem, 5.5vw, 1.45rem);
    line-height: 1.08;
    letter-spacing: 0;
    white-space: nowrap;
    text-overflow: clip;
  }

  button.approved-profile-heart {
    position: static;
    grid-column: 2;
    grid-row: 2 / span 4;
    align-self: start;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    margin-top: .15rem;
    padding: 0 !important;
  }

  .approved-profile-actions [data-report-profile] {
    align-self: flex-start;
  }
}

/* Android / large mobile: 431px - 600px */
@media (min-width: 431px) and (max-width: 600px) {
  .home-discovery-hero {
    padding: 4rem 1.25rem 3.5rem !important;
  }

  .home-discovery-hero-inner {
    margin: 0 auto;
  }

  .featured-profiles-section {
    padding: 3.5rem 1.25rem !important;
  }

  .featured-profiles-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .featured-profile-card {
    max-width: 360px;
  }

  .home-profile-cta {
    grid-template-columns: minmax(0, 1fr);
    margin: 0 1.25rem 3.5rem;
  }

  input.sr-only.sr-only,
  select.sr-only.sr-only,
  textarea.sr-only.sr-only {
    width: 1px !important;
    min-width: 1px !important;
    height: 1px !important;
    min-height: 1px !important;
  }

  .profiles-directory-shell,
  #profiles-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .profiles-filter-toggle {
    display: flex !important;
  }

  .profiles-filter-panel {
    display: none !important;
  }

  [data-filter-aside][data-filters-open="true"] .profiles-filter-panel {
    display: grid !important;
  }

  #profiles-grid .approved-profile-photo {
    height: 20rem !important;
    object-position: center center !important;
  }

  .approved-profile-card {
    max-width: 360px;
  }
}

/* Tablet: 601px - 1024px */
@media (min-width: 601px) and (max-width: 1024px) {
  .profiles-directory-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #profiles-grid {
    grid-template-columns: repeat(2, minmax(280px, 1fr)) !important;
  }

  .profiles-filter-toggle {
    display: flex !important;
  }

  .profiles-filter-panel {
    display: none !important;
  }

  [data-filter-aside][data-filters-open="true"] .profiles-filter-panel {
    display: grid !important;
  }

  #profiles-grid .approved-profile-photo {
    height: 18rem !important;
    object-position: center center !important;
  }

  .menu-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .site-nav .nav-cta {
    padding: 9px 12px;
  }

  .hero,
  .split,
  .app-preview,
  .waitlist,
  .contact {
    grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
    align-items: center;
  }

  .hero-visual {
    min-height: 560px;
  }

  .step-grid,
  .safety-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .price-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero,
  .section,
  .site-header,
  .site-footer {
    padding-right: 32px;
    padding-left: 32px;
  }

  .site-footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Desktop: 1025px+ */
@media (min-width: 1025px) {
  #profile-modal > div {
    max-width: 72rem;
  }

  #profile-modal .profile-modal-top {
    grid-template-columns: minmax(24rem, .9fr) minmax(0, 1fr);
    align-items: start;
  }

  #profile-modal .profile-modal-media {
    display: flex;
    min-height: 0;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
  }

  #profile-modal .profile-modal-media > img {
    width: auto;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: 38rem;
    object-fit: contain;
    object-position: center center;
  }

  #profile-modal [data-close-profile] {
    display: inline-flex;
    width: auto;
    min-width: 64px;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }

  .profiles-directory-shell {
    grid-template-columns: 17.5rem minmax(0, 1fr);
    align-items: start;
  }

  .profiles-filter-panel {
    display: grid !important;
  }

  .hero,
  .section,
  .site-header,
  .site-footer {
    padding-right: max(48px, calc((100vw - 1180px) / 2));
    padding-left: max(48px, calc((100vw - 1180px) / 2));
  }

  .hero {
    grid-template-columns: .9fr 1.1fr;
  }

  .step-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
