/* ============================================================
   Hazırlıklı R5 — Visual Productization + Mobile Viewport Lock
   Scope: presentation/layout only. Product Core routing/provider
   contracts remain owned by R4/R4.1.
============================================================ */

:root{
  --r5-panel:linear-gradient(180deg,var(--surface-elevated) 0%,var(--surface) 100%);
  --r5-panel-soft:linear-gradient(180deg,var(--surface) 0%,var(--surface-soft) 100%);
  --r5-accent-glow:var(--shadow-accent);
  --r5-card-shadow:var(--shadow-raised);
}

/* ---------- Auth: top anchored, compact, keyboard-safe ---------- */
@media (max-width:767px){
  html{min-height:100%;background:var(--background)}
  body.hz-auth-page{
    min-height:100dvh!important;
    height:auto!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    background:var(--background)!important;
    overscroll-behavior-y:contain!important;
  }
  body.hz-auth-page > .relative.z-10{
    min-height:100dvh!important;
    height:auto!important;
    display:block!important;
  }
  body.hz-auth-page > .relative.z-10 > .hz-auth-flow{
    width:100%!important;
    min-height:100dvh!important;
    height:auto!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-start!important;
    align-items:stretch!important;
    padding:max(14px,env(safe-area-inset-top,0px)) 18px calc(18px + env(safe-area-inset-bottom,0px))!important;
  }
  body.hz-auth-page .hz-auth-flow > .w-full.max-w-lg{
    width:100%!important;
    max-width:520px!important;
    min-width:0!important;
    margin:0 auto!important;
    padding:0!important;
  }
  body.hz-auth-page [data-language-switcher]{margin:0 0 10px!important}
  body.hz-auth-page a.lg\:hidden.flex.items-center{margin:0 0 12px!important}
  body.hz-auth-page a.lg\:hidden .w-11{width:40px!important;height:40px!important}
  body.hz-auth-page h2{margin:5px 0 0!important;font-size:2rem!important;line-height:1.03!important}
  body.hz-auth-page h2 + p{margin:8px 0 0!important;font-size:.91rem!important;line-height:1.42!important}
  body.hz-auth-page form{margin-top:12px!important}
  body.hz-auth-page form.space-y-5 > :not([hidden]) ~ :not([hidden]){margin-top:9px!important}
  body.hz-auth-page label{margin-bottom:5px!important}
  body.hz-auth-page .input{min-height:49px!important;padding:10px 13px!important}
  body.hz-auth-page form button[type="submit"]{
    position:static!important;
    inset:auto!important;
    width:100%!important;
    min-height:52px!important;
    margin-top:10px!important;
    box-shadow:var(--shadow-accent)!important;
  }
  body.hz-auth-page form + .h-px{margin:11px 0!important}
  body.hz-auth-page form + .h-px + p{margin:0!important;padding:0!important}
  body.hz-page-signup h2{font-size:1.9rem!important}
  body.hz-page-signup h2 + p{display:none!important}
  body.hz-page-signup form{margin-top:9px!important}
  body.hz-page-signup label.flex.items-start{gap:8px!important;font-size:.77rem!important;line-height:1.25!important}
  body.hz-page-signup label.flex.items-start .block.text-xs{margin-top:2px!important;font-size:.71rem!important}
  body.hz-page-signup form + .h-px{margin:9px 0!important}
  body.hz-page-forgot-password .hz-public-auth-return,
  body.hz-page-reset-password .hz-public-auth-return{margin-top:12px!important}
  body.hz-settings-recovery .hz-settings-recovery-back{margin:0 0 10px!important}
  body.hz-settings-recovery .hz-public-auth-return{display:none!important}

  /* VisualViewport shrinks when the keyboard opens. We keep one scroll owner
     and never vertically re-center a focused form. */
  body.hz-keyboard-open.hz-auth-page > .relative.z-10 > .hz-auth-flow{
    min-height:max(var(--hz-visual-height,100dvh),420px)!important;
    justify-content:flex-start!important;
    padding-top:8px!important;
    padding-bottom:calc(24px + var(--hz-keyboard-offset,0px) + env(safe-area-inset-bottom,0px))!important;
  }
}

@media (max-width:767px) and (max-height:700px){
  body.hz-auth-page > .relative.z-10 > .hz-auth-flow{padding-top:6px!important}
  body.hz-auth-page [data-language-switcher]{margin-bottom:6px!important}
  body.hz-auth-page a.lg\:hidden.flex.items-center{margin-bottom:8px!important}
  body.hz-auth-page h2{font-size:1.78rem!important}
  body.hz-auth-page form{margin-top:7px!important}
  body.hz-auth-page .input{min-height:45px!important}
}

