/**
 * WCAG 1.4.3 Contrast (Minimum) — AA (IS 5568 / WCAG 2.0 AA)
 *
 * Normal text: >= 4.5:1
 * Large text (18px+ or 14px+ bold): >= 3:1
 * Brand red #FF3B30 on white is ~3.5:1 — OK for large/bold CTAs, not for small body/links.
 */

:root {
    --a11y-text: #1f2937;          /* ~16:1 on white */
    --a11y-text-muted: #4b5563;    /* ~7.5:1 on white */
    --a11y-placeholder: #595959;   /* ~7:1 on white */
    --a11y-brand-text: #c62828;    /* ~5.9:1 on white — small red text/links */
    --a11y-error: #b91c1c;         /* ~6.5:1 on white */
    --a11y-border: #6b7280;        /* UI component border ~4.8:1 */
}

/* ---- Body / muted copy ---- */
body,
.site-wrapper,
.upload-app {
    color: var(--a11y-text);
}

.muted,
.pdf-form-page .ai-report-word-count,
.upload-app__status-line,
.upload-app__hint,
.upload-app__meta,
.email_updates_text,
.corresspondence_main_title {
    color: var(--a11y-text-muted) !important;
}

/* ---- Placeholders (must still be readable) ---- */
::placeholder,
input::placeholder,
textarea::placeholder,
.form-element textarea::placeholder,
.form-element input::placeholder,
.custom-select input.search-box::placeholder,
.pdf-form-page .form-field__input::placeholder {
    color: var(--a11y-placeholder) !important;
    opacity: 1;
}

/* ---- Small brand-red text / links (not large CTA buttons) ---- */
a:not(.btn):not(.btn-common):not(.header-action-btn):not(.header-action-link),
.upload-app__action-link,
.upload-app__title,
.form-field__error,
.pdf-form-page .form-field__error,
.pdf-form-page .ai-report-word-count.is-limit,
.terms-of-use-modal__title,
.terms_of_services_details_title,
span.policy-terms-checkbox-text a,
.ai_included_media {
    color: var(--a11y-brand-text);
}

a:not(.btn):not(.btn-common):not(.header-action-btn):not(.header-action-link):hover,
.upload-app__action-link:hover {
    color: #9f1d1d;
}

/* Voucher code radio list: neutral options; brand color only on active selection */
.voucher-code-radio-label {
    color: var(--a11y-text-muted) !important;
}

body:not(.darkmode--activated) .voucher-code-radio-label.voucher-code--current {
    color: var(--a11y-brand-text) !important;
}

/* Keep white text on solid brand CTAs (large/bold — AA large-text threshold).
   Exclude .btn-white (white background needs dark text). */
.btn-common:not(.btn-white),
.btn-common:not(.btn-white):hover,
.header-action-btn--logout,
.upload-app__header,
.upload-app__header-logo,
.upload-app__header-back,
.access-header, .wapup-invite-submit
.ai-prompt-tag {
    color: #ffffff !important;
}

/* White outlined login buttons (Gmail / Outlook) — dark text on white.
   Hover/active may use dark/red backgrounds — then switch to white text. */
.btn-common.btn-white {
    color: #1f2937 !important;
}

.btn-common.btn-white:hover,
.btn-common.btn-white:focus,
.btn-common.btn-white:active {
    color: #ffffff !important;
}

/* Radio / checkbox helper labels that were "gray" */
.radio-option span,
span.policy-terms-checkbox-text,
.option span,
.notify_me_text {
    color: var(--a11y-text-muted) !important;
}

/* Form fields that used light gray as text color */
.email_inputfield {
    color: var(--a11y-text) !important;
    border-color: var(--a11y-border) !important;
}

/* Borders that were too light against white for UI components (3:1) */
.form-element input,
.form-element textarea,
.form-field__input,
.pdf-form-page .form-field__input,
.wapup-invite-input {
    border-color: #757575;
}

/* Footer muted links */
.footer-bottom-bar .copyright,
.footer-widget p,
.footer-language-dropdown select {
    color: var(--a11y-text-muted);
}

/* Dark mode: keep readable light-on-dark contrast */
body.darkmode--activated,
body.darkmode--activated .site-wrapper,
body.darkmode--activated .upload-app {
    color: #f3f4f6;
}

body.darkmode--activated .muted,
body.darkmode--activated .pdf-form-page .ai-report-word-count,
body.darkmode--activated .upload-app__status-line,
body.darkmode--activated .email_updates_text,
body.darkmode--activated .corresspondence_main_title,
body.darkmode--activated .radio-option span {
    color: #d1d5db !important;
}
body.darkmode--activated span.policy-terms-checkbox-text {
    color: #000 !important;
}
body.darkmode--activated ::placeholder,
body.darkmode--activated input::placeholder,
body.darkmode--activated textarea::placeholder {
    color: #c0c4cc !important;
}

body.darkmode--activated a:not(.btn):not(.btn-common):not(.header-action-btn):not(.header-action-link),
body.darkmode--activated .upload-app__action-link,
body.darkmode--activated .upload-app__title,
body.darkmode--activated .pdf-form-page .ai-report-word-count.is-limit {
    color: #ff8a80;
}

/* Voucher / policy statement: cyan accents in dark mode (not salmon/red) */
body.darkmode--activated .voucher-statement__title,
body.darkmode--activated .voucher-statement__toc-title,
body.darkmode--activated .voucher-statement__section h2,
body.darkmode--activated .voucher-statement__toc-list a,
body.darkmode--activated .voucher-statement__toc-list a:hover,
body.darkmode--activated .voucher-statement__toc-list a:focus {
    color: #00c4cf !important;
}

body.darkmode--activated .voucher-code-radio-label {
    color: #d1d5db !important;
}

body.darkmode--activated .voucher-code-radio-label.voucher-code--current,
body.darkmode--activated .voucher-code-radio-label.voucher-code--unpaid,
body.darkmode--activated .voucher-code-radio-item.is-current .voucher-code-radio-label {
    color: #00c4cf !important;
}

body.darkmode--activated .voucher-code-radio-label.voucher-code--used {
    color: #9ca3af !important;
}
