/* ============================================================
   Able Container Financial — visual effects layer
   Background, depth, motion and finishing touches.
   All motion is disabled for people who ask for reduced motion.
   ============================================================ */

:root {
  --brand-1: #1d4ed8;
  --brand-2: #0ea5e9;
  --brand-3: #6366f1;
  --glow: rgba(29, 78, 216, 0.25);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 18px 40px -12px rgba(15, 23, 42, 0.22), 0 6px 14px -6px rgba(15, 23, 42, 0.10);
  --glass: rgba(255, 255, 255, 0.78);
  --bg-dot: rgba(15, 23, 42, 0.07);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glow: rgba(79, 134, 247, 0.35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 16px -4px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 22px 48px -12px rgba(0, 0, 0, 0.65);
    --glass: rgba(17, 24, 35, 0.72);
    --bg-dot: rgba(255, 255, 255, 0.05);
  }
}
:root[data-theme="dark"] {
  --glow: rgba(79, 134, 247, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 16px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 22px 48px -12px rgba(0, 0, 0, 0.65);
  --glass: rgba(17, 24, 35, 0.72);
  --bg-dot: rgba(255, 255, 255, 0.05);
}

/* ---------- background: soft color fields + dot grid ---------- */
body { background-color: var(--bg); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 85% -10%, rgba(14, 165, 233, 0.13), transparent 60%),
    radial-gradient(760px 480px at 10% 110%, rgba(99, 102, 241, 0.11), transparent 60%),
    radial-gradient(600px 400px at 45% 40%, rgba(29, 78, 216, 0.05), transparent 70%),
    radial-gradient(var(--bg-dot) 1px, transparent 1px);
  background-size: auto, auto, auto, 22px 22px;
}
.app-main { position: relative; }

/* ---------- surfaces with depth ---------- */
.card, .stat, .table-card, .list-card, .job-card, .profile, .task, .stepper, details.group, .empty {
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease), border-color 0.2s;
}
.card:hover, .stat:hover, .table-card:hover, details.group:hover { box-shadow: var(--shadow-md); }
.job-card:hover, .profile:hover, .task:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.stat { isolation: isolate; }
.stat::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 70%); opacity: 0; transition: opacity 0.35s; z-index: -1;
}
.stat:hover::after { opacity: 0.55; }
.stat-ico, .row-ico, .empty-ico, .quick-ico { transition: transform 0.3s var(--ease); }
.stat:hover .stat-ico, .list-row:hover .row-ico { transform: scale(1.1) rotate(-4deg); }

/* ---------- glass top bar ---------- */
.topbar { background: var(--glass); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); }
.chip-nav { background: transparent; }