/* ---------- Product shell: fixed dVH, one internal scroll owner ---------- */
.hzv3-app{
  height:var(--hz-visual-height,100dvh)!important;
  min-height:0!important;
  background:
    radial-gradient(90% 42% at 50% -8%,var(--accent-10),transparent 60%),
    var(--background)!important;
}
.hzv3-header,
.hzv3-tabbar{
  background:linear-gradient(180deg,var(--surface-alpha-strong),var(--surface-alpha))!important;
  border-color:var(--border)!important;
}
.hzv3-main{
  min-height:0!important;
  overflow-y:auto!important;
  overscroll-behavior-y:contain!important;
  padding:14px 16px calc(20px + env(safe-area-inset-bottom,0px))!important;
  scroll-padding-bottom:24px!important;
}
.hzv3-page{max-width:620px!important}
.hzv3-hero{padding:7px 3px 11px!important}
.hzv3-hero h2{font-size:30px!important;line-height:1.04!important;margin:7px 0 9px!important}
.hzv3-hero p,.hzv3-section-title p{color:var(--text-secondary)!important}

.hzv3-card,
.hzv3-solution,
.hzv3-history-item,
.hzv3-setting-row,
.hzv3-memory-row,
.hzv3-plan-card{
  background:var(--r5-panel)!important;
  border-color:var(--border)!important;
  box-shadow:var(--r5-card-shadow)!important;
}
.hzv3-card:hover,
.hzv3-solution:hover,
.hzv3-setting-row:hover,
.hzv3-history-item:hover{border-color:var(--accent-border)!important}

.hzv3-memory{
  background:
    radial-gradient(120px 100px at 100% 0,var(--accent-12),transparent 72%),
    var(--r5-panel)!important;
}
.hzv3-memory::after{display:none!important}
.hzv3-brain,
.hzv3-solution-icon,
.hzv3-setting-row .ico,
.hzv3-history-item .icon{
  background:linear-gradient(180deg,var(--accent-12),var(--surface-soft))!important;
  border:1px solid var(--accent-border)!important;
  color:var(--accent-strong)!important;
}
.hzv3-primary,
.hzv3-create-orb,
.btn-primary{
  background:var(--accent-gradient)!important;
  color:var(--on-accent)!important;
  border-color:var(--accent-border)!important;
  box-shadow:var(--r5-accent-glow)!important;
}
.hzv3-primary:active,.hzv3-solution:active{transform:translateY(1px)}
.hzv3-textarea,
.hzv3-create-lead textarea{
  background:var(--surface-soft)!important;
  border-color:var(--border-strong)!important;
}
.hzv3-textarea:focus,
.hzv3-create-lead textarea:focus{
  border-color:var(--accent-border)!important;
  box-shadow:var(--focus-ring)!important;
}
.hzv3-tab.is-active:not(.hzv3-tab-create)::before{
  background:linear-gradient(180deg,var(--accent-10),var(--accent-04))!important;
  border-color:var(--accent-border)!important;
}

/* 8 premium workflows live on the Solutions surface. The page scrolls inside
   the app shell, never the browser viewport. */
.hzv3-page-solutions .hzv3-list{gap:9px!important;padding-bottom:4px}
.hzv3-page-solutions .hzv3-solution{min-height:68px!important;padding:11px 12px!important}
.hzv3-page-solutions .hzv3-solution strong{font-size:13.5px!important}
.hzv3-page-solutions .hzv3-solution small{font-size:10.2px!important;line-height:1.36!important}

/* ---------- Legacy/native detail pages: same compact geometry ---------- */
@media (max-width:767px){
  body.hz-native-shell{
    height:var(--hz-vvh,100dvh)!important;
    max-height:var(--hz-vvh,100dvh)!important;
    min-height:0!important;
    overflow:hidden!important;
  }
  body.hz-native-shell .hz-app-shell-scroll,
  body.hz-native-shell > .hz-native-content-root{
    min-height:0!important;
  }
  body.hz-native-shell .hz-app-shell-scroll{
    overflow-y:auto!important;
    padding-bottom:calc(18px + env(safe-area-inset-bottom,0px))!important;
  }
  body.hz-native-shell.hz-page-brand-profiles > main.hz-native-content-root{
    overflow-x:hidden!important;
    overflow-y:auto!important;
    padding:12px 16px calc(24px + env(safe-area-inset-bottom,0px))!important;
    scroll-padding-bottom:24px!important;
  }
  body.hz-native-shell.hz-page-brand-profiles .hz-context-back{
    margin:0 0 10px!important;
    min-height:42px!important;
    padding:8px 12px!important;
  }
  body.hz-native-shell.hz-page-brand-profiles main > section:first-of-type{
    margin:0!important;
    padding:0!important;
  }
  body.hz-native-shell.hz-page-brand-profiles main > section:first-of-type .badge{margin-top:0!important}
  body.hz-native-shell.hz-page-brand-profiles main > section:first-of-type h1{
    font-size:2rem!important;
    line-height:1.05!important;
    margin:12px 0 0!important;
  }
  body.hz-native-shell.hz-page-brand-profiles main > section:first-of-type p{
    margin:10px 0 0!important;
    line-height:1.5!important;
  }
  body.hz-native-shell.hz-page-brand-profiles #pageNotice{margin-top:14px!important}
}

