/* ─── Nutrichum brand tokens ─────────────────────────────────────────────
   Source: wwwroot/marketing/design_handoff_nutrichum_brand/README.md */
:root {
    /* Generated from the Penpot token catalog — palette "Grove", brief 001.
       Names are historical and no longer describe their values (--color-accent-carrot
       now holds terracotta); renaming them is a separate refactor.

       Aliased onto --mud-palette-* (emitted at runtime by NutrichumTheme.cs) wherever
       MudBlazor exposes a matching slot, per DECISIONS.md §7 — one source. No literal
       fallback: MudThemeProvider is mounted by MainLayout/AuthLayout/PublicLayout, and
       Routes.razor defaults every route with no explicit @layout to MainLayout, so
       there is no page in this app where these vars aren't defined — verified by
       curling a static-SSR page (Account/Register) and finding --mud-palette-* already
       in the rendered HTML. Two roles have no Mud palette equivalent (containers) and
       stay literal; see notes below. */
    --color-brand-primary: var(--mud-palette-primary);      /* scheme.light.primary */
    --color-brand-leaf:    #DCEBD2; /* scheme.light.primaryContainer   — no Mud slot; container roles aren't in MudBlazor's palette */
    --color-brand-sprout:  #FFD9BF; /* scheme.light.secondaryContainer — same */
    --color-accent-carrot: var(--mud-palette-secondary);    /* scheme.light.secondary */
    --color-accent-coral:  var(--mud-palette-tertiary);     /* scheme.light.tertiary */
    --color-data-berry:    var(--mud-palette-info);         /* extended.light.info */
    --color-ink:           var(--mud-palette-text-primary); /* scheme.light.onSurface */
    --color-paper:         var(--mud-palette-background);   /* scheme.light.background */
    /* rgba(ink) tints, not the outlineVariant/outline tokens platform-targets.md maps them
       to — the two disagree in value (translucent ink vs. solid grey). Not aliased until
       that's reconciled in Penpot; see design-tokens skill drift-check notes. */
    --color-line:          rgba(28, 28, 21, 0.10);
    --color-line-strong:   rgba(28, 28, 21, 0.18);

    --radius-card: 14px;
    --radius-pill: 999px;

    --shadow-card-hover: 0 1px 0 rgba(28,28,21,0.04), 0 24px 48px -32px rgba(28,28,21,0.18);

    --space-one:   2px;
    --space-two:   4px;
    --space-three: 8px;
    --space-four:  12px;
    --space-five:  16px;
    --space-six:   24px;
    --space-seven: 32px;
    --space-eight: 48px;
}

.mud-drawer .mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled) {
    color: var(--mud-palette-drawer-icon);
    background-color: rgba(255, 255, 255, 0.08);
}

.mud-drawer .mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled):hover:not(.mud-nav-link-disabled),
.mud-drawer .mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled):focus-visible:not(.mud-nav-link-disabled) {
    background-color: rgba(255, 255, 255, 0.14);
}

/* Brand typography utilities (opt-in — MudBlazor's Typo system stays default for app surfaces). */
.brand-display-xl { font-size: 54px; font-weight: 700; letter-spacing: -0.02em; }
.brand-display-l  { font-size: 44px; font-weight: 700; letter-spacing: -0.035em; }
.brand-display-m  { font-size: 32px; font-weight: 600; letter-spacing: -0.015em; }
.brand-heading-l  { font-size: 24px; font-weight: 500; letter-spacing: -0.01em; }
.brand-heading-m  { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.brand-body       { font-size: 16px; font-weight: 400; line-height: 1.55; }
.brand-body-s     { font-size: 14px; font-weight: 400; line-height: 1.6; }
.brand-eyebrow    { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; }
.brand-mono-label { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }

.brand-logo { display: inline-block; vertical-align: middle; }

html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-feature-settings: "ss01", "cv11";
    margin: 0;
    padding: 0;
    background-color: var(--color-paper);
    color: var(--color-ink);
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: none;
}

.invalid {
    outline: none;
}

/* Kept a literal fallback here, unlike everywhere else in this file: this boundary is
   Blazor's own catastrophic-failure UI, the one case where rendering may not have
   reached MudThemeProvider at all. */
