/* YCW Portal RC40: sidebar control geometry and branded loader.
   Scoped to existing portal markup; no changes to WHMCS form or menu actions. */

/* The legacy sidebar paints both a shortcut li and its inner link. One surface
   avoids a square dark layer showing outside rounded corners. */
body.ycw-portal .wdes-sidebar .shortcuts,
body.ycw-portal .wdes-sidebar ul.shortcuts {
  gap:10px!important;
  overflow:visible!important;
  isolation:isolate;
}
body.ycw-portal .wdes-sidebar .shortcuts > li {
  position:relative;
  margin:0!important;
  padding:0!important;
  min-width:0;
  overflow:visible!important;
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  border-radius:13px!important;
  box-shadow:none!important;
}
body.ycw-portal .wdes-sidebar .shortcuts > li > a {
  display:flex!important;
  align-items:center;
  justify-content:center;
  min-height:50px;
  width:100%;
  margin:0!important;
  padding:10px!important;
  background:#f7f9fc!important;
  border:1px solid #e0e7f0!important;
  border-radius:13px!important;
  box-shadow:0 3px 11px rgba(15,33,55,.035)!important;
  box-sizing:border-box!important;
  background-clip:padding-box!important;
  overflow:visible!important;
  text-decoration:none!important;
  transition:background-color .17s ease,border-color .17s ease,box-shadow .17s ease;
}
body.ycw-portal .wdes-sidebar .shortcuts > li:hover,
body.ycw-portal .wdes-sidebar .shortcuts > li:focus-within {
  background:transparent!important;
  border:0!important;
}
body.ycw-portal .wdes-sidebar .shortcuts > li > a:hover,
body.ycw-portal .wdes-sidebar .shortcuts > li > a:focus-visible {
  background:#fff3ea!important;
  border-color:#ffb994!important;
  box-shadow:0 0 0 3px rgba(255,89,0,.13)!important;
  outline:none;
}
html[data-ycw-theme='dark'] body.ycw-portal .wdes-sidebar .shortcuts > li,
html[data-ycw-theme='dark'] body.ycw-portal .wdes-sidebar ul.shortcuts > li {
  background:transparent!important;
  border-color:transparent!important;
  box-shadow:none!important;
}
html[data-ycw-theme='dark'] body.ycw-portal .wdes-sidebar .shortcuts > li > a {
  background:#283b55!important;
  border-color:#425874!important;
  color:#eaf2fd!important;
  box-shadow:none!important;
}
html[data-ycw-theme='dark'] body.ycw-portal .wdes-sidebar .shortcuts > li > a:hover,
html[data-ycw-theme='dark'] body.ycw-portal .wdes-sidebar .shortcuts > li > a:focus-visible {
  background:#344b68!important;
  border-color:#ff975c!important;
  box-shadow:0 0 0 3px rgba(255,89,0,.16)!important;
  color:#fff!important;
}
/* The RC34 :is() rule has unusually high specificity because it mixes
   shortcuts with nested dropdown selectors. Match that priority explicitly. */
html[data-ycw-theme='dark'] body.ycw-portal .wdes-sidebar .shortcuts.shortcuts.shortcuts > li {
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  box-shadow:none!important;
}
html[data-ycw-theme='dark'] body.ycw-portal .wdes-sidebar .shortcuts.shortcuts.shortcuts > li > a {
  background:#283b55!important;
  border:1px solid #425874!important;
  border-radius:13px!important;
  color:#eaf2fd!important;
}
html[data-ycw-theme='dark'] body.ycw-portal .wdes-sidebar .shortcuts.shortcuts.shortcuts > li > a:is(:hover,:focus-visible) {
  background:#344b68!important;
  border-color:#ff975c!important;
  color:#fff!important;
}
/* The notification badge must not be clipped by rounding the button. */
body.ycw-portal .wdes-sidebar .shortcuts > li .wdes-notification-alert {z-index:3;}

/* Account selector: remove secondary backgrounds in wrapper/panel, retain
   a single correctly rounded interactive link. The opened menu is not clipped. */
