/* =========================================================
   BUTTONS + MOTION FIX (v5.11)
   Loaded last on every page. Fixes:
   1) app-clean-ui.css was killing the .btn shine/hover motion
      on every dashboard + admin button (display:none on the
      pseudo-elements site.css uses for the animation).
   2) Inconsistent button heights/radius across pages.
   3) Missing/weak :active press feedback (buttons felt "dead").
   4) Touch targets under 44px on mobile (hard to tap accurately).
   5) No visible feedback on icon-only buttons, menu items,
      status tabs and the bottom mobile nav.
   ========================================================= */

:root{ --btn-ease:cubic-bezier(.22,.9,.32,1.2); }

/* ---- Core button: restore + upgrade the animation for EVERY button on every page ---- */
.btn,
.icon-btn,
.status-tab,
.menu button,
.mobile-nav button{
  transition:transform .18s var(--btn-ease),
             box-shadow .22s ease,
             background-color .18s ease,
             border-color .18s ease,
             color .18s ease,
             filter .18s ease !important;
  -webkit-tap-highlight-color:transparent;
}

/* Re-enable the diagonal shine sweep app-clean-ui.css had disabled with
   `.btn:before,.btn:after{display:none!important}` */
.btn{ position:relative !important; overflow:hidden !important; isolation:isolate; }
.btn:after{
  content:"" !important;
  display:block !important;
  position:absolute; top:-120%; left:-40%;
  width:28%; height:340%;
  transform:rotate(24deg);
  background:rgba(255,255,255,.22);
  transition:left .5s ease !important;
  pointer-events:none;
  z-index:1;
}
.btn:hover:after{ left:130% !important; }
.btn > *{ position:relative; z-index:2; }

/* Hover lift (works even where an older file forced translateY(0)) */
.btn:not(:disabled):not(.is-verifying):hover{
  transform:translateY(-2px) !important;
  box-shadow:0 10px 22px rgba(8,60,120,.18);
}
/* Press feedback so a tap/click always visibly registers */
.btn:not(:disabled):active,
.icon-btn:not(:disabled):active,
.status-tab:not(:disabled):active,
.menu button:not(:disabled):active,
.mobile-nav button:not(:disabled):active{
  transform:scale(.96) !important;
  transition-duration:.08s !important;
}
.icon-btn:hover{ transform:translateY(-1px) scale(1.04); background:#eef4fb !important; }
.status-tab:hover{ transform:translateY(-1px); }
.menu button:hover{ transform:translateX(2px); }

/* Disabled / loading: no motion, clear "can't click this" affordance */
.btn:disabled,
.btn.is-verifying{ transform:none !important; cursor:not-allowed; }
.btn:disabled{ opacity:.55; filter:grayscale(.15); }

/* Clear, consistent focus ring for keyboard + accessibility on every control */
.btn:focus-visible,
.icon-btn:focus-visible,
.status-tab:focus-visible,
.menu button:focus-visible,
.mobile-nav button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline:3px solid rgba(23,105,210,.45) !important;
  outline-offset:2px;
}

/* Consistent sizing so buttons no longer jump between 40/42/44/48px
   depending on which page/theme file happened to load last */
.btn{ min-height:44px; border-radius:10px !important; }
.btn-sm{ min-height:36px; }
.icon-btn{ min-width:44px; min-height:44px; border-radius:10px !important; }

/* ---- Mobile: guarantee real 44px+ touch targets everywhere ---- */
@media(max-width:760px){
  .btn{ min-height:46px; padding:12px 16px; }
  .btn-sm{ min-height:40px; padding:9px 13px; }
  .icon-btn{ min-width:44px; min-height:44px; }
  .menu button{ min-height:46px; }
  .status-tab{ min-height:42px; padding:10px 14px; }
  .mobile-nav button{ min-height:56px; }
  /* full-width primary actions are easier to hit with a thumb */
  .new-order-form>button,
  .field + .btn,
  form>.btn:only-of-type{ width:100%; justify-content:center; }
}

/* Smoother page/section entrances everywhere (not just #page-new-order) */
.panel,.metric,.admin-kpi,.service-card,.network-card{
  transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease !important;
}
.panel:hover,.metric:hover,.admin-kpi:hover,.service-card:hover,.network-card:hover{
  transform:translateY(-3px) !important;
}

@media(prefers-reduced-motion:reduce){
  .btn,.icon-btn,.status-tab,.menu button,.mobile-nav button,
  .panel,.metric,.admin-kpi,.service-card,.network-card{
    transition:none !important;
  }
  .btn:hover,.btn:active,.icon-btn:hover,.panel:hover,.metric:hover{ transform:none !important; }
  .btn:after{ display:none !important; }
}
