/*
 * CargoPay - Brand Contrast Corrections
 * Loaded immediately after unify/dist/assets/css/theme.min.css.
 *
 * The Unify brand green (#0ABF53) and amber (#f39568) measure 2.44:1 and 2.26:1
 * against white, so every use of them as text - or as a surface under white text -
 * fails WCAG 2.1 AA (1.4.3, 4.5:1). This sheet corrects the FOREGROUND only: brand
 * surfaces keep their exact colour, while the text sitting on or beside them moves
 * to a shade that passes. Ratios are noted per rule.
 *
 * On .bg-dark the vivid green already passes (4.88:1) and the darker shade would
 * not, so it is restored there.
 */

:root {
    --bs-link-color: #077C36;       /* 5.32:1 on #fff, 4.96:1 on #F5F7FA */
    --bs-link-hover-color: #056B2D; /* 6.67:1 on #fff */
}

/* Solid brand-green buttons: keep the green surface, ink the label - 6.60:1 */
.btn-primary {
    --bs-btn-color: #1b212d;
    --bs-btn-hover-color: #1b212d;
    --bs-btn-active-color: #1b212d;
    --bs-btn-disabled-color: #1b212d;
}

/* Outlined brand buttons: green label on white fails, ink the filled hover state */
.btn-outline-primary {
    --bs-btn-color: #077C36;
    --bs-btn-hover-color: #1b212d;
    --bs-btn-active-color: #1b212d;
    --bs-btn-disabled-color: #077C36;
}

/* Brand-coloured text and inline links on light surfaces */
.text-primary,
.link-primary {
    color: #077C36 !important;
}

.link-primary:hover,
.link-primary:focus {
    color: #056B2D !important;
    opacity: 1;
}

.link-warning {
    color: #A8500B !important; /* 5.50:1 on #fff */
}

.link-warning:hover,
.link-warning:focus {
    color: #8F4A26 !important; /* 6.61:1 on #fff */
    opacity: 1;
}

/* Solid brand-green surfaces (badges, icon circles, callout panels, card headers,
   solid alerts) carry white text at 2.44:1. The theme already inks its amber
   surfaces (.btn-warning and .alert-warning ship with color:#000), so green
   follows the same rule rather than losing its surface colour. */
.bg-primary,
.bg-primary.text-white,
.bg-primary .text-white,
.badge.bg-primary,
.alert-primary {
    color: #1b212d !important; /* 6.60:1 on #0ABF53 */
}

/* Same for the solid amber surfaces the theme does not already ink */
.bg-warning,
.bg-warning.text-white,
.bg-warning .text-white,
.badge.bg-warning {
    color: #1b212d !important; /* 7.15:1 on #f39568 */
}

/* Buttons inside those blocks keep their own label colour - the inking rule above
   is for the surface's own text, not for controls sitting on top of it. */
.bg-primary .btn,
.bg-warning .btn {
    color: var(--bs-btn-color) !important;
}

/* .opacity-75 subtitles sitting directly on a brand surface land at 3.55:1 (white
   on teal) and 4.20:1 (ink on green). Keep that text opaque; the surrounding
   surface still carries the visual hierarchy. */
.bg-primary .opacity-75,
.bg-success .opacity-75,
.bg-warning .opacity-75 {
    opacity: 1 !important; /* Bootstrap's .opacity-75 is itself !important */
}

/* Tinted alert washes carry their brand colour as body text (2.13:1) */
.alert-soft-primary {
    color: #077C36; /* 4.64:1 - 5.08:1 on the tint */
}

.alert-soft-warning {
    color: #A8500B; /* 5.08:1 on the tint */
}

/* Amber on the tinted .bg-soft-warning surfaces measures 2.12:1 - darken it there
   only, since .text-warning on .bg-dark already passes at 5.29:1 */
.bg-soft-warning .text-warning {
    color: #A8500B !important; /* 5.19:1 on #FEF7F4 */
}

/* Inline links inside body copy sit at 1.31:1 against the surrounding text, so
   colour alone does not identify them (WCAG 1.4.1). Component links (.link,
   .btn, .nav-link and friends) already read as controls and keep their styling. */
p a:not([class]) {
    text-decoration: underline;
}

/* Dark sections: the vivid brand green is the accessible choice there (4.88:1) */
.bg-dark {
    --bs-link-color: #0ABF53;
    --bs-link-hover-color: #0ABF53;
}

.bg-dark .text-primary,
.bg-dark .link-primary {
    color: #0ABF53 !important;
}
