/* P30 hotfix: authenticated header buttons must stay readable.
   Global button styles were leaking into nav buttons after login,
   making dropdown labels white / unreadable on a light header. */

.nav .dropdown-toggle,
.nav .user-dropdown-toggle{
  color:#475569 !important;
  background:transparent !important;
  box-shadow:none !important;
  border:1px solid transparent;
  border-radius:999px;
  padding:12px 14px;
  min-height:48px;
  font-weight:800;
  font-size:.95rem;
  line-height:1;
  white-space:nowrap;
  text-decoration:none;
}

.nav .dropdown-toggle:hover,
.nav .dropdown-toggle:focus-visible,
.nav .dropdown:focus-within > .dropdown-toggle,
.nav .user-dropdown-toggle:hover,
.nav .user-dropdown-toggle:focus-visible,
.nav .user-dropdown:focus-within > .user-dropdown-toggle{
  color:#3730a3 !important;
  background:#eef2ff !important;
  border-color:#c7d2fe;
  outline:none;
}

.nav .user-dropdown-toggle{
  max-width:100%;
}

/* Keep authenticated nav controls fully interactive on desktop. */
@media (min-width:981px){
  .nav-links .dropdown,
  .nav-right .user-dropdown{display:inline-flex;align-items:center;}
  .nav-links .dropdown > .dropdown-toggle,
  .nav-right .user-dropdown > .user-dropdown-toggle{pointer-events:auto;position:relative;z-index:1;}
}

/* Mobile drawer should style the authenticated user menu like the other menu buttons. */
@media (max-width:980px){
  .mobile-nav-panel .dropdown-toggle,
  .mobile-nav-panel .user-dropdown-toggle,
  .mobile-nav-panel .nav-right-public .nav-link,
  .mobile-nav-panel .nav-right-public .nav-cta{
    width:100%;
    box-sizing:border-box;
    min-height:48px;
    display:flex !important;
    align-items:center;
    justify-content:space-between;
    border:1px solid #dbe3ef;
    border-radius:18px;
    background:#fff !important;
    color:#0f172a !important;
    padding:14px 16px;
    font-size:1rem;
    line-height:1.2;
    box-shadow:0 10px 28px -26px rgba(15,23,42,.45) !important;
  }

  .mobile-nav-panel .dropdown-toggle:hover,
  .mobile-nav-panel .dropdown-toggle:focus-visible,
  .mobile-nav-panel .user-dropdown-toggle:hover,
  .mobile-nav-panel .user-dropdown-toggle:focus-visible,
  .mobile-nav-panel .nav-right-public .nav-link:hover,
  .mobile-nav-panel .nav-right-public .nav-link:focus-visible{
    background:#eef2ff !important;
    color:#312e81 !important;
    border-color:#c7d2fe;
    outline:none;
  }

  .mobile-nav-panel .nav-right-public .nav-cta{
    justify-content:center;
    background:linear-gradient(135deg,#4f46e5,#2563eb) !important;
    color:#fff !important;
    border-color:#3730a3;
    box-shadow:0 16px 34px -24px rgba(79,70,229,.55) !important;
  }
}

/* Auth-Shell: eingeloggte Nutzer sehen Dashboard-Handoff und Logout statt Login/Register. */
.nav-right-authenticated{gap:.75rem;align-items:center}
.nav-form-inline{display:inline-flex;margin:0}
.nav-button-link{border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;padding:.5rem .75rem;border-radius:999px}
.nav-button-link:hover,.nav-button-link:focus-visible{background:rgba(79,70,229,.08);outline:none}

/* Header alignment + authenticated public nav replacement. */
.nav-right-public,
.nav-auth-actions{
  display:inline-flex;
  align-items:center;
  gap:.75rem;
  flex-wrap:wrap;
}

.nav-right-public .nav-link,
.nav-right-public .nav-cta,
.nav-auth-actions .nav-link,
.nav-auth-actions .nav-cta{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  min-height:48px;
  height:48px;
  box-sizing:border-box;
  padding-top:0 !important;
  padding-bottom:0 !important;
  line-height:1 !important;
  vertical-align:middle;
}

.nav-auth-actions .nav-dashboard-link{
  padding-inline:18px !important;
}

.nav-auth-actions .nav-logout-link{
  color:#475569 !important;
}

@media (max-width:980px){
  .nav-auth-actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr;
    gap:.6rem;
  }
  .nav-auth-actions .nav-link,
  .nav-auth-actions .nav-cta{
    width:100%;
    height:auto;
    min-height:48px;
    padding-top:14px !important;
    padding-bottom:14px !important;
  }
}

/* P32 header/auth layout: keep public authenticated nav on one desktop row.
   The marketing header has more items after login (Dashboard + Logout), so the
   old 1180px nav container caused wrapping. This stays compact on desktop and
   falls back to the existing drawer under 980px. */
