/*
 * Vejaro UI — v1.
 *
 * Served from https://assets.vejaro.com/ui/v1/vejaro-ui.css. Every
 * Vejaro surface (Books, Voice, Dispatch, Admin, ID, marketing) loads
 * this single file so the brand colour, surface tones, radii, shadows,
 * and shared component primitives (.vjr-card / .vjr-nav-* /
 * .vjr-icon-btn / body defaults) are byte-for-byte identical without
 * per-app duplication.
 *
 * URL is versioned. Renaming or removing a token / class means
 * bumping to /v2/ (new directory). Adding a new token or class to /v1/
 * is safe — older consumers just ignore it. /v1/ stays frozen as long
 * as any consumer still pins to it.
 *
 * Single file on purpose: CSS @import chains serially in the browser
 * (load A, parse, fetch B + C), so split files cost more round-trips
 * than they save. At the scale of "the tokens + a handful of
 * primitives", inlining everything is faster and simpler.
 *
 * The HSL-triplet pattern (no hsl() wrapper) on the colour tokens is
 * required by Tailwind's `bg-primary/10` opacity-modifier syntax: it
 * composes the alpha at use time as `hsl(var(--primary) / 0.1)`. Don't
 * switch to hex / rgb() here or those utilities silently lose alpha.
 *
 * Pure CSS by design: no @apply, no Tailwind dependency. An app can
 * load this on a page without Tailwind and the primitives still work.
 * Anything richer (focus-managed Dialog, controlled Select, etc.)
 * belongs in the npm @vejaro/ui package — Tier 3 in the tiered
 * design-system plan. This file deliberately stops at the visual
 * primitives the four apps already converged on, so we don't ship a
 * sprawling kitchen-sink bundle every consumer pays for.
 */

/* ── Tokens — light ──────────────────────────────────────────────── */

:root {
    /* Surfaces — page is the soft outer tone, background is card-white */
    --page: 220 30% 97%;
    --background: 0 0% 100%;
    --foreground: 222.2 47.4% 11.2%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 47.4% 11.2%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 47.4% 11.2%;

    /* Brand. The single colour every app should reach for to mean
       "Vejaro action" — buttons, active nav, focus rings. Tinted
       (--primary-soft) for the subtle backgrounds behind nav items. */
    --primary: 29 80% 62%;
    --primary-foreground: 0 0% 100%;
    --primary-soft: 250 90% 96%;

    /* Neutrals + accents */
    --secondary: 220 25% 95%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 220 20% 95%;
    --muted-foreground: 220 10% 45%;
    --accent: 250 70% 96%;
    --accent-foreground: 250 80% 35%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 100%;

    /* Strokes + control chrome */
    --border: 220 20% 92%;
    --input: 220 20% 90%;
    --ring: 250 80% 62%;

    /* `.vjr-field` uses these prefixed variants so consumers (e.g. id-fe's
       shadcn config) that redefine `--input` / `--ring` / `--border` to
       oklch(...) syntax can't break the field's `hsl(...)` wrappers.
       Ring colour is teal (= Tailwind teal-500, the auth-button accent),
       NOT the brand purple `--ring` — fields and primary CTAs should
       match colour-wise across the auth/signup screens.
       `--vjr-field-focused-border` is the border-color when the field has
       focus — kept equal to the ring so the 1px border + 2px ring read as
       a single solid teal stroke, no gray fringe between them. */
    --vjr-field-border:          220 20% 90%;
    --vjr-field-ring:            173 80% 40%;
    --vjr-field-focused-border:  173 80% 40%;
    --vjr-field-bg:              0 0% 100%;
    --vjr-field-fg:              222 47% 11%;
    --vjr-field-muted-fg:        220 10% 45%;
    --vjr-field-error:           0 84% 60%;

    /* Sidebar — subtly cooler than page so the rail/secondary panel
       reads as "structure" instead of melting into content. */
    --sidebar: 0 0% 100%;
    --sidebar-foreground: 222 47% 11%;
    --sidebar-muted: 220 13% 50%;

    --radius: 0.6rem;

    /* Card shadows — soft, MatDash-style. Two stops let .vjr-card-hover
       lift gently without redefining the whole shadow. */
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.04);
    --shadow-card-hover: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
}

