/* AODA / WCAG 2.1 AA Portal Overrides — can_base */
/* Applied to ERPNext web portal pages for Canadian AODA compliance. */

/* ── Skip navigation ──────────────────────────────────────────────────────── */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: #0057a8;
  color: #fff;
  padding: 8px;
  z-index: 100;
  text-decoration: none;
  font-weight: 600;
}
.skip-to-main:focus {
  top: 0;
}

/* ── Focus indicators — WCAG 2.4.7 ───────────────────────────────────────── */
*:focus {
  outline: 3px solid #0057a8 !important;
  outline-offset: 2px !important;
}

/* ── Minimum contrast — body text on white (#595959 on white ≈ 7:1) ──────── */
body,
.portal-body {
  color: #595959;
}

/* ── Link contrast — minimum 4.5:1 on white ─────────────────────────────── */
a,
a:visited {
  color: #0057a8;
}
a:hover {
  color: #003d7a;
  text-decoration: underline;
}
a:focus {
  color: #003d7a;
}

/* ── Form labels ─────────────────────────────────────────────────────────── */
label {
  font-weight: 600;
  color: #333333;
}

/* Required field indicator accessible via text/aria, not colour alone */
label.required::after,
.reqd::after {
  content: " (required)";
  font-size: 0.85em;
  color: #595959;
  font-weight: normal;
}

/* ── Error state — red meets 4.5:1 (#c0392b on white ≈ 4.9:1) ───────────── */
.has-error .help-block {
  color: #c0392b;
}
.has-error .form-control {
  border-color: #c0392b;
  border-width: 2px;
}

/* ── Button contrast ─────────────────────────────────────────────────────── */
.btn-primary {
  background-color: #0057a8;
  border-color: #003d7a;
  color: #ffffff;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: #003d7a;
  border-color: #002d5c;
  color: #ffffff;
}
.btn-secondary {
  background-color: #595959;
  border-color: #3a3a3a;
  color: #ffffff;
}
.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #3a3a3a;
  color: #ffffff;
}

/* ── Input fields — border meets 4.54:1 (#767676 on white) ──────────────── */
input,
select,
textarea {
  border: 1px solid #767676;
  border-radius: 3px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #0057a8;
  border-width: 2px;
}

/* Disabled inputs — sufficient contrast at reduced opacity */
input:disabled,
select:disabled,
textarea:disabled {
  background-color: #f0f0f0;
  color: #595959;
  opacity: 1; /* override browser default which can reduce contrast */
}

/* ── Table headers ───────────────────────────────────────────────────────── */
th {
  background-color: #e8f0fe;
  color: #1a1a1a;
  font-weight: 700;
}

/* Zebra striping with sufficient contrast */
tbody tr:nth-child(even) {
  background-color: #f7f7f7;
}

/* ── Navigation / breadcrumb ─────────────────────────────────────────────── */
.breadcrumb > li + li::before {
  color: #595959;
}
.breadcrumb > .active {
  color: #333333;
}

/* ── Alert / notification boxes ─────────────────────────────────────────── */
.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}
.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border-color: #ffeeba;
}
.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}
.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-color: #bee5eb;
}

/* ── Portal card elements ────────────────────────────────────────────────── */
.portal-card {
  border: 1px solid #767676;
}
.portal-card .card-title {
  color: #1a1a1a;
}
