/*
 * LeniCare 7.86 – verbindliche mobile Navigation und Footer
 *
 * App-Seiten:
 * - keine simulierte Statusleiste
 * - die komplette Fläche oberhalb der Navigation scrollt
 * - ausschließlich die untere Hauptnavigation bleibt fixiert
 *
 * Auth-Seiten:
 * - normales Ein-Finger-Scrollen über die gesamte Seite
 * - Footer bleibt im Dokumentfluss und sitzt bei kurzem Inhalt unten
 * - keine horizontale Überbreite und kein iOS-Eingabezoom
 */
@media (max-width: 430px) {
  *, *::before, *::after {
    box-sizing: border-box !important;
  }

  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    background: #dceafa !important;
  }

  .statusbar,
  .auth-statusbar,
  .quiz-statusbar,
  .current-time,
  .island,
  .status-icons,
  .auth-time,
  .auth-island,
  .auth-icons {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* ================================================================
     App-Seiten mit unterer Navigation
     ================================================================ */
  html.lenicare-app-mobile,
  html.lenicare-app-mobile body.lenicare-app-mobile-page {
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
  }

  body.lenicare-app-mobile-page {
    position: relative !important;
    min-width: 0 !important;
  }

  body.lenicare-app-mobile-page > .app-shell,
  body.lenicare-app-mobile-page > main.app-shell,
  body.lenicare-app-mobile-page > div.app-shell {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 0 calc(86px + env(safe-area-inset-bottom)) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
    scrollbar-width: none !important;
  }

  body.lenicare-app-mobile-page > .app-shell::-webkit-scrollbar,
  body.lenicare-app-mobile-page > main.app-shell::-webkit-scrollbar,
  body.lenicare-app-mobile-page > div.app-shell::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  /* Frühere innere Scrollcontainer laufen mobil im normalen Seitenfluss. */
  body.lenicare-app-mobile-page .page-scroll,
  body.lenicare-app-mobile-page .home-main,
  body.lenicare-app-mobile-page .profile-page-scroll,
  body.lenicare-app-mobile-page .assessment-scroll,
  body.lenicare-app-mobile-page .history-list,
  body.lenicare-app-mobile-page .daily-scroll,
  body.lenicare-app-mobile-page .breathing-scroll,
  body.lenicare-app-mobile-page .vet-search-scroll,
  body.lenicare-app-mobile-page .personal-data-scroll,
  body.lenicare-app-mobile-page .pet-profile-scroll,
  body.lenicare-app-mobile-page .screen-area {
    position: relative !important;
    display: block !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overscroll-behavior: auto !important;
    touch-action: pan-y !important;
  }

  /* Kein mehrfacher künstlicher Navigationsabstand aus älteren Regeln. */
  body.lenicare-app-mobile-page .home-main,
  body.lenicare-app-mobile-page .home-stack,
  body.lenicare-app-mobile-page .home-content,
  body.lenicare-app-mobile-page .page-scroll,
  body.lenicare-app-mobile-page .profile-page-scroll,
  body.lenicare-app-mobile-page .assessment-scroll,
  body.lenicare-app-mobile-page .history-list,
  body.lenicare-app-mobile-page .daily-scroll,
  body.lenicare-app-mobile-page .breathing-scroll,
  body.lenicare-app-mobile-page .vet-search-scroll,
  body.lenicare-app-mobile-page .personal-data-scroll,
  body.lenicare-app-mobile-page .pet-profile-scroll,
  body.lenicare-app-mobile-page .screen-area {
    padding-bottom: 24px !important;
  }

  body.lenicare-app-mobile-page .lenicare-page-header,
  body.lenicare-app-mobile-page .lenicare-page-intro,
  body.lenicare-app-mobile-page .lenicare-logo-header,
  body.lenicare-app-mobile-page .home-top {
    position: relative !important;
    flex: 0 0 auto !important;
  }

  /* Einzige fixierte Fläche in der mobilen App. */
  body.lenicare-app-mobile-page .home-nav,
  body.lenicare-app-mobile-page .lenicare-bottom-nav {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: calc(78px + env(safe-area-inset-bottom)) !important;
    min-height: calc(78px + env(safe-area-inset-bottom)) !important;
    margin: 0 !important;
    padding: 5px 8px calc(7px + env(safe-area-inset-bottom)) !important;
    transform: none !important;
    z-index: 10000 !important;
    overflow: hidden !important;
    border: 1px solid rgba(120,174,236,.72) !important;
    border-bottom: 0 !important;
    border-radius: 25px 25px 0 0 !important;
    background: linear-gradient(180deg,rgba(61,126,207,.99) 0%,rgba(37,94,174,.99) 48%,rgba(18,67,139,1) 100%) !important;
    box-shadow: 0 -8px 22px rgba(28,67,130,.24),inset 0 1px 0 rgba(255,255,255,.38),inset 0 11px 18px rgba(255,255,255,.10),inset 0 -10px 18px rgba(5,35,87,.20) !important;
  }

  body.lenicare-app-mobile-page .home-nav a,
  body.lenicare-app-mobile-page .lenicare-bottom-nav a {
    min-width: 0 !important;
  }

  /* ================================================================
     Login, Registrierung und Passwortseiten
     ================================================================ */
  html.lenicare-auth-mobile,
  html.lenicare-auth-mobile body.auth-mobile-page {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.auth-mobile-page {
    position: relative !important;
    display: block !important;
    min-height: 100dvh !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: auto !important;
    touch-action: pan-y !important;
  }

  body.auth-mobile-page > .app-shell,
  body.auth-mobile-page > main.app-shell,
  body.auth-mobile-page > .auth-shell {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body.auth-mobile-page .login-logo-header,
  body.auth-mobile-page .register-logo-header,
  body.auth-mobile-page .forgot-logo-header,
  body.auth-mobile-page .auth-brand {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 18px 14px 8px !important;
    overflow: hidden !important;
  }

  body.auth-mobile-page .login-logo-header .brand-logo,
  body.auth-mobile-page .register-logo-header .brand-logo,
  body.auth-mobile-page .forgot-logo-header .brand-logo,
  body.auth-mobile-page .auth-brand img {
    display: block !important;
    width: auto !important;
    max-width: min(82vw, 280px) !important;
    height: auto !important;
    max-height: 175px !important;
    margin: 0 auto !important;
    object-fit: contain !important;
    object-position: center !important;
  }

  body.auth-mobile-page .login-page-scroll,
  body.auth-mobile-page .register-page-scroll,
  body.auth-mobile-page .forgot-page-scroll {
    position: relative !important;
    display: block !important;
    flex: 1 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 14px 24px !important;
    overflow: visible !important;
    touch-action: pan-y !important;
  }

  body.auth-mobile-page .login-card,
  body.auth-mobile-page .register-card,
  body.auth-mobile-page .forgot-card,
  body.auth-mobile-page .auth-card-modern,
  body.auth-mobile-page .auth-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body.auth-mobile-page input,
  body.auth-mobile-page select,
  body.auth-mobile-page textarea,
  body.auth-mobile-page button {
    max-width: 100% !important;
  }

  /* 16px verhindert den automatischen Safari-Zoom bei Eingabefokus. */
  body.auth-mobile-page input,
  body.auth-mobile-page select,
  body.auth-mobile-page textarea {
    font-size: 16px !important;
  }

  body.auth-mobile-page .login-footer,
  body.auth-mobile-page .register-footer,
  body.auth-mobile-page .forgot-footer {
    position: relative !important;
    inset: auto !important;
    z-index: 2 !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 72px !important;
    margin: auto 0 0 !important;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom)) !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }

  /* Seiten ohne gesonderten Footer erhalten unten einen sauberen Abschluss. */
  body.auth-mobile-page > .auth-shell,
  body.auth-mobile-page > .auth-page-shell:not(.register-standard-page):not(.forgot-standard-page) {
    padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
  }


  /* 7.86.2: Auth-Footer ohne eigene Fläche direkt auf dem Wellenhintergrund. */
  body.auth-mobile-page .login-footer,
  body.auth-mobile-page .register-footer,
  body.auth-mobile-page .forgot-footer,
  body.auth-mobile-page .reset-footer {
    width:100% !important;
    min-height:58px !important;
    margin:auto 0 0 !important;
    padding:8px 14px calc(12px + env(safe-area-inset-bottom)) !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
  }
}