/* ── Tokens — dark ───────────────────────────────────────────────── */

.dark {
    --page: 224 25% 9%;
    --background: 224 25% 11%;
    --foreground: 210 20% 96%;
    --card: 224 25% 13%;
    --card-foreground: 210 20% 96%;
    --popover: 224 25% 13%;
    --popover-foreground: 210 20% 96%;

    --primary: 250 80% 68%;
    --primary-foreground: 224 25% 9%;
    --primary-soft: 250 50% 18%;

    --secondary: 224 20% 18%;
    --secondary-foreground: 210 20% 96%;
    --muted: 224 20% 18%;
    --muted-foreground: 220 8% 65%;
    --accent: 250 30% 22%;
    --accent-foreground: 250 80% 86%;
    --destructive: 0 70% 55%;
    --destructive-foreground: 0 0% 100%;

    --border: 224 20% 22%;
    --input: 224 20% 22%;
    --ring: 250 80% 68%;

    --vjr-field-border:          224 20% 22%;
    --vjr-field-ring:            173 70% 50%;
    --vjr-field-focused-border:  173 70% 50%;
    --vjr-field-bg:              224 25% 13%;
    --vjr-field-fg:              210 20% 96%;
    --vjr-field-muted-fg:        220 8% 65%;
    --vjr-field-error:           0 70% 55%;

    --sidebar: 224 25% 11%;
    --sidebar-foreground: 210 20% 96%;
    --sidebar-muted: 220 8% 65%;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-card-hover: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ── Defaults ────────────────────────────────────────────────────── */

/* Default border colour without needing Tailwind's `@apply border-border`
   — plain CSS so this works in any consumer including ones that don't
   build with Tailwind. */
* {
    border-color: hsl(var(--border));
}

body {
    background-color: hsl(var(--page));
    color: hsl(var(--foreground));
}

/* ── Card ────────────────────────────────────────────────────────── */

.vjr-card {
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border-radius: 0.75rem;
    box-shadow: var(--shadow-card);
    border: 1px solid hsl(var(--border) / 0.5);
}
.vjr-card-hover:hover {
    box-shadow: var(--shadow-card-hover);
}

/* ── Sidebar nav ─────────────────────────────────────────────────── */

.vjr-nav-group {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: hsl(var(--sidebar-muted));
    padding: 1rem 1.25rem 0.5rem 1.25rem;
}

.vjr-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.875rem;
    margin: 1px 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: hsl(var(--sidebar-foreground) / 0.75);
    transition: background-color 120ms, color 120ms;
}
.vjr-nav-item:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}
.vjr-nav-item.is-active {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 4px 12px hsl(var(--primary) / 0.30);
}
.vjr-nav-item.is-active:hover {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.vjr-nav-child {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0.875rem 0.375rem 2.25rem;
    margin: 1px 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: hsl(var(--sidebar-foreground) / 0.65);
    transition: background-color 120ms, color 120ms;
}
.vjr-nav-child:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}
.vjr-nav-child.is-active {
    color: hsl(var(--primary));
    font-weight: 500;
    background-color: hsl(var(--primary-soft));
}

/* ── Topbar icon button ──────────────────────────────────────────── */

.vjr-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    width: 2.25rem;
    border-radius: 9999px;
    color: hsl(var(--muted-foreground));
    transition: background-color 120ms, color 120ms;
}
.vjr-icon-btn:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}