/* ---------- sidebar ---------- */
.sidebar {
  background:
    radial-gradient(420px 260px at 0% 0%, rgba(59, 130, 246, 0.22), transparent 65%),
    radial-gradient(360px 300px at 100% 100%, rgba(14, 165, 233, 0.14), transparent 70%),
    var(--navy);
  box-shadow: 4px 0 24px -12px rgba(0, 0, 0, 0.5);
}
.brand-mark { background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); box-shadow: 0 6px 16px -4px rgba(29, 78, 216, 0.6); }
.side-nav a { transition: background-color 0.2s, color 0.2s, padding-left 0.25s var(--ease); }
.side-nav a:hover { padding-left: calc(var(--sp-3) + 4px); }
.side-nav a[aria-current="page"] { background: linear-gradient(90deg, rgba(59, 130, 246, 0.32), rgba(59, 130, 246, 0.08)); box-shadow: inset 0 0 0 1px rgba(143, 179, 255, 0.18); }
.side-nav a[aria-current="page"]::before { box-shadow: 0 0 12px 2px rgba(109, 155, 255, 0.7); }
.side-nav a .icon { transition: transform 0.25s var(--ease); }
.side-nav a:hover .icon { transform: scale(1.12); }
.avatar { background: linear-gradient(135deg, #2d4f86, #3b6fc4); }
.avatar-sm { background: linear-gradient(135deg, var(--brand-1), var(--brand-3)); box-shadow: 0 4px 12px -4px var(--glow); }
.avatar-xs { background: var(--surface-3); }
.avatar-lg { background: linear-gradient(135deg, var(--primary-soft), var(--surface-3)); }

/* ---------- buttons ---------- */
.btn { transition: background-color 0.15s, border-color 0.15s, box-shadow 0.2s var(--ease), transform 0.12s var(--ease); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-primary {
  background: linear-gradient(180deg, #2f63f0, var(--brand-1)); border-color: #1a45c4;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 16px -6px rgba(29, 78, 216, 0.7);
}
.btn-primary:hover { background: linear-gradient(180deg, #3a6ef7, #1e47c9); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 22px -8px rgba(29, 78, 216, 0.8); transform: translateY(-1px); }
.btn-primary .icon { transition: transform 0.25s var(--ease); }
.btn-primary:hover .icon { transform: rotate(90deg); }
.btn:not(.btn-primary):not(.btn-ghost):hover { box-shadow: var(--shadow-md); }

/* ---------- hero card ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, #0b1f3a 0%, #13336a 55%, #1d4ed8 120%);
  box-shadow: var(--shadow-lg);
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; }
.hero::before { width: 320px; height: 320px; right: -90px; top: -120px; background: radial-gradient(circle, rgba(14, 165, 233, 0.45), transparent 65%); animation: float 12s ease-in-out infinite; }
.hero::after { width: 240px; height: 240px; right: 120px; bottom: -150px; background: radial-gradient(circle, rgba(99, 102, 241, 0.45), transparent 65%); animation: float 15s ease-in-out infinite reverse; }
.hero-value { text-shadow: 0 4px 24px rgba(14, 165, 233, 0.35); }

/* ---------- stepper ---------- */
.stepper-fill { background: linear-gradient(90deg, #16a34a, #22c55e); animation: grow 1.1s var(--ease) both; transform-origin: left; box-shadow: 0 0 10px rgba(34, 197, 94, 0.45); }
.step-done .dot { box-shadow: 0 4px 12px -4px rgba(22, 163, 74, 0.7); }
.step-current .dot { animation: pulse 2.2s ease-out infinite; }
.step { animation: rise 0.5s var(--ease) both; }
.step:nth-child(2) { animation-delay: 0.06s; } .step:nth-child(3) { animation-delay: 0.12s; } .step:nth-child(4) { animation-delay: 0.18s; }
.step:nth-child(5) { animation-delay: 0.24s; } .step:nth-child(6) { animation-delay: 0.30s; }

/* ---------- meters and pipeline ---------- */
.meter-bar span { animation: grow 1.2s var(--ease) both; transform-origin: left; position: relative; overflow: hidden; }
.meter-bar span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent); animation: sheen 2.8s ease-in-out 1.2s infinite; }
.meter-green .meter-bar span { background: linear-gradient(90deg, #16a34a, #22c55e); }
.meter-amber .meter-bar span { background: linear-gradient(90deg, #d97706, #f59e0b); }
.meter-red .meter-bar span { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.pipe-seg { animation: grow 1s var(--ease) both; transform-origin: left; }

/* ---------- page entrance ---------- */
#main > * { animation: rise 0.5s var(--ease) both; }
#main > *:nth-child(2) { animation-delay: 0.05s; } #main > *:nth-child(3) { animation-delay: 0.1s; } #main > *:nth-child(4) { animation-delay: 0.15s; }
#main > *:nth-child(5) { animation-delay: 0.2s; } #main > *:nth-child(6) { animation-delay: 0.25s; } #main > *:nth-child(n+7) { animation-delay: 0.3s; }
.grid > *, .card-list > *, .profile-grid > *, .task-list > *, .list-card > * { animation: rise 0.55s var(--ease) both; }
.grid > *:nth-child(2), .card-list > *:nth-child(2), .profile-grid > *:nth-child(2), .task-list > *:nth-child(2), .list-card > *:nth-child(2) { animation-delay: 0.07s; }
.grid > *:nth-child(3), .card-list > *:nth-child(3), .profile-grid > *:nth-child(3), .task-list > *:nth-child(3), .list-card > *:nth-child(3) { animation-delay: 0.14s; }
.grid > *:nth-child(4), .card-list > *:nth-child(4), .profile-grid > *:nth-child(4), .task-list > *:nth-child(4), .list-card > *:nth-child(4) { animation-delay: 0.21s; }
.grid > *:nth-child(n+5), .card-list > *:nth-child(n+5), .profile-grid > *:nth-child(n+5), .list-card > *:nth-child(n+5) { animation-delay: 0.28s; }
.table tbody tr { animation: fadein 0.4s ease both; }

/* ---------- tables, tabs, inputs ---------- */
.table th { background: linear-gradient(180deg, var(--surface-2), var(--surface-3)); }
.table tbody tr { transition: background-color 0.15s; }
.tab { transition: background-color 0.2s, color 0.2s, box-shadow 0.2s; }
.tab[aria-current="page"] { box-shadow: var(--shadow-md); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px var(--primary-soft), 0 4px 14px -6px var(--glow); }
.badge { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }
.empty { background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.empty-ico { background: linear-gradient(135deg, var(--primary-soft), var(--surface-3)); box-shadow: 0 8px 20px -10px var(--glow); animation: float 6s ease-in-out infinite; }
.summary-row.is-strong { background: linear-gradient(90deg, var(--primary-soft), transparent); }

/* ---------- loading skeleton ---------- */
.skeleton { display: grid; gap: var(--sp-4); padding-top: var(--sp-2); }
.sk { border-radius: var(--r); background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 40%, var(--surface-3) 80%); background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.sk-title { height: 34px; width: 42%; }
.sk-line { height: 14px; width: 64%; }
.sk-row { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.sk-card { height: 120px; }
.sk-block { height: 260px; }

/* ---------- toasts and dialogs ---------- */
.toast { animation: slidein 0.35s var(--ease) both; box-shadow: var(--shadow-lg); backdrop-filter: blur(8px); }
.toast.leaving { animation: slideout 0.3s ease both; }
.dialog[open] { animation: pop 0.25s var(--ease) both; box-shadow: var(--shadow-lg); }
.dialog::backdrop { backdrop-filter: blur(3px); }

/* ---------- login ---------- */
.auth-panel {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(150deg, #071428 0%, #0b1f3a 45%, #143a78 100%);
}
.auth-panel::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px); background-size: 24px 24px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.orb { position: absolute; border-radius: 50%; filter: blur(4px); z-index: -1; pointer-events: none; }
.orb-1 { width: 420px; height: 420px; right: -120px; top: -100px; background: radial-gradient(circle, rgba(14, 165, 233, 0.45), transparent 65%); animation: float 14s ease-in-out infinite; }
.orb-2 { width: 360px; height: 360px; left: -120px; bottom: -120px; background: radial-gradient(circle, rgba(99, 102, 241, 0.45), transparent 65%); animation: float 18s ease-in-out infinite reverse; }
.orb-3 { width: 180px; height: 180px; right: 30%; bottom: 18%; background: radial-gradient(circle, rgba(34, 197, 94, 0.28), transparent 65%); animation: float 11s ease-in-out infinite; }
.auth-panel h2 { background: linear-gradient(90deg, #fff, #bcd3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-points li { padding: var(--sp-3) var(--sp-4); border-radius: var(--r); background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); backdrop-filter: blur(6px); animation: rise 0.6s var(--ease) both; }
.auth-points li:nth-child(2) { animation-delay: 0.1s; } .auth-points li:nth-child(3) { animation-delay: 0.2s; }
.auth-form { background: transparent; }
.auth-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-8); box-shadow: var(--shadow-lg); animation: pop 0.5s var(--ease) both; }
@media (max-width: 480px) { .auth-box { padding: var(--sp-6) var(--sp-5); } }

/* ---------- keyframes ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(29, 78, 216, 0.45); } 70% { box-shadow: 0 0 0 12px rgba(29, 78, 216, 0); } 100% { box-shadow: 0 0 0 0 rgba(29, 78, 216, 0); } }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-14px, 12px); } }
@keyframes sheen { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes slidein { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes slideout { to { opacity: 0; transform: translateX(24px); } }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
@media print {
  body::before, .orb { display: none; }
  * { animation: none !important; box-shadow: none !important; }
}