/* ---------- R5.0.1 launch polish: remove floating-center illusion ---------- */
@media (max-width:767px){
  body.hz-auth-page .hz-auth-flow > .w-full.max-w-lg{position:relative!important}
  body.hz-auth-page [data-language-switcher]{
    position:absolute!important;
    top:0!important;
    right:0!important;
    z-index:4!important;
    margin:0!important;
  }
  body.hz-auth-page a.lg\:hidden.flex.items-center{
    width:max-content!important;
    max-width:calc(100% - 128px)!important;
    min-height:48px!important;
    margin:0 0 12px!important;
  }
  body.hz-auth-page > .relative.z-10 > .hz-auth-flow{
    padding-top:max(12px,env(safe-area-inset-top,0px))!important;
  }
  body.hz-auth-page .hz-auth-flow > .w-full.max-w-lg{
    padding-bottom:8px!important;
  }
  body.hz-auth-page form + .h-px + p,
  body.hz-page-signup form + .h-px + p{
    padding-bottom:0!important;
    margin-bottom:0!important;
  }
  body.hz-page-login .hz-auth-flow,
  body.hz-page-forgot-password .hz-auth-flow,
  body.hz-page-reset-password .hz-auth-flow,
  body.hz-page-signup .hz-auth-flow{
    align-content:start!important;
  }
  body.hz-settings-recovery .hz-settings-recovery-back{
    width:max-content!important;
    margin:0 0 9px!important;
  }
  body.hz-settings-recovery a.lg\:hidden.flex.items-center{
    margin-bottom:10px!important;
  }
}

/* Product pages remain fixed to the visual viewport; only the content rail scrolls. */
@media (max-width:767px){
  .hzv3-app{height:var(--hz-visual-height,100dvh)!important;max-height:var(--hz-visual-height,100dvh)!important}
  .hzv3-main{height:auto!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important}
  .hzv3-page{margin:0 auto!important;padding:0!important}
  .hzv3-page-home,.hzv3-page-solutions,.hzv3-page-create,.hzv3-page-history,.hzv3-page-settings{
    min-height:min-content!important;
  }
  .hzv3-section-title{margin-top:1px!important;margin-bottom:12px!important}
  .hzv3-list{padding-bottom:8px!important}
  .hzv3-tabbar{padding-bottom:max(var(--hz-safe-bottom),env(safe-area-inset-bottom,0px))!important}
}

/* Premium workflow treatment: one product system, eight outcome cards. */
.hzv3-page-solutions .hzv3-solution{
  position:relative!important;
  overflow:hidden!important;
  background:
    linear-gradient(180deg,var(--surface-alpha-strong),var(--surface-alpha))!important;
}
.hzv3-page-solutions .hzv3-solution::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:2px;
  background:linear-gradient(180deg,transparent,var(--accent),transparent);
  opacity:.55;
}
.hzv3-page-solutions .hzv3-solution-icon{box-shadow:inset 0 0 0 1px var(--accent-04)!important}
.hzv3-page-solutions .hzv3-solution strong{letter-spacing:-.01em!important}

/* Home hero reads as a premium action surface rather than a floating form. */
.hzv3-page-home .hzv3-problem{
  background:
    radial-gradient(110% 110% at 100% 0,var(--accent-10),transparent 56%),
    var(--r5-panel)!important;
  box-shadow:var(--shadow-soft),0 0 0 1px var(--accent-04)!important;
}
.hzv3-page-home .hzv3-memory{margin-top:5px!important}
.hzv3-page-home .hzv3-problem{margin-top:10px!important}

/* Brand Profile: compact contextual return, no floating gaps. */
@media (max-width:767px){
  body.hz-page-brand-profiles.hz-native-shell > main.hz-native-content-root{
    padding-top:10px!important;
  }
  body.hz-page-brand-profiles .hz-context-back{
    margin:0 0 8px!important;
  }
  body.hz-page-brand-profiles .hz-context-back + *{margin-top:0!important}
}
