/* ── High Contrast / Colorblind-friendly Theme ───────────── */
/*
   Avoids red/green confusion. Uses blue/orange/purple palette.
   Optimised for deuteranopia, protanopia and tritanopia.
   Meets WCAG AA contrast requirements (≥4.5:1 for normal text).
*/
:root,
[data-theme="colorblind"] {
    --color-bg:        #ffffff;
    --color-surface:   #f8f8f8;
    --color-border:    #555555;
    --color-text:      #000000;
    --color-text-muted:#444444;
    --color-primary:   #0057b8;   /* Strong blue — safe for all types */
    --color-primary-h: #003d82;
    --color-secondary: #6a00a8;   /* Purple accent */
    --color-danger:    #d45f00;   /* Orange — visible to all */
    --color-success:   #0057b8;   /* Blue instead of green */
    --color-warning:   #aa6600;   /* Dark amber */
    --color-nav-bg:    #000000;
    --color-nav-text:  #ffffff;
    --color-nav-hover: #0057b8;
}

/* High contrast focus ring */
[data-theme="colorblind"] :focus-visible {
    outline: 3px solid #d45f00;
    outline-offset: 2px;
}

/* Ensure form inputs have very clear borders */
[data-theme="colorblind"] input,
[data-theme="colorblind"] select,
[data-theme="colorblind"] textarea {
    border: 2px solid #000 !important;
}
[data-theme="colorblind"] input:focus,
[data-theme="colorblind"] select:focus,
[data-theme="colorblind"] textarea:focus {
    border-color: #0057b8 !important;
    box-shadow:   0 0 0 3px rgba(0,87,184,.35) !important;
}

/* Badges use text + border patterns instead of colour alone */
[data-theme="colorblind"] .badge-success {
    background: #e8f0ff;
    color:      #0057b8;
    border:     2px solid #0057b8;
}
[data-theme="colorblind"] .badge-danger {
    background: #fff3e8;
    color:      #d45f00;
    border:     2px solid #d45f00;
}

/* Alert: add icons via pseudo-elements for colour-independent cues */
[data-theme="colorblind"] .alert-success { background: #e8f0ff; border-color: #0057b8; color: #00245a; }
[data-theme="colorblind"] .alert-error   { background: #fff3e8; border-color: #d45f00; color: #6b2d00; }
[data-theme="colorblind"] .alert-warning { background: #fffbe8; border-color: #aa6600; color: #4a2900; }
[data-theme="colorblind"] .alert-info    { background: #f3eaff; border-color: #6a00a8; color: #2d0050; }

/* Larger font for better readability */
[data-theme="colorblind"] body { font-size: 17px; }

/* Underline all links for non-colour identification */
[data-theme="colorblind"] a { text-decoration: underline; }