@media (min-width:981px){
  .nav .nav-container{
    width:min(1680px,calc(100% - 64px)) !important;
    max-width:none !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:clamp(14px,1.7vw,28px) !important;
    flex-wrap:nowrap !important;
  }
  .nav .nav-logo{
    flex:0 0 auto !important;
    min-width:max-content !important;
  }
  .nav .mobile-nav-panel{
    display:contents !important;
  }
  .nav .mobile-nav-panel-head,
  .nav .mobile-nav-backdrop,
  .nav .mobile-menu-toggle{
    display:none !important;
  }
  .nav .nav-links{
    flex:1 1 auto !important;
    min-width:0 !important;
    justify-content:center !important;
    flex-wrap:nowrap !important;
  }
  .nav .nav-right,
  .nav .nav-right-public,
  .nav .nav-auth-actions{
    flex:0 1 auto !important;
    min-width:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    gap:clamp(8px,1vw,16px) !important;
    flex-wrap:nowrap !important;
  }
  .nav .nav-auth-actions{
    flex:0 0 auto !important;
    white-space:nowrap !important;
  }
  .nav .site-search{
    flex:1 1 300px !important;
    min-width:220px !important;
    max-width:360px !important;
  }
  .nav .nav-link,
  .nav .nav-cta,
  .nav .dropdown-toggle,
  .nav .user-dropdown-toggle{
    white-space:nowrap !important;
  }
  .nav-auth-actions .nav-dashboard-link{
    min-width:max-content !important;
  }
}
@media (min-width:981px) and (max-width:1380px){
  .nav .nav-logo-text{font-size:1.72rem !important;}
  .nav .nav-logo-mark{width:40px !important;height:40px !important;flex-basis:40px !important;}
  .nav .site-search{max-width:300px !important;min-width:190px !important;}
  .nav .nav-link,.nav .nav-cta,.nav .dropdown-toggle{padding-left:10px !important;padding-right:10px !important;}
  .nav-auth-actions .nav-dashboard-link{padding-left:14px !important;padding-right:14px !important;}
}
@media (min-width:981px) and (max-width:1210px){
  .nav .site-search{display:none !important;}
  .nav .nav-link-public-priority{display:none !important;}
}
@media (min-width:981px) and (max-width:1080px){
  .nav .nav-logo-text{font-size:1.45rem !important;}
  .nav .nav-logo-mark{width:36px !important;height:36px !important;flex-basis:36px !important;}
}

