/*
  Afrandeh — accessibility fixes (WCAG 2.1 AA) for all 16 themes
  Generated 2026-11-01 from the Afrandeh UI Kit audit. Drop in AFTER css/design-tokens.css.

  What it does
  - New tokens: --afr-fill-primary/-secondary/-success/-danger/-accent (button fills with white text >= 4.5:1),
    --afr-border-strong (control edges >= 3:1), and a readable --afr-text-placeholder (>= 4.5:1).
  - Points MudBlazor filled buttons, outlined inputs, placeholders and the login button at them.
  - Brand colours (--afr-brand-*) are NOT changed: they stay for icons, tints, borders and charts.

  Order matters: palettes (html[data-palette]) come after the bases, as in design-tokens.css.
  Keep in step with Web/Afrandeh.UI.Shared/Theme/AfrandehTheme.cs (see the kit's themes/ACCESSIBILITY.md).
*/

/* روشن */
:root,
html[data-theme="light"] {
    --afr-fill-primary: #ac6232;
    --afr-fill-secondary: #6c7a53;
    --afr-fill-success: #188659;
    --afr-fill-danger: #d93542;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #80776a;
    --afr-text-placeholder: #71695c;
}

/* تیره */
html[data-theme="dark"],
html.mud-theme-dark {
    --afr-fill-primary: #0b6fcb;
    --afr-fill-secondary: #6c7a53;
    --afr-fill-success: #188659;
    --afr-fill-danger: #d93542;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #6b6f76;
    --afr-text-placeholder: #888c94;
}

/* کرم روشن */
html[data-palette="bright"] {
    --afr-fill-primary: #ac6232;
    --afr-fill-secondary: #6c7a53;
    --afr-fill-success: #188659;
    --afr-fill-danger: #d93542;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #8b857c;
    --afr-text-placeholder: #6e685d;
}

/* شکوفه */
html[data-palette="blossom"] {
    --afr-fill-primary: #526ca6;
    --afr-fill-secondary: #a26274;
    --afr-fill-success: #188659;
    --afr-fill-danger: #d93542;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #917f81;
    --afr-text-placeholder: #766267;
}

/* تالاب */
html[data-palette="lagoon"] {
    --afr-fill-primary: #4d52b4;
    --afr-fill-secondary: #268274;
    --afr-fill-success: #188659;
    --afr-fill-danger: #d93542;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #7d8497;
    --afr-text-placeholder: #606882;
}

/* دارچین و دریا */
html[data-palette="spice"] {
    --afr-fill-primary: #c84a2b;
    --afr-fill-secondary: #278272;
    --afr-fill-success: #188659;
    --afr-fill-danger: #d93542;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #857a71;
    --afr-text-placeholder: #796e65;
}

/* توت */
html[data-palette="berry"] {
    --afr-fill-primary: #934372;
    --afr-fill-secondary: #536ca5;
    --afr-fill-success: #188659;
    --afr-fill-danger: #c0283a;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #8f7886;
    --afr-text-placeholder: #755a6a;
}

/* نیمه‌شب */
html[data-palette="midnight"] {
    --afr-fill-primary: #546895;
    --afr-fill-secondary: #7f707c;
    --afr-fill-success: #188659;
    --afr-fill-danger: #d93542;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #6e6d87;
    --afr-text-placeholder: #8d8aa4;
}

/* رز نئونی */
html[data-palette="neonrose"] {
    --afr-fill-primary: #cb3e84;
    --afr-fill-secondary: #cb3e84;
    --afr-fill-success: #188659;
    --afr-fill-danger: #d93542;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #687483;
    --afr-text-placeholder: #7b8798;
    --afr-tab-active-text: #ef5ca4;
    --afr-nav-active-text: #ef5ca4;
}

/* یاس و کهربا */
html[data-palette="amethyst"] {
    --afr-fill-primary: #7061cf;
    --afr-fill-secondary: #9d6b1b;
    --afr-fill-success: #188659;
    --afr-fill-danger: #d93542;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #8c6e9f;
    --afr-text-placeholder: #a680b6;
}

/* فیروزه و مس */
html[data-palette="tealcopper"] {
    --afr-fill-primary: #3d797d;
    --afr-fill-secondary: #b95a1d;
    --afr-fill-success: #188659;
    --afr-fill-danger: #d93542;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #5d898e;
    --afr-text-placeholder: #77a9ae;
}

