/* A restrained, shared interaction system for the public interface. */
:root {
  --motion-fast: 140ms;
  --motion-base: 220ms;
  --motion-slow: 360ms;
  --motion-ease: cubic-bezier(.2, .8, .2, 1);
}

html { scroll-behavior: smooth; }
body { transition: opacity var(--motion-fast) ease, transform var(--motion-fast) ease; }
body.motion-ready .app, body.motion-ready .login-layout, body.motion-ready main.shell {
  animation: zyl-enter var(--motion-slow) var(--motion-ease) both;
}
body.motion-leaving { opacity: 0; transform: translateY(4px); }

a, button, input, select, textarea, .profile-mini, .panel-card, .card, .kpi,
.recent, .roster, .create-panel, .detection, .side-tool, .data-row, tbody tr {
  transition-duration: var(--motion-base);
  transition-timing-function: var(--motion-ease);
}

a:not(.nav a), button, .profile-mini, .tool-button, .action, .back-link,
.new-scan, .logout, .renew-button, .status-button {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled), .tool-button, .action, .back-link, .new-scan, .logout,
.renew-button, .status-button, .profile-mini { transition-property: transform, box-shadow, background-color, border-color, color, filter; }
button:not(:disabled):hover, .tool-button:hover, .action:hover, .back-link:hover,
.new-scan:hover, .logout:hover, .renew-button:hover, .status-button:hover,
.profile-mini:hover { transform: translateY(-2px); }
button:not(:disabled):active, .tool-button:active, .action:active, .back-link:active,
.new-scan:active, .logout:active, .renew-button:active, .status-button:active,
.profile-mini:active { transform: translateY(0) scale(.98); transition-duration: 80ms; }

.nav a { position: relative; overflow: hidden; transition: color var(--motion-fast) ease, background-color var(--motion-base) var(--motion-ease), transform var(--motion-fast) ease; }
.nav a:hover { transform: translateX(3px); }
.nav a::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 5px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; opacity: .65; transition: transform var(--motion-base) var(--motion-ease); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }

.panel-card:hover, .card:hover, .kpi:hover, .recent:hover, .roster:hover,
.create-panel:hover, .side-tool:hover { transform: translateY(-2px); border-color: rgba(94, 234, 212, .38); box-shadow: 0 16px 32px rgba(1, 8, 20, .18); }
.data-row:hover { padding-left: 6px; padding-right: 6px; background: rgba(94, 234, 212, .035); }

input, select, textarea { transition-property: border-color, box-shadow, background-color, transform; }
input:hover, select:hover, textarea:hover { border-color: rgba(94, 234, 212, .45); }
input:focus, select:focus, textarea:focus { transform: translateY(-1px); box-shadow: 0 0 0 4px rgba(94, 234, 212, .1); }
:focus-visible { outline: 3px solid rgba(94, 234, 212, .62) !important; outline-offset: 3px; }

.page-loader.hidden { transition: opacity var(--motion-base) var(--motion-ease), visibility var(--motion-base) var(--motion-ease); }

@keyframes zyl-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