.blazor-error-boundary {
    background: var(--mud-palette-error, #AC322F);
    padding: var(--space-five);
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: var(--space-three) var(--space-six) var(--space-four) var(--space-six);
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Generic validation-error text (used by Blazor's <ValidationMessage>). */
.validation-message {
    font-size: 0.8rem;
    color: var(--mud-palette-error);
    margin-top: var(--space-one);
}

/* Native <select> wrapper used on Register / CompleteBusinessRegistration where
   MudSelect's popover-based control isn't compatible with static SSR form-post.
   Styled to match MudTextField Variant.Outlined so the form looks cohesive. */
.form-select-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-two);
}

.form-select-group label {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 400;
    padding-left: var(--space-two);
}

.form-select-group select {
    width: 100%;
    padding: var(--space-five) var(--space-four);
    border: 1px solid rgba(0, 0, 0, 0.23);
    border-radius: 4px;
    background: #fff;
    font-size: 1rem;
    font-family: inherit;
    color: rgba(0, 0, 0, 0.87);
    transition: border-color 150ms;
}

.form-select-group select:hover {
    border-color: rgba(0, 0, 0, 0.87);
}

.form-select-group select:focus {
    outline: none;
    border-color: var(--mud-palette-primary);
    border-width: 2px;
    padding: calc(var(--space-five) - 1px) calc(var(--space-four) - 1px);
}

/* Plan-card radio-driven selector used on Register + CompleteBusinessRegistration. */
.plan-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-four);
}

.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-three);
    padding: var(--space-five);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 150ms, box-shadow 150ms;
}

.plan-card:hover {
    border-color: var(--mud-palette-primary);
}

.plan-card.selected {
    border-color: var(--mud-palette-primary);
    border-width: 2px;
    padding: calc(var(--space-five) - 1px);
    box-shadow: 0 0 0 1px var(--mud-palette-primary);
}

.plan-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.plan-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.87);
}

.plan-card-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mud-palette-primary);
    line-height: 1.2;
}

.plan-card-price small {
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.6);
}

.plan-card-desc {
    font-size: 0.8125rem;
    color: rgba(0, 0, 0, 0.6);
    min-height: 2.4em;
}

.plan-card-features {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.6);
}

.plan-card-features li {
    padding: var(--space-one) 0;
}

/* Static-SSR password show/hide toggle (custom element from
   PasswordInputStatic.razor.js). The element is empty in DOM order — the JS
   appends a button inside the adjacent MudTextField's `.mud-input` wrapper,
   so the rules below target that injected button by class. */
.password-input-static {
    position: relative;
}

.mud-input .pwd-toggle-btn {
    /* MudBlazor's input wrapper is positioned; align the button to the right
       edge so it overlaps the spot a real Adornment.End would occupy. */
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease;
}

.mud-input .pwd-toggle-btn:hover,
.mud-input .pwd-toggle-btn:focus-visible {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--mud-palette-text-primary);
    outline: none;
}

.mud-input .pwd-toggle-btn:active {
    background-color: rgba(0, 0, 0, 0.08);
}

/* Reserve room inside the input so typed text never slips under the eye icon. */
.mud-input input[type="password"],
.mud-input input[type="text"] {
    padding-right: 40px;
}

/* Static-SSR password strength meter (custom element from PasswordSetupStatic.razor.js).
   Used on pre-auth pages (Register, RegisterInvite, ResetPassword) that can't take a
   Blazor circuit. Shared across pages so it lives here, not in a .razor.css. */
password-strength {
    display: block;
}

password-strength .ps-meter {
    width: 100%;
    height: 6px;
    background-color: #EEEEEE;
    border-radius: 3px;
    overflow: hidden;
    margin: var(--space-two) 0;
}

password-strength .ps-meter-fill {
    height: 100%;
    transition: width 150ms ease, background-color 150ms ease;
}

password-strength .ps-label {
    font-size: 0.8125rem;
    font-weight: 500;
    min-height: 1.2em;
}

password-strength .ps-requirements {
    list-style: none;
    margin: var(--space-three) 0 0;
    padding: 0;
    font-size: 0.8125rem;
}

password-strength .ps-requirements li {
    display: flex;
    align-items: center;
    gap: var(--space-three);
    padding: var(--space-one) 0;
    color: #757575;
}

password-strength .ps-requirements li.ok {
    color: var(--color-brand-primary);
}

password-strength .ps-bullet {
    display: inline-block;
    width: 1em;
    text-align: center;
    font-weight: 600;
}

/* Password strength meter (PasswordStrengthMeter.razor) */
.password-strength .password-requirements {
    list-style: none;
    margin: var(--space-three) 0 0;
    padding: 0;
    font-size: 0.8125rem;
}

.password-strength .password-requirements li {
    display: flex;
    align-items: center;
    gap: var(--space-two);
    padding: var(--space-one) 0;
    color: #757575;
}

.password-strength .password-requirements li.ok {
    color: var(--color-brand-primary);
}

/* Status message styles */
.status-message {
    display: flex;
    align-items: center;
    gap: var(--space-four);
    padding: var(--space-four) var(--space-five);
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: var(--space-six);
}