.vjr-logo-small{
    background-image:url(https://assets.vejaro.com/logos/logo.png);
    width: 240px;
    height: 48px;
    background-position: center;
    background-clip: content-box;
    background-size: contain;
    background-repeat: no-repeat;
}

/* ── Field — floating-label input ────────────────────────────────────
   A single primitive used by Login, Signup, MFA, password reset, and any
   future form. The React component just toggles `.is-float` on the label
   and `.has-error` on the wrapper; everything else is plain CSS so the
   look is identical across apps and cannot drift via Tailwind palette
   differences.

   Markup contract:

     <div class="vjr-field [has-error]">
       [<span class="vjr-field-leading">{icon}</span>]
       <input class="vjr-field-input [has-leading] [has-trailing]" />
       <label class="vjr-field-label [is-float]">{label}</label>
       [<span class="vjr-field-trailing">{icon|button}</span>]
     </div>
*/

.vjr-field {
    position: relative;
    display: block;
    border-radius: 0.5rem;
    border: 1px solid hsl(var(--vjr-field-border));
    background: hsl(var(--vjr-field-bg));
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.vjr-field:focus-within {
    border-color: hsl(var(--vjr-field-focused-border));
    box-shadow:
        0 0 0 2px hsl(var(--vjr-field-ring) / 0.25),
        0 1px 2px rgba(15, 23, 42, 0.04);
}
.vjr-field.has-error {
    border-color: hsl(var(--vjr-field-error));
}
.vjr-field.has-error:focus-within {
    border-color: hsl(var(--vjr-field-error));
    box-shadow:
        0 0 0 2px hsl(var(--vjr-field-error) / 0.20),
        0 1px 2px rgba(15, 23, 42, 0.04);
}

.vjr-field-input {
    display: block;
    width: 100%;
    padding: 0.875rem;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 0.875rem;
    color: hsl(var(--vjr-field-fg));
}
.vjr-field-input:focus { outline: none; box-shadow: none; }
.vjr-field-input::placeholder { color: transparent; }
.vjr-field-input.has-leading  { padding-left:  2.5rem; }
.vjr-field-input.has-trailing { padding-right: 2.5rem; }

.vjr-field-leading,
.vjr-field-trailing {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: hsl(var(--vjr-field-muted-fg));
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.vjr-field-leading  { left:  0.75rem; pointer-events: none; }
.vjr-field-trailing { right: 0.75rem; }

/* Label — two states: resting (centered, looks like a placeholder) and
   floated (top-left, pulled into the border via the white background notch). */
.vjr-field-label {
    position: absolute;
    pointer-events: none;
    user-select: none;
    background: hsl(var(--vjr-field-bg));
    padding: 0 0.25rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: hsl(var(--vjr-field-muted-fg));
    transition: top 150ms ease-out, left 150ms ease-out, font-size 150ms ease-out, color 150ms ease-out;
    top: 50%;
    left: 0.875rem;
    transform: translateY(-50%);
}
.vjr-field-label.is-float {
    top: -0.6rem;
    left: 0.75rem;
    transform: none;
    font-size: 13px;
    font-weight: 600;
    color: hsl(var(--vjr-field-fg));
}
.vjr-field:focus-within .vjr-field-label.is-float {
    color: hsl(var(--vjr-field-ring));
}
.vjr-field.has-error .vjr-field-label,
.vjr-field.has-error .vjr-field-label.is-float {
    color: hsl(var(--vjr-field-error));
}

/* Hint / error text below the field. */
.vjr-field-hint       { font-size: 0.75rem; color: hsl(var(--vjr-field-muted-fg)); padding: 0 0.25rem; margin-top: 0.25rem; }
.vjr-field-error-text { font-size: 0.75rem; color: hsl(var(--vjr-field-error));    padding: 0 0.25rem; margin-top: 0.25rem; }

/* Small variant — for dense admin forms where the default 14px+padding
   reads as overweight (Edit Company drawer, settings panes, modals).
   Add `.vjr-field-sm` next to `.vjr-field` to opt in. Auth/signup keep
   the default size — they have one or two fields per page and benefit
   from the larger touch target. */
.vjr-field-sm                                  { border-radius: 0.4375rem; }
.vjr-field-sm .vjr-field-input                 { padding: 0.5rem 0.75rem; font-size: 0.8125rem; }
.vjr-field-sm .vjr-field-input.has-leading     { padding-left:  2.125rem; }
.vjr-field-sm .vjr-field-input.has-trailing    { padding-right: 2.125rem; }
.vjr-field-sm .vjr-field-leading               { left:  0.625rem; }
.vjr-field-sm .vjr-field-trailing              { right: 0.625rem; }
.vjr-field-sm .vjr-field-label                 { font-size: 0.8125rem; left: 0.75rem; }
.vjr-field-sm .vjr-field-label.is-float        { font-size: 11.5px; top: -0.55rem; left: 0.625rem; }

/* ── Buttons ─────────────────────────────────────────────────────────
   Three sizes (sm / md / lg) × four intents (primary / secondary /
   ghost / link). Primary is teal — the brand-action colour shared with
   .vjr-field's focus ring, the auth Continue button, and any "do this
   now" affordance across Vejaro. NEVER ship a black "primary" button —
   it reads as a low-contrast spec rather than a brand action.

   Token: --vjr-btn-primary uses the same teal as --vjr-field-ring so
   consumer apps can override one and have everything follow. */
:root {
    --vjr-btn-primary:           173 80% 40%;
    --vjr-btn-primary-hover:     173 80% 35%;
    --vjr-btn-primary-fg:        0 0% 100%;
    --vjr-btn-secondary-bg:      220 25% 95%;
    --vjr-btn-secondary-fg:      222 47% 11%;
    --vjr-btn-secondary-hover:   220 25% 90%;
    --vjr-btn-ghost-fg:          222 47% 11%;
    --vjr-btn-ghost-hover-bg:    220 25% 95%;
}
.dark {
    --vjr-btn-primary:           173 70% 50%;
    --vjr-btn-primary-hover:     173 70% 45%;
    --vjr-btn-primary-fg:        224 25% 9%;
    --vjr-btn-secondary-bg:      224 20% 18%;
    --vjr-btn-secondary-fg:      210 20% 96%;
    --vjr-btn-secondary-hover:   224 20% 24%;
    --vjr-btn-ghost-fg:          210 20% 96%;
    --vjr-btn-ghost-hover-bg:    224 20% 18%;
}

.vjr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
    text-decoration: none;
    white-space: nowrap;
}
.vjr-btn:disabled,
.vjr-btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
}
.vjr-btn-sm { padding: 0.4375rem 0.75rem;  font-size: 0.8125rem; border-radius: 0.4375rem; }
.vjr-btn-lg { padding: 0.8125rem 1.375rem; font-size: 0.9375rem; border-radius: 0.5rem; }

/* Primary — teal, white-on-teal, the everywhere-CTA. */
.vjr-btn-primary {
    background: hsl(var(--vjr-btn-primary));
    color: hsl(var(--vjr-btn-primary-fg));
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.vjr-btn-primary:hover:not(:disabled) {
    background: hsl(var(--vjr-btn-primary-hover));
}
.vjr-btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px hsl(var(--vjr-btn-primary) / 0.35);
}

/* Secondary — neutral surface, used for "View …" or "Cancel" next to a
   primary action. */
.vjr-btn-secondary {
    background: hsl(var(--vjr-btn-secondary-bg));
    color: hsl(var(--vjr-btn-secondary-fg));
    border-color: hsl(var(--vjr-btn-secondary-bg));
}
.vjr-btn-secondary:hover:not(:disabled) {
    background: hsl(var(--vjr-btn-secondary-hover));
    border-color: hsl(var(--vjr-btn-secondary-hover));
}
.vjr-btn-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px hsl(var(--vjr-field-ring) / 0.25);
}

