/* Public signup consent — viewport/interaction repair 2026-10-19.
   A single inner scroll surface, no scrolling on locked document.
   Preserve approved theme tokens and the entire nine-section disclosure. */

/* PC rewrites main.auth-register-shell -> main.kovra-pc-register-root.
   Either version must stay truly hidden and inert before acceptance. */
html body.signup-consent-pending main.auth-register-shell,
html body.signup-consent-pending main.kovra-pc-register-root,
html body main.auth-register-shell[hidden],
html body main.kovra-pc-register-root[hidden] {
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

html body #signupConsentOverlay[hidden],
html body #signupConsentOverlay[aria-hidden="true"] {
  display:none!important;
  pointer-events:none!important;
}

html body.signup-consent-pending {
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
html body.signup-consent-pending #signupConsentOverlay {
  position:fixed!important;
  inset:0!important;
  box-sizing:border-box!important;
  width:100%!important;
  height:100dvh!important;
  min-height:0!important;
  max-height:none!important;
  z-index:10000!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  margin:0!important;
  overflow:hidden!important;
  pointer-events:auto!important;
  overscroll-behavior:none!important;
  background:var(--theme-bg,#06130c)!important;
}
@supports(height:100svh){
  html body.signup-consent-pending #signupConsentOverlay {
    height:100svh!important;
  }
}
html body.signup-consent-pending #signupConsentOverlay > .signup-consent-card {
  position:relative!important;
  box-sizing:border-box!important;
  display:block!important;
  min-height:0!important;
  max-height:calc(100dvh - 32px)!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior-y:contain!important;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-y!important;
  pointer-events:auto!important;
  scroll-padding-block:20px;
  scrollbar-width:thin;
  color:var(--theme-text,#f4f7f5)!important;
}
@supports(height:100svh){
  html body.signup-consent-pending #signupConsentOverlay > .signup-consent-card {
    max-height:calc(100svh - 32px)!important;
  }
}

/* The legal acknowledgement must have a generous, reliable touch target;
   the real native checkbox covers only its label and remains keyboard usable. */
html body #signupConsentOverlay .signup-consent-actions {
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:14px!important;
  margin:18px 0 0!important;
  padding:18px 0 22px!important;
  border-top:1px solid var(--theme-border,rgba(91,234,136,.23))!important;
}
html body #signupConsentOverlay .signup-consent-actions .signup-consent-check {
  position:relative!important;
  display:grid!important;
  margin:0!important;
  padding:16px 14px!important;
  min-height:66px!important;
  align-items:start!important;
  gap:12px!important;
  cursor:pointer!important;
}
html body #signupConsentOverlay .signup-consent-actions #signupConsentCheck {
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  margin:0!important;
  padding:0!important;
  opacity:0!important;
  pointer-events:auto!important;
  cursor:pointer!important;
  z-index:2!important;
}
html body #signupConsentOverlay .signup-consent-actions .signup-consent-box,
html body #signupConsentOverlay .signup-consent-actions .signup-consent-check span:last-child {
  pointer-events:none!important;
}
html body #signupConsentOverlay .signup-consent-actions .signup-consent-check:focus-within {
  outline:2px solid var(--theme-accent,#35e86a)!important;
  outline-offset:3px!important;
}
html body #signupConsentOverlay .signup-consent-actions #signupConsentContinue {
  margin:0!important;
  min-height:50px!important;
  pointer-events:auto!important;
  touch-action:manipulation;
}
html body #signupConsentOverlay .signup-consent-actions #signupConsentBack {
  margin:0!important;
  min-height:44px!important;
  pointer-events:auto!important;
  touch-action:manipulation;
}
@media(max-width:700px) {
  html body.signup-consent-pending #signupConsentOverlay {
    padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px)
      env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)!important;
  }
  html body.signup-consent-pending #signupConsentOverlay > .signup-consent-card {
    flex:1 1 auto!important;
    width:100%!important;
    max-width:none!important;
    height:100%!important;
    max-height:100%!important;
    padding-bottom:max(24px,env(safe-area-inset-bottom,0px))!important;
    transform:none!important;
  }
  html body #signupConsentOverlay .signup-consent-actions {
    margin-top:20px!important;
    padding-top:18px!important;
    padding-bottom:22px!important;
    gap:15px!important;
  }
  html body #signupConsentOverlay .signup-consent-actions .signup-consent-check {
    padding:16px 14px!important;
    min-height:76px!important;
  }
}
/* Readable keyboard/scroll geometry on shorter screens: never let a breakpoint
   switch the overlay itself to a second scrollable container. */
@media(max-height:720px){
  html body.signup-consent-pending #signupConsentOverlay {
    align-items:center!important;
    overflow:hidden!important;
  }
  html body.signup-consent-pending #signupConsentOverlay > .signup-consent-card {
    min-height:0!important;
    overflow-y:auto!important;
  }
}
