/*
 * Diver on Tour App – mobile Oberfläche
 * Separat eingebunden, damit die Korrektur ohne Cache-Buster sofort greift.
 */

.password-input-wrap {
  position: relative;
  width: 100%;
}

.password-input-wrap input {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--deep);
  background: #e8f3fc;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  touch-action: manipulation;
}

.password-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.password-toggle .password-eye-closed,
.password-toggle[aria-pressed="true"] .password-eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .password-eye-closed {
  display: block;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: #fff;
  background: #247ec2;
  outline: 3px solid rgba(36, 126, 194, .24);
}

.password-toggle[aria-pressed="true"] {
  color: #fff;
  background: #0d65a8;
}

.auth-panel-primary {
  border-top-color: #247ec2;
}

.auth-panel-primary .badge {
  background: #e8f3fc;
  color: #0d65a8;
}

.auth-panel-primary .button-primary {
  background: #247ec2;
  color: #fff;
}

@media (max-width: 900px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  img,
  iframe,
  video,
  table {
    max-width: 100%;
  }

  .page-shell {
    min-width: 0;
    padding-bottom: calc(108px + env(safe-area-inset-bottom));
  }

  .admin-nav {
    flex-wrap: nowrap;
    margin-inline: -12px;
    padding: 0 12px 7px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .admin-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-nav a {
    flex: 0 0 auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
  }
}

@media (max-width: 1024px) {
  /* Fold- und Tabletansicht: kompakter Einstieg ohne Bild und doppelte Navigation. */
  .hero.hero--welcome {
    min-height: 0;
    padding: clamp(24px, 4vw, 34px);
  }

  .hero--welcome .hero-content {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero--welcome .hero-actions,
  .hero-welcome-visual {
    display: none;
  }

  .hero-highlights {
    margin-top: 18px;
  }
}

@media (max-width: 660px) {
  :root {
    --mobile-page-gap: 12px;
  }

  /* Startseite mobil: kompakter Einstieg ohne das große Willkommen-Bild. */
  .hero.hero--welcome {
    padding: 21px 16px 18px;
  }

  .hero--welcome .hero-content {
    gap: 0;
  }

  .hero.hero--welcome h1 {
    font-size: clamp(1.78rem, 8.2vw, 2.18rem);
    line-height: 1.06;
  }

  .hero-welcome-lead {
    margin-top: 11px;
    font-size: .92rem;
    line-height: 1.5;
  }

  .hero--welcome .hero-actions {
    gap: 9px;
    margin-top: 16px;
  }

  .hero--welcome .hero-actions .button {
    min-height: 46px;
    padding-block: 9px;
  }

  .hero-highlights {
    gap: 7px;
    margin-top: 14px;
  }

  .hero-welcome-visual {
    display: none;
  }

  body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
  }

  .topbar {
    gap: 8px;
    min-height: 64px;
    padding: 8px 11px;
  }

  .brand {
    min-width: 0;
    gap: 8px;
  }

  .brand > span:last-child {
    min-width: 0;
  }

  .brand strong {
    overflow: hidden;
    font-size: clamp(.92rem, 4.7vw, 1.08rem);
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .brand-mark {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
  }

  .topbar-actions {
    flex: 0 0 auto;
    gap: 4px;
  }

  .language-switcher {
    gap: 2px;
    padding: 2px;
  }

  .language-switcher a {
    min-width: 25px;
    padding: 5px 4px;
    font-size: 0;
    text-align: center;
    text-transform: uppercase;
  }

  .language-switcher a::after {
    content: attr(lang);
    font-size: .65rem;
  }

  .app-install-button {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .app-install-button-label,
  .topbar-logout-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .topbar-logout {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .avatar-link {
    flex: 0 0 38px;
  }

  .page-shell {
    width: 100%;
    margin: 0;
    padding: 18px var(--mobile-page-gap) calc(100px + env(safe-area-inset-bottom));
  }

  .page-heading {
    margin: 4px 0 20px;
  }

  .page-heading h1,
  .embedded-booking-heading h1 {
    font-size: clamp(1.78rem, 9vw, 2.45rem);
  }

  h2 {
    font-size: clamp(1.35rem, 7vw, 1.9rem);
  }

  .lead {
    font-size: 1rem;
    line-height: 1.55;
  }

  .hero {
    min-height: 360px;
    padding: 26px 19px;
  }

  .hero.hero--welcome {
    min-height: 0;
  }

  .card {
    padding: 18px 16px;
    border-radius: 17px;
  }

  .trip-card {
    padding-left: 14px;
  }

  .trip-card-head {
    display: grid;
    gap: 10px;
  }

  .trip-card-head .badge {
    justify-self: start;
  }

  .trip-schedule {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .trip-schedule > div,
  .trip-pickup {
    padding: 11px 10px;
  }

  .panel {
    padding: 19px 15px;
    border-radius: 18px;
  }

  .section {
    margin-top: 34px;
  }

  .fieldset {
    padding: 16px 11px;
  }

  .form-grid {
    gap: 15px;
  }

  input,
  select,
  textarea {
    min-height: 50px;
    font-size: 16px;
  }

  input[type="checkbox"],
  input[type="radio"] {
    min-height: 22px;
    width: 22px;
  }

  .choice-card {
    padding: 14px 12px;
  }

  .form-actions,
  .card-actions,
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .form-actions .button,
  .card-actions .button,
  .hero-actions .button {
    width: 100%;
  }

  .flash {
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  .table-wrap {
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    min-width: 620px;
  }

  .embedded-booking-heading {
    margin-top: 2px;
  }

  .embedded-booking-heading .lead {
    margin-top: 12px;
  }

  .embedded-booking-actions {
    gap: 8px;
  }

  .embedded-booking-status {
    position: sticky;
    top: 70px;
    z-index: 12;
    margin: 0 0 10px;
    font-size: .84rem;
  }

  .embedded-booking-shell {
    width: calc(100% + (2 * var(--mobile-page-gap)));
    margin-left: calc(-1 * var(--mobile-page-gap));
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .bottom-nav,
  .bottom-nav.has-management {
    --bottom-nav-items: 7;
    bottom: max(6px, env(safe-area-inset-bottom));
    width: calc(100% - 12px);
    min-height: 64px;
    max-height: 72px;
    grid-template-columns: repeat(var(--bottom-nav-items), minmax(0, 1fr)) !important;
    grid-template-rows: minmax(54px, 1fr) !important;
    grid-auto-flow: column;
    gap: 2px;
    padding: 5px;
    overflow: hidden;
    border-radius: 18px;
  }

  .bottom-nav.has-management {
    --bottom-nav-items: 8;
  }

  .bottom-nav a,
  .bottom-nav.has-management a {
    min-width: 0;
    min-height: 54px;
    max-width: none;
    padding: 4px 1px;
    overflow: hidden;
    gap: 3px;
    font-size: clamp(.5rem, 2.15vw, .64rem);
    line-height: 1;
    white-space: nowrap;
    text-overflow: clip;
  }

  .bottom-nav a span,
  .bottom-nav.has-management a span {
    font-size: clamp(.95rem, 4.3vw, 1.12rem);
  }

  .site-footer {
    padding: 24px 12px calc(96px + env(safe-area-inset-bottom));
  }

  .password-input-wrap input {
    padding-right: 58px;
  }

  .password-toggle {
    width: 44px;
    min-width: 44px;
    height: 40px;
    min-height: 40px;
  }
}

@media (max-width: 360px) {
  .topbar {
    gap: 5px;
    padding-inline: 8px;
  }

  .brand {
    gap: 6px;
  }

  .brand-mark {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .brand strong {
    font-size: .82rem;
  }

  .app-install-button,
  .topbar-logout {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .bottom-nav a,
  .bottom-nav.has-management a {
    font-size: .49rem;
  }

  .bottom-nav a span,
  .bottom-nav.has-management a span {
    font-size: .92rem;
  }
}

@supports not (overflow: clip) {
  @media (max-width: 900px) {
    html,
    body {
      overflow-x: hidden;
    }
  }
}