/* Ghost — text-only with a hover wash. Use in dense rows and toolbars. */
.vjr-btn-ghost {
    background: transparent;
    color: hsl(var(--vjr-btn-ghost-fg));
}
.vjr-btn-ghost:hover:not(:disabled) {
    background: hsl(var(--vjr-btn-ghost-hover-bg));
}

/* Link — inline brand-coloured text with underline on hover. */
.vjr-btn-link {
    background: transparent;
    color: hsl(var(--vjr-btn-primary));
    padding: 0;
    border-radius: 0;
    font-weight: 500;
}
.vjr-btn-link:hover:not(:disabled) {
    text-decoration: underline;
}

/* ── Page surfaces ───────────────────────────────────────────────────
   The mockup-style layout: rounded white panels on a soft page
   background, generous padding, no hard borders. */

.vjr-page-title {
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.15;
    color: hsl(var(--foreground));
    letter-spacing: -0.01em;
}
.vjr-page-subtitle {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
    max-width: 56ch;
}

/* ── Welcome banner ──────────────────────────────────────────────────
   The big rounded white card with greeting + actions on the left and
   a stat pill on the right. */
.vjr-banner {
    position: relative;
    background: hsl(var(--vjr-field-bg));
    border-radius: 1rem;
    padding: 2rem 2.25rem;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.vjr-banner-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    background: hsl(var(--vjr-btn-primary) / 0.10);
    color: hsl(var(--vjr-btn-primary));
    font-size: 0.75rem;
    font-weight: 600;
}
.vjr-banner-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: center;
}
@media (min-width: 1024px) {
    .vjr-banner-grid { grid-template-columns: 1fr auto; }
}

