/*
 * DirecFunds shared UI foundation.
 *
 * Product-specific styles remain in each application. This file owns the small set of
 * tokens and accessible primitives that should behave consistently across every portal.
 * Keep it dependency-free so Razor Class Library static assets can be consumed directly.
 */
:root {
    --df-color-ink: #18202c;
    --df-color-ink-muted: #526071;
    --df-color-surface: #ffffff;
    --df-color-surface-subtle: #f7f8fa;
    --df-color-border: #d8dee7;
    --df-color-brand: #876719;
    --df-color-brand-strong: #624a10;
    --df-color-brand-soft: #fff6dd;
    --df-color-success: #18724a;
    --df-color-success-soft: #e9f7f0;
    --df-color-warning: #8a5a00;
    --df-color-warning-soft: #fff4d6;
    --df-color-danger: #a51d2d;
    --df-color-danger-soft: #fff0f2;
    --df-radius-sm: 0.5rem;
    --df-radius-md: 0.75rem;
    --df-radius-lg: 1rem;
    --df-shadow-sm: 0 0.25rem 0.75rem rgba(24, 32, 44, 0.08);
    --df-focus-ring: 0 0 0 0.2rem rgba(135, 103, 25, 0.28);
    --df-font-family-sans: Montserrat, "Segoe UI", Arial, sans-serif;
}

/* The class is intentionally shared even when an app supplies more specific positioning. */
.df-skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10000;
    max-width: calc(100vw - 1rem);
    padding: 0.65rem 0.9rem;
    border-radius: var(--df-radius-sm);
    background: var(--df-color-ink);
    color: #fff;
    font-weight: 600;
    transform: translateY(-150%);
}

.df-skip-link:focus {
    color: #fff;
    transform: translateY(0);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--df-color-brand-strong);
    outline-offset: 2px;
    box-shadow: var(--df-focus-ring);
}

.df-flow-progress {
    display: grid;
    grid-template-columns: repeat(var(--df-flow-step-count, 3), minmax(0, 1fr));
    gap: 0;
    width: min(100%, 42rem);
    margin: 1rem auto 2rem;
    padding: 0;
    list-style: none;
    counter-reset: df-flow-step;
}

.df-flow-progress__step {
    position: relative;
    min-width: 0;
    padding: 2.5rem 0.35rem 0;
    color: var(--df-color-ink-muted);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    counter-increment: df-flow-step;
}

.df-flow-progress__step::before {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 2;
    display: grid;
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--df-color-border);
    border-radius: 50%;
    place-items: center;
    background: var(--df-color-surface);
    color: var(--df-color-ink-muted);
    content: counter(df-flow-step);
    transform: translateX(-50%);
}

.df-flow-progress__step:not(:first-child)::after {
    position: absolute;
    top: 0.95rem;
    right: 50%;
    left: -50%;
    z-index: 1;
    height: 2px;
    background: var(--df-color-border);
    content: "";
}

.df-flow-progress__step[data-state="current"] {
    color: var(--df-color-brand-strong);
}

.df-flow-progress__step[data-state="current"]::before {
    border-color: var(--df-color-brand);
    background: var(--df-color-brand-soft);
    color: var(--df-color-brand-strong);
}

.df-flow-progress__step[data-state="complete"] {
    color: var(--df-color-success);
}

.df-flow-progress__step[data-state="complete"]::before {
    border-color: var(--df-color-success);
    background: var(--df-color-success);
    color: #fff;
    content: "\2713";
}

.df-flow-progress__step[data-state="complete"]::after {
    background: var(--df-color-success);
}

.df-state-card {
    width: min(100%, 46rem);
    margin: 1rem auto;
    padding: clamp(1.1rem, 3vw, 1.6rem);
    border: 1px solid var(--df-color-border);
    border-radius: var(--df-radius-lg);
    background: var(--df-color-surface);
    box-shadow: var(--df-shadow-sm);
}

.df-state-card--warning {
    border-color: #dfbd6d;
    background: var(--df-color-warning-soft);
}

.df-state-card--danger {
    border-color: #e2a2aa;
    background: var(--df-color-danger-soft);
}

.df-state-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

@media (max-width: 479.98px) {
    .df-flow-progress__step {
        padding-right: 0.15rem;
        padding-left: 0.15rem;
        font-size: 0.72rem;
    }

    .df-state-card__actions > * {
        width: 100%;
    }
}

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