:root {
    --profile-accent: #7c3aed;
    --profile-accent-hover: #6d28d9;
    --motion-fast: 140ms;
    --motion-normal: 220ms;
    --motion-slow: 300ms;
    --motion-ease: cubic-bezier(.2, .8, .2, 1);
}

[data-profile="business"] { --profile-accent: #4f46e5; --profile-accent-hover: #4338ca; }
[data-profile="developer"] { --profile-accent: #d97706; --profile-accent-hover: #b45309; }

/* Page widths inside the max-w-7xl dashboard shell. Every dashboard page root
   uses exactly one: form (wizards, settings forms), default (detail and settings
   pages), wide (tables, analytics). Always centred. */
.page-form, .page-default, .page-wide { width: 100%; margin-inline: auto; }
.page-form { max-width: 48rem; }
.page-default { max-width: 64rem; }

[hidden] { display: none !important; }
[x-cloak] { display: none !important; }
.ui-transition { transition-duration: var(--motion-normal); transition-timing-function: var(--motion-ease); }
.htmx-indicator { opacity: 0; visibility: hidden; transition: opacity var(--motion-fast) ease; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; visibility: visible; }

/* Dashboard navigation is intentionally immediate. Neutralize legacy page-entry
   helpers without disabling functional motion such as spinners and modals. */
#dashboard-page .animate-fade-in,
#dashboard-page .fade-in,
#dashboard-page .step-card,
#dashboard-page .anim-fade-in-up,
#dashboard-page .fade-in-up,
#dashboard-page .content-container {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

#dashboard-progress {
    position: fixed; inset: 0 0 auto; z-index: 80; height: 3px; opacity: 0;
    transform: scaleX(.08); transform-origin: left; background: var(--profile-accent);
    transition: transform 8s cubic-bezier(.1,.7,.2,1), opacity var(--motion-fast) ease;
}
body[data-dashboard-loading="true"] #dashboard-progress { opacity: 1; transform: scaleX(.82); }
body[data-dashboard-loading="settled"] #dashboard-progress { opacity: 0; transform: scaleX(1); transition-duration: 180ms; }

#dashboard-content { transition: opacity 120ms ease; }
body[data-dashboard-loading="true"] #dashboard-content { opacity: .72; }
@media (prefers-reduced-motion: reduce) {
  #dashboard-content { transition: none; }
}

.dashboard-error { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; }
.dark .dashboard-error { border-color: #7f1d1d; background: rgb(69 10 10 / .35); color: #fecaca; }

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