/* ── Stat tile ───────────────────────────────────────────────────────
   The big-number summary row inside the welcome banner / sidebar
   widgets. */
.vjr-stat {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.vjr-stat-value {
    font-size: 1.625rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    line-height: 1.1;
}
.vjr-stat-label {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.vjr-stat-pill {
    display: inline-grid;
    grid-auto-flow: column;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 0.875rem;
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

/* ── Nav cards ───────────────────────────────────────────────────────
   The three big quick-access tiles under the welcome banner. */
.vjr-nav-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: hsl(var(--vjr-field-bg));
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: box-shadow 150ms ease, transform 150ms ease;
}
.vjr-nav-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-1px);
}
.vjr-nav-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    background: hsl(var(--vjr-btn-primary) / 0.10);
    color: hsl(var(--vjr-btn-primary));
}
.vjr-nav-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}
.vjr-nav-card-meta {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.4;
}
.vjr-nav-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid hsl(var(--border));
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}
.vjr-nav-card-foot:hover { color: hsl(var(--vjr-btn-primary)); }

/* ── Checklist rows ──────────────────────────────────────────────────
   Setup-checklist style cards with status icon + title/subtitle + chevron. */
.vjr-checklist-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 0.625rem;
    background: hsl(var(--muted) / 0.5);
    transition: background-color 120ms ease;
    cursor: pointer;
    color: hsl(var(--foreground));
    text-decoration: none;
}
.vjr-checklist-row:hover {
    background: hsl(var(--muted));
}
.vjr-checklist-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: hsl(var(--vjr-field-bg));
    color: hsl(var(--vjr-btn-primary));
    flex-shrink: 0;
}
.vjr-checklist-icon-done {
    background: hsl(var(--vjr-btn-primary) / 0.12);
    color:      hsl(var(--vjr-btn-primary));
}

/* ── Setup score progress ────────────────────────────────────────────
   The thin progress bar in the sidebar widget. */
.vjr-progress {
    width: 100%;
    height: 0.25rem;
    background: hsl(var(--muted));
    border-radius: 9999px;
    overflow: hidden;
}
.vjr-progress-bar {
    height: 100%;
    background: hsl(var(--vjr-btn-primary));
    border-radius: inherit;
    transition: width 220ms ease;
}