/* Already-authenticated login page replacement on the Auth server. */
.auth-already-panel{
  display:none;
  gap:18px;
  padding:26px;
  border:1px solid #dbe3ef;
  border-radius:28px;
  background:linear-gradient(180deg,#ffffff,#f8fbff);
  box-shadow:0 24px 70px -48px rgba(15,23,42,.55);
}
.auth-card[data-auth-login-replaced="true"] .auth-header,
.auth-card[data-auth-login-replaced="true"] .login-main-form,
.auth-card[data-auth-login-replaced="true"] .sso-divider,
.auth-card[data-auth-login-replaced="true"] .social-login-grid,
.auth-card[data-auth-login-replaced="true"] .social-note,
.auth-card[data-auth-login-replaced="true"] .sso-accordion,
.auth-card[data-auth-login-replaced="true"] .login-footer-actions{
  display:none !important;
}
.auth-card[data-auth-login-replaced="true"] .auth-already-panel{
  display:grid !important;
}
.auth-already-icon{
  width:58px;
  height:58px;
  border-radius:20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#eef2ff;
  color:#3730a3;
  font-weight:950;
  font-size:1.45rem;
}
.auth-already-panel h1{margin:0;color:#0f172a;font-size:clamp(2rem,4vw,3.4rem);line-height:.95;letter-spacing:-.06em;}
.auth-already-panel p{margin:0;color:#64748b;font-weight:750;line-height:1.55;}
.auth-already-actions{display:flex;gap:12px;flex-wrap:wrap;align-items:center;}
.auth-already-actions .btn-primary,
.auth-already-actions .btn-secondary{min-height:48px;display:inline-flex;align-items:center;justify-content:center;}
@media (max-width:640px){.auth-already-actions{display:grid}.auth-already-actions a{width:100%;box-sizing:border-box}}

/* P33 header balance: undo the overly wide P32 desktop spread.
   The header stays on one row, but the content is centered again so logo,
   search/navigation and auth actions do not drift to the page edges on wide screens. */
@media (min-width:981px){
  .nav .nav-container{
    width:min(1480px,calc(100% - 72px)) !important;
    max-width:1480px !important;
    justify-content:space-between !important;
    gap:clamp(18px,2.2vw,36px) !important;
  }
  .nav .nav-logo{
    flex:0 0 auto !important;
  }
  .nav .nav-right-public{
    flex:1 1 auto !important;
    justify-content:flex-end !important;
    gap:clamp(8px,.85vw,14px) !important;
  }
  .nav .nav-auth-actions{
    gap:clamp(8px,.75vw,12px) !important;
  }
  .nav .site-search{
    flex:0 1 clamp(230px,18vw,310px) !important;
    min-width:210px !important;
    max-width:310px !important;
  }
  .nav .nav-link,
  .nav .nav-cta,
  .nav .dropdown-toggle,
  .nav .user-dropdown-toggle{
    min-height:46px !important;
  }
}

@media (min-width:981px) and (max-width:1500px){
  .nav .nav-container{
    width:min(1360px,calc(100% - 48px)) !important;
    max-width:1360px !important;
  }
  .nav .site-search{
    max-width:260px !important;
    min-width:190px !important;
  }
}

@media (min-width:981px) and (max-width:1320px){
  .nav .site-search{
    display:none !important;
  }
}

@media (min-width:981px) and (max-width:1160px){
  .nav .nav-link-public-priority{
    display:none !important;
  }
  .nav-auth-actions .nav-dashboard-link{
    padding-left:12px !important;
    padding-right:12px !important;
  }
}



/* P34 public/auth header balance: match app header width.
   The previous public-header fix used a very wide 1680px shell so the logo and
   actions drifted apart on large screens. Keep the public/auth shell aligned
   with the application header while still preventing the Dashboard/Logout
   replacement from wrapping. */
@media (min-width:981px){
  .nav .nav-container{
    width:min(1296px,calc(100% - 32px)) !important;
    max-width:1296px !important;
    margin-left:auto !important;
    margin-right:auto !important;
    padding:14px 0 !important;
    gap:clamp(12px,1.15vw,20px) !important;
    justify-content:space-between !important;
  }
  .nav .nav-logo{
    flex:0 0 auto !important;
  }
  .nav .nav-right-public{
    flex:0 1 auto !important;
    min-width:0 !important;
    gap:clamp(8px,.8vw,14px) !important;
  }
  .nav .site-search{
    flex:0 1 280px !important;
    width:clamp(220px,18vw,300px) !important;
    min-width:220px !important;
    max-width:300px !important;
  }
  .nav .nav-auth-actions{
    flex:0 0 auto !important;
    gap:clamp(8px,.8vw,14px) !important;
  }
  .nav-auth-actions .nav-dashboard-link{
    padding-left:18px !important;
    padding-right:18px !important;
  }
}
@media (min-width:981px) and (max-width:1320px){
  .nav .site-search{display:none !important;}
  .nav .nav-link-public-priority{display:none !important;}
}
@media (min-width:981px) and (max-width:1120px){
  .nav .public-discovery-toggle{min-width:auto !important;}
  .nav-auth-actions .nav-dashboard-link{padding-left:14px !important;padding-right:14px !important;}
}

/* v67 Auth-Shell return header: stable alignment for Dashboard + Logout.
   The global dropdown rule `.nav-form button { width:100% }` made the header
   logout control stretch like a mobile menu item. In the auth self-service
   header these actions must stay compact and aligned on one baseline. */
.nav-right-authenticated,
.nav-auth-actions{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:12px !important;
  flex-wrap:nowrap !important;
}
.nav-right-authenticated .nav-form-inline,
.nav-auth-actions .nav-form-inline{
  display:inline-flex !important;
  align-items:center !important;
  width:auto !important;
  margin:0 !important;
  padding:0 !important;
  flex:0 0 auto !important;
}
.nav-right-authenticated .nav-form-inline .nav-button-link,
.nav-auth-actions .nav-form-inline .nav-button-link,
.nav-auth-actions .nav-logout-link{
  width:auto !important;
  min-width:0 !important;
  min-height:48px !important;
  height:48px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:0 16px !important;
  border-radius:999px !important;
  white-space:nowrap !important;
  line-height:1 !important;
  box-sizing:border-box !important;
  flex:0 0 auto !important;
}
.nav-right-authenticated .nav-cta,
.nav-auth-actions .nav-dashboard-link{
  height:48px !important;
  min-height:48px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:0 20px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  box-sizing:border-box !important;
  flex:0 0 auto !important;
}
@media (max-width:980px){
  .nav-right-authenticated,
  .nav-auth-actions{
    width:100% !important;
    display:grid !important;
    grid-template-columns:1fr !important;
    align-items:stretch !important;
    gap:10px !important;
  }
  .nav-right-authenticated .nav-cta,
  .nav-right-authenticated .nav-form-inline,
  .nav-right-authenticated .nav-form-inline .nav-button-link,
  .nav-auth-actions .nav-dashboard-link,
  .nav-auth-actions .nav-logout-link{
    width:100% !important;
    justify-content:center !important;
  }
}