/* Container-role tokens — MudBlazor has no container slot, so these are literal
   catalog values (scheme.light.errorContainer/onErrorContainer,
   extended.light.successContainer/onSuccessContainer) rather than Mud vars, same
   treatment as --color-brand-leaf/--color-brand-sprout above. Border reuses the base
   Mud var so it still repaints correctly if the palette changes. */
.status-error {
    background: #FFDAD5;
    color: #3C0700;
    border: 1px solid var(--mud-palette-error);
}

.status-success {
    background: #B2F2B8;
    color: #002202;
    border: 1px solid var(--mud-palette-success);
}

.status-icon {
    flex-shrink: 0;
}

/* External login picker override */
.form-horizontal {
    margin-top: var(--space-five);
}

.form-horizontal .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-four) var(--space-six);
    background: transparent;
    color: var(--mud-palette-text-secondary);
    border: 1.5px solid var(--mud-palette-divider-light);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    margin-right: var(--space-three);
}

.form-horizontal .btn-primary:hover {
    border-color: var(--color-brand-primary);
    background: rgba(75, 102, 52, 0.04);
    color: var(--color-ink);
}

/* Passkey button (inherits from btn-link class) */
.passkey-button,
.btn-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-three);
    width: 100%;
    padding: var(--space-four);
    background: transparent;
    color: var(--mud-palette-text-secondary);
    border: 1.5px solid var(--mud-palette-divider-light);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.passkey-button:hover,
.btn-link:hover {
    border-color: var(--color-brand-primary);
    background: rgba(75, 102, 52, 0.04);
    color: var(--color-ink);
    text-decoration: none;
}

/* Plan selection cards */
.plan-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-four);
    margin-bottom: var(--space-three);
}

.plan-card {
    display: block;
    border: 1.5px solid var(--mud-palette-divider-light);
    border-radius: 10px;
    padding: var(--space-five);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.plan-card:hover {
    border-color: var(--mud-palette-primary-lighten);
    box-shadow: 0 2px 8px rgba(75, 102, 52, 0.1);
}

.plan-card-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.plan-card:has(.plan-card-radio:checked) {
    border-color: var(--color-brand-primary);
    box-shadow: 0 2px 12px rgba(75, 102, 52, 0.18);
    background: rgba(75, 102, 52, 0.03);
}

.plan-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-two);
}

.plan-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-ink);
}

.plan-card-badge {
    background: #E8F5E9;
    color: var(--color-brand-primary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: var(--space-one) var(--space-three);
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.plan-card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-brand-primary);
    margin-bottom: var(--space-two);
}

.plan-card-price small {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--mud-palette-text-disabled);
}

.plan-card-desc {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
    margin-bottom: var(--space-three);
}

.plan-card-features {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
}

.plan-card-features li {
    padding: var(--space-one) 0;
}

@media (max-width: 640px) {
    .plan-cards {
        grid-template-columns: 1fr;
    }
}

/* ─── Legal pages ────────────────────────────────────────────────────────
   /privacy, /data-safety, /delete-account. Plain HTML, not MudText per line —
   legal copy is mostly prose and a component per paragraph is unreadable to
   edit. MudBlazor styles only its own components (body typography, nothing for
   bare h1/a/p/table), so these cover just the gaps browser defaults get wrong.
   ──────────────────────────────────────────────────────────────────────── */
.legal { max-width: 46rem; margin: 0 auto; }
/* Browser defaults are 24px/700 for h2 — too heavy beside a 32px h1, and the
   privacy page has 26 of them. Asymmetric margin binds a heading to its text. */
.legal h1 { font-size: 1.95rem; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 var(--space-three); }
.legal h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; margin: var(--space-seven) 0 var(--space-three); }
.legal strong { font-weight: 600; }               /* 700 is shouty in Inter */
.legal code { background: var(--color-brand-leaf); padding: 0.1em 0.35em; border-radius: 4px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.88em; }
.legal p, .legal li { line-height: 1.65; }        /* Mud's ~1.43 is tight for prose */
.legal li { margin: var(--space-three) 0; }
.legal a { color: var(--color-brand-primary); }   /* else browser blue */
.legal-updated { color: var(--mud-palette-text-secondary); font-size: 0.88rem; margin: 0 0 var(--space-seven); }

.legal table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.legal th, .legal td { border: 1px solid var(--color-line); padding: var(--space-three) var(--space-four); text-align: left; }
.legal th { background: var(--color-brand-leaf); font-weight: 600; }

.legal .card {
    background: var(--color-paper);
    border: 1px solid var(--color-line);
    border-left: 3px solid var(--color-brand-primary);
    border-radius: var(--radius-card);
    padding: var(--space-five) var(--space-six);
    margin: var(--space-six) 0;
}
.legal .card p:first-child { margin-top: 0; }
.legal .card p:last-child  { margin-bottom: 0; }