/* آلو و مرجان */
html[data-palette="plumcoral"] {
    --afr-fill-primary: #95588c;
    --afr-fill-secondary: #c15151;
    --afr-fill-success: #188659;
    --afr-fill-danger: #d93542;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #ad5684;
    --afr-text-placeholder: #db6d9c;
}

/* جنگل و طلا */
html[data-palette="forestgold"] {
    --afr-fill-primary: #3e5a3f;
    --afr-fill-secondary: #8a6a36;
    --afr-fill-success: #14633a;
    --afr-fill-danger: #b02424;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #817b6d;
    --afr-text-placeholder: #665f4f;
}

/* اقیانوس و غروب */
html[data-palette="oceansunset"] {
    --afr-fill-primary: #5b6d83;
    --afr-fill-secondary: #b06005;
    --afr-fill-success: #188659;
    --afr-fill-danger: #d93542;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #3c7895;
    --afr-text-placeholder: #4997b4;
}

/* خزه */
html[data-palette="moss"] {
    --afr-fill-primary: #647a64;
    --afr-fill-secondary: #677a63;
    --afr-fill-success: #188659;
    --afr-fill-danger: #d93542;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #728374;
    --afr-text-placeholder: #93a291;
}

/* خزه‌ی روشن */
html[data-palette="mosslight"] {
    --afr-fill-primary: #3e5a3f;
    --afr-fill-secondary: #566a53;
    --afr-fill-success: #14633a;
    --afr-fill-danger: #b02424;
    --afr-fill-accent: #d93542;
    --afr-border-strong: #747f71;
    --afr-text-placeholder: #566453;
}

/* ---------- Components ---------- */

/* MudBlazor filled buttons: white label on an accessible fill */
.mud-button-filled.mud-button-filled-primary   { background-color: var(--afr-fill-primary) !important;   color: #ffffff !important; }
.mud-button-filled.mud-button-filled-secondary { background-color: var(--afr-fill-secondary) !important; color: #ffffff !important; }
.mud-button-filled.mud-button-filled-success   { background-color: var(--afr-fill-success) !important;   color: #ffffff !important; }
.mud-button-filled.mud-button-filled-error     { background-color: var(--afr-fill-danger) !important;    color: #ffffff !important; }
.mud-button-filled.mud-button-filled-primary:hover   { background-color: color-mix(in srgb, var(--afr-fill-primary) 86%, #000) !important; }
.mud-button-filled.mud-button-filled-secondary:hover { background-color: color-mix(in srgb, var(--afr-fill-secondary) 86%, #000) !important; }
.mud-button-filled.mud-button-filled-success:hover   { background-color: color-mix(in srgb, var(--afr-fill-success) 86%, #000) !important; }
.mud-button-filled.mud-button-filled-error:hover     { background-color: color-mix(in srgb, var(--afr-fill-danger) 86%, #000) !important; }

/* Outlined buttons: label and edge in the readable primary text colour */
.mud-button-outlined.mud-button-outlined-primary { color: var(--afr-primary-text) !important; border-color: var(--afr-primary-text) !important; }
.mud-button-text.mud-button-text-primary         { color: var(--afr-primary-text) !important; }

/* Inputs, selects, autocompletes, pickers: a control edge that can be seen (3:1) */
.mud-input.mud-input-outlined .mud-input-outlined-border { border-color: var(--afr-border-strong); }
.mud-input.mud-input-outlined:hover:not(.mud-disabled) .mud-input-outlined-border { border-color: var(--afr-brand-primary); }
.mud-input.mud-input-underline::before { border-bottom-color: var(--afr-border-strong); }
.mud-checkbox .mud-icon-root:not(.mud-checked) { color: var(--afr-border-strong); }

/* Placeholders readable (4.5:1) */
.mud-input-slot::placeholder, .mud-input > input::placeholder, textarea::placeholder,
.login-field::placeholder { color: var(--afr-text-placeholder) !important; opacity: 1; }

/* Identity pages */
.login-field { border-color: var(--afr-border-strong); }
.login-submit-btn { background: linear-gradient(90deg, var(--afr-fill-primary), var(--afr-fill-accent)); }
.login-links a { color: var(--afr-primary-text); }

/* Selected day / clock number / checked box */
.mud-picker-calendar .mud-day.mud-selected { background-color: var(--afr-fill-primary) !important; color: #ffffff !important; }
.mud-picker-time-clock .mud-picker-time-clock-pin, .mud-picker-time-clock .mud-picker-time-clock-pointer { background-color: var(--afr-fill-primary) !important; }
