/*
 * One look for every message the app shows. Where it appears depends on the case:
 *   field    next to the input it is about (.broder-field-error, .bs-error)
 *   inline   next to the action that failed (.bn)
 *   toast    result of a page load or redirect (.personal-flash-stack, .sp-flash)
 *   blocked  the whole page is unavailable (errors/school_blocked)
 */
:root { --bn-danger: #ff6b6b; --bn-warning: #f0b429; --bn-success: #35c47a; --bn-info: #5b9dff; --bn-surface: #232326; --bn-ink: #f5f4f1; }
:root[data-bs-theme='light'], [data-bs-theme='light'] { --bn-danger: #c62f36; --bn-warning: #9a6400; --bn-success: #17794a; --bn-info: #1d5fc4; --bn-surface: #ffffff; --bn-ink: #161618; }

body .bn { --bn-tone: var(--bn-info); display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--bn-tone) 38%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--bn-tone) 11%, var(--bn-surface)); color: var(--bn-ink); font-size: 13px; line-height: 1.45; text-align: left; }
body .bn[hidden] { display: none; }
body .bn--danger { --bn-tone: var(--bn-danger); }
body .bn--warning { --bn-tone: var(--bn-warning); }
body .bn--success { --bn-tone: var(--bn-success); }
body .bn::before, body .broder-field-error::before, body .bs-error::before { content: '!'; display: inline-grid; flex: none; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--bn-tone, var(--bn-danger)); color: var(--bn-surface); font: 800 12px/1 system-ui, sans-serif; }
body .bn--success::before { content: '✓'; }
body .bn--info::before { content: 'i'; }
body .bn-body { flex: 1; min-width: 0; }
body .bn-body > strong { display: block; }
body .bn .btn-close { position: static; flex: none; width: 10px; height: 10px; margin: 0; padding: 4px; }

body .broder-field-error:not([hidden]), body .bs-error:not([hidden]) { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 0; color: var(--bn-danger); font-size: 13px; font-weight: 550; line-height: 1.4; text-align: left; }
body .broder-field-error::before, body .bs-error::before { width: 16px; height: 16px; margin-top: 1px; font-size: 11px; }
body :is(input, select, textarea)[aria-invalid='true'] { border-color: var(--bn-danger) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--bn-danger) 18%, transparent) !important; }

body .personal-flash-stack { position: fixed; z-index: 1080; top: calc(16px + env(safe-area-inset-top, 0px)); left: 50%; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 24px)); margin: 0; transform: translateX(-50%); }
body .personal-flash-stack .bn, body .sp-flash.bn { box-shadow: 0 18px 40px -18px rgb(0 0 0 / 55%); }
body .sp-flash.bn { max-width: min(440px, calc(100% - 24px)); width: max-content; }

/* Every dropdown arrow sits as far from the right edge as the text does from the left. */
body select:not([multiple]):not([size]) {
  padding-right: 38px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%238a8d93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 12px 8px !important;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
