/* 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;
  }
}

/* Public header search: compact, accessible autocomplete. */
.site-search{position:relative;display:inline-flex;align-items:center;min-width:min(260px,26vw);max-width:340px;z-index:60}
.site-search-box{display:flex;align-items:center;width:100%;min-height:48px;border:1px solid #dbe3ef;border-radius:999px;background:rgba(255,255,255,.96);box-shadow:0 14px 34px -28px rgba(15,23,42,.55);overflow:hidden;transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}
.site-search:focus-within .site-search-box{border-color:#818cf8;box-shadow:0 18px 40px -28px rgba(79,70,229,.75);background:#fff}
.site-search input{width:100%;min-width:0;border:0;background:transparent;color:#0f172a;font-weight:800;font-size:.92rem;padding:0 10px 0 16px;outline:none;line-height:1.2}
.site-search input::placeholder{color:#64748b;font-weight:800}
.site-search button{width:42px;height:42px;margin-right:3px;border:0;border-radius:999px;background:#eef2ff;color:#3730a3;font-size:1.25rem;font-weight:950;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .16s ease,color .16s ease,transform .16s ease;box-shadow:none!important;padding:0!important;min-height:42px!important}
.site-search button:hover,.site-search button:focus-visible{background:#4f46e5;color:#fff;outline:none;transform:translateY(-1px)}
.site-search-results{position:absolute;top:calc(100% + 10px);left:0;right:0;min-width:360px;max-height:min(70vh,520px);overflow:auto;padding:8px;border:1px solid #dbe3ef;border-radius:20px;background:#fff;box-shadow:0 26px 70px -32px rgba(15,23,42,.58);display:grid;gap:6px;z-index:90}
.site-search-results[hidden]{display:none!important}
.site-search-results a,.site-search-empty{display:grid!important;gap:3px;text-decoration:none;border-radius:14px;padding:11px 13px;color:#0f172a!important;background:#fff;white-space:normal;line-height:1.25}
.site-search-results a span{font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:#4f46e5;font-weight:950}
.site-search-results a strong{font-size:.95rem;font-weight:950;color:#0f172a;line-height:1.15}
.site-search-results a small{font-size:.8rem;color:#64748b;font-weight:750;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.site-search-results a:hover,.site-search-results a:focus,.site-search-results a[aria-selected="true"]{background:#f8fafc;outline:none;box-shadow:inset 0 0 0 1px #c7d2fe}.site-search-empty{color:#64748b;font-weight:850}
@media (max-width:1180px) and (min-width:981px){.site-search{min-width:220px}.nav-right-public .nav-link-public-priority{display:none}}
@media (max-width:980px){.site-search{display:grid;min-width:0;max-width:none;width:100%;order:-2}.site-search-box{border-radius:18px;min-height:52px}.site-search input{font-size:1rem;padding-left:16px}.site-search button{width:44px;height:44px;min-height:44px!important}.site-search-results{position:static;min-width:0;margin-top:8px;max-height:48vh;border-radius:18px;box-shadow:none;background:#f8fafc}.site-search-results a{background:#fff}.mobile-nav-panel .site-search{margin-bottom:4px}}

.nav-auth-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

/* 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;}
}


/* P73: public header search restored. Keep it visible on desktop; hide lower-priority links first. */
@media (min-width:981px){
  .nav .site-search{display:inline-flex!important;flex:0 1 clamp(210px,18vw,300px)!important;min-width:210px!important;max-width:300px!important}
  .nav .site-search-box{background:#fff;border-color:#cbd5e1}
  .nav .site-search input::placeholder{color:#475569;opacity:1}
  .nav .site-search button{background:#eef2ff!important;color:#312e81!important}
  .nav .site-search button:hover,.nav .site-search button:focus-visible{background:#2563eb!important;color:#fff!important;outline:3px solid rgba(191,219,254,.7);outline-offset:2px}
}
@media (min-width:981px) and (max-width:1320px){
  .nav .nav-link-public-priority{display:none!important}
  .nav .site-search{display:inline-flex!important;min-width:190px!important;max-width:250px!important}
}
@media (min-width:981px) and (max-width:1120px){
  .nav .site-search{min-width:170px!important;max-width:220px!important}
  .nav .nav-link[href$="/kontakt"], .nav a.nav-link[href*="support"]{display:none!important}
}

/* v11: unified public header layout and CTA/search alignment. */
@media (min-width:981px){
  .nav .nav-container{
    width:min(1760px,calc(100% - 64px)) !important;
    gap:clamp(12px,1.25vw,24px) !important;
  }
  .nav .nav-right-public-marketing{
    flex:0 1 auto !important;
    min-width:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    gap:clamp(10px,1vw,18px) !important;
    flex-wrap:nowrap !important;
  }
  .nav .site-search{
    flex:0 1 clamp(220px,17vw,310px) !important;
    min-width:220px !important;
    max-width:310px !important;
  }
  .nav .site-search-box{
    min-height:52px !important;
    height:52px !important;
    border-color:#cbd5e1 !important;
    box-shadow:0 16px 36px -30px rgba(15,23,42,.55) !important;
  }
  .nav .site-search input{
    height:50px !important;
    font-size:.95rem !important;
  }
  .nav .site-search button{
    width:46px !important;
    height:46px !important;
    min-height:46px !important;
    margin-right:3px !important;
  }
  .nav .nav-auth-actions{
    flex:0 0 auto !important;
    display:flex !important;
    align-items:center !important;
    gap:clamp(10px,0.9vw,16px) !important;
    flex-wrap:nowrap !important;
    white-space:nowrap !important;
  }
  .nav .nav-auth-actions .nav-link{
    min-width:max-content !important;
    height:52px !important;
    min-height:52px !important;
    padding-inline:12px !important;
  }
  .nav .nav-cta,
  .nav .btn-primary.nav-cta,
  .nav-auth-actions .nav-cta{
    min-width:154px !important;
    height:52px !important;
    min-height:52px !important;
    padding:0 24px !important;
    border:1px solid #3730a3 !important;
    border-radius:16px !important;
    background:linear-gradient(135deg,#4f46e5,#2563eb) !important;
    color:#fff !important;
    font-weight:950 !important;
    box-shadow:0 14px 30px -22px rgba(37,99,235,.75) !important;
    transform:none !important;
  }
  .nav .nav-cta:hover,
  .nav .nav-cta:focus-visible{
    background:linear-gradient(135deg,#4338ca,#1d4ed8) !important;
    box-shadow:0 18px 38px -24px rgba(37,99,235,.85) !important;
    outline:3px solid rgba(191,219,254,.72) !important;
    outline-offset:2px !important;
  }
}
@media (min-width:981px) and (max-width:1460px){
  .nav .site-search{flex-basis:240px !important;min-width:200px !important;max-width:260px !important;}
  .nav .nav-link,.nav .dropdown-toggle{padding-left:10px !important;padding-right:10px !important;}
  .nav .nav-cta,.nav .btn-primary.nav-cta{min-width:140px !important;padding-inline:18px !important;}
}
@media (min-width:981px) and (max-width:1260px){
  .nav .site-search{display:none !important;}
  .nav .nav-link-public-priority{display:none !important;}
}