body.ycw-portal .wdes-sidebar .wdes-user-area-nav,
body.ycw-portal .wdes-sidebar .wdes-user-area-nav > .panel {
  background:transparent!important;
  background-image:none!important;
  border:0!important;
  box-shadow:none!important;
  overflow:visible!important;
}
body.ycw-portal .wdes-sidebar .wdes-user-area-nav .panel > a {
  width:100%;
  min-height:46px;
  border-radius:12px!important;
  background-clip:padding-box!important;
  box-sizing:border-box;
  overflow:visible;
}
html[data-ycw-theme='dark'] body.ycw-portal .wdes-sidebar .wdes-user-area-nav,
html[data-ycw-theme='dark'] body.ycw-portal .wdes-sidebar .wdes-user-area-nav > .panel {
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
html[data-ycw-theme='dark'] body.ycw-portal .wdes-sidebar .wdes-user-area-nav .panel > a {
  background:#283b55!important;
  border:1px solid #425874!important;
  color:#eaf2fd!important;
}
html[data-ycw-theme='dark'] body.ycw-portal .wdes-sidebar .wdes-user-area-nav .panel > a:hover,
html[data-ycw-theme='dark'] body.ycw-portal .wdes-sidebar .wdes-user-area-nav .panel > a:focus-visible {
  background:#344b68!important;
  border-color:#ff975c!important;
  color:#fff!important;
  outline:2px solid rgba(255,89,0,.35);
  outline-offset:2px;
}
@media(max-width:767px){
  body.ycw-portal .wdes-sidebar .shortcuts > li > a {min-height:52px;}
}

/* Branded loading stage. Use the original image asset, never invert the brand. */
body.ycw-portal .wdes-loading.ycw-branded-loading {
  position:fixed!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  min-height:100dvh;
  display:grid;
  place-items:center;
  padding:20px;
  z-index:9999999;
  background:#f5f7fb!important;
  color:#152747!important;
}
html[data-ycw-theme='dark'] body.ycw-portal .wdes-loading.ycw-branded-loading {
  background:#101a2a!important;
  color:#eaf2ff!important;
}
body.ycw-portal .ycw-loader-content {
  display:flex;
  align-items:center;
  flex-direction:column;
  justify-content:center;
  text-align:center;
  pointer-events:none;
}
body.ycw-portal .ycw-loader-emblem {
  width:112px;height:112px;
  margin:0 auto 15px;
  display:grid;place-items:center;
  position:relative;
  isolation:isolate;
}
body.ycw-portal .ycw-loader-emblem img {
  width:82px;height:82px;
  display:block;
  object-fit:contain;
  border:0;
  border-radius:22px;
  position:relative;
  z-index:1;
  background-color:#20365c;
  box-shadow:0 16px 35px rgba(25,44,79,.14);
  animation:ycw40-logo-breathe 2.25s ease-in-out infinite;
}
html[data-ycw-theme='dark'] body.ycw-portal .ycw-loader-emblem img {
  box-shadow:0 18px 38px rgba(0,0,0,.28);
}
body.ycw-portal .ycw-loader-orbit {
  width:108px;height:108px;
  display:block;
  position:absolute;inset:2px;
  border:2px solid rgba(255,89,0,.13);
  border-top-color:#ff5900;
  border-right-color:rgba(255,89,0,.49);
  border-radius:50%;
  animation:ycw40-orbit 2.9s linear infinite;
}
body.ycw-portal .ycw-loader-spark {
  width:7px;height:7px;
  position:absolute;
  left:calc(50% - 3.5px);top:0;
  border-radius:50%;
  background:#ff5900;
  box-shadow:0 0 0 4px rgba(255,89,0,.12);
  animation:ycw40-spark 2.9s linear infinite;
  transform-origin:3.5px 56px;
}
body.ycw-portal .ycw-loader-wordmark {
  font-family:Poppins,Arial,sans-serif;
  font-weight:700;
  font-size:18px;
  letter-spacing:-.045em;
  color:inherit;
}
body.ycw-portal .ycw-loader-wordmark-dot{color:#ff5900;}
body.ycw-portal .ycw-loader-message {
  margin:4px 0 0;
  font:500 11px/1.8 Poppins,Arial,sans-serif;
  letter-spacing:.025em;
  color:#687993;
}
html[data-ycw-theme='dark'] body.ycw-portal .ycw-loader-message {color:#b3c3d9;}
@keyframes ycw40-orbit {to{transform:rotate(360deg);}}
@keyframes ycw40-spark {to{transform:rotate(360deg);}}
@keyframes ycw40-logo-breathe {0%,100%{transform:scale(1);}50%{transform:scale(1.045);}}
@media(prefers-reduced-motion:reduce){
  body.ycw-portal .ycw-loader-emblem img,
  body.ycw-portal .ycw-loader-orbit,
  body.ycw-portal .ycw-loader-spark {animation:none!important;}
  body.ycw-portal .wdes-sidebar .shortcuts > li > a {transition:none!important;}
}
@media print {body.ycw-portal .wdes-loading.ycw-branded-loading{display:none!important;}}
