/* Vollmacht Focus V6 — stable keyboard focus + desktop focus surface. */

/* Address proportions: postal code is intentionally compact, city gets the room. */
.member-authority-page .row-2:has(.plz-feld){
  grid-template-columns:120px minmax(0,1fr)!important;
}

@media(max-width:700px){
  /* Existing V4 already detects the real iOS visual keyboard. While it is open,
     navigation disappears so typing cannot be confused with step navigation. */
  body.bw-vm-viewport-v4.bw-vm-keyboard-open .member-authority-page .step-buttons,
  body.bw-vm-viewport-v4.bw-vm-keyboard-open .member-authority-page .bw-vm-pane__actions{
    display:none!important;
  }

  body.bw-vm-viewport-v4.bw-vm-keyboard-open .member-authority-page .bw-vm-pane.is-active{
    padding-bottom:8px!important;
  }

  .member-authority-page .row-2:has(.plz-feld){
    grid-template-columns:92px minmax(0,1fr)!important;
    gap:7px!important;
  }
}

@media(max-width:390px){
  /* Keep PLZ + Ort on one row even on narrow iPhones; only this address row
     overrides the older generic one-column rule. */
  .member-authority-page .row-2:has(.plz-feld){
    grid-template-columns:84px minmax(0,1fr)!important;
  }
}

/* Desktop/tablet focus mode: the actual Vollmacht becomes the only active surface.
   The underlying member page remains visible as context, but is dimmed and blurred. */
@media(min-width:701px){
  body[data-scope="member"]{
    overflow:hidden!important;
  }

  .member-authority-page::before{
    content:"";
    position:fixed!important;
    inset:0!important;
    z-index:1500!important;
    background:rgba(2,8,14,.56)!important;
    backdrop-filter:blur(10px) saturate(.88)!important;
    -webkit-backdrop-filter:blur(10px) saturate(.88)!important;
  }

  .member-authority-page .member-authority-layout{
    position:fixed!important;
    inset:0!important;
    z-index:1501!important;
    width:auto!important;
    height:auto!important;
    margin:0!important;
    padding:28px!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    place-items:center!important;
    overflow:hidden!important;
    pointer-events:none!important;
  }

  .member-authority-page .form-container{
    position:relative!important;
    z-index:1!important;
    width:min(760px,calc(100vw - 64px))!important;
    max-width:760px!important;
    max-height:calc(100dvh - 56px)!important;
    min-height:0!important;
    margin:0!important;
    padding:clamp(24px,3vw,34px)!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
    pointer-events:auto!important;
    border-radius:28px!important;
    box-shadow:0 38px 110px rgba(0,0,0,.48),0 0 0 1px rgba(119,205,239,.04)!important;
  }

  .member-authority-page .vollmacht-info{
    display:none!important;
  }

  .member-authority-page #vollmacht-form{
    min-height:0!important;
    overflow:hidden!important;
  }

  .member-authority-page #vollmacht-form>.form-step.active{
    min-height:0!important;
    max-height:calc(100dvh - 210px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable!important;
  }

  .member-authority-page .bw-vm-pane.is-active{
    min-height:0!important;
  }

  .member-authority-page .form-header,
  .member-authority-page .progress-container,
  .member-authority-page .bw-vm-wizard-meta{
    flex:0 0 auto!important;
  }
}

@media(min-width:981px){
  /* Desktop member navigation is a 240px left rail. Center the focus card inside
     the actual workspace rather than the entire monitor. */
  .member-authority-page .member-authority-layout{
    left:240px!important;
  }

  .member-authority-page .form-container{
    width:min(760px,calc(100vw - 320px))!important;
  }
}

@media(prefers-reduced-motion:reduce){
  .member-authority-page .form-container{
    scroll-behavior:auto!important;
  }
}

/* Security gate: the protected authority form is fail-closed before deferred auth
   finishes. The existing member guard is the only code allowed to release it. */
body[data-scope="member"] .member-authority-page{
  visibility:hidden!important;
}
body[data-scope="member"] .member-authority-page::after{
  content:"Geschützter Mitgliederbereich wird geprüft …";
  visibility:visible!important;
  position:fixed!important;
  inset:0!important;
  z-index:2100!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:32px!important;
  box-sizing:border-box!important;
  background:var(--bw-bg,#f5f8fa)!important;
  color:var(--bw-muted,#617083)!important;
  font-family:var(--bw-display,"Oswald",sans-serif)!important;
  font-size:.86rem!important;
  font-weight:700!important;
  letter-spacing:.055em!important;
  text-transform:uppercase!important;
  text-align:center!important;
}
html.bw-member-auth-ready body[data-scope="member"] .member-authority-page{
  visibility:visible!important;
}
html.bw-member-auth-ready body[data-scope="member"] .member-authority-page::after{
  content:none!important;
  display:none!important;
}
