/* Framework-free starter components for Project Blue Horizon.
   Load tokens.css first. Semantic HTML and accessible names remain the product's responsibility. */
.bh-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6875rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--bh-radius-control);
  background: transparent;
  color: var(--bh-color-text-primary);
  font: 700 0.875rem/1.2 var(--bh-font-family-base);
  letter-spacing: 0.045em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.bh-button:focus-visible,
.bh-link:focus-visible,
.bh-input:focus-visible {
  outline: none;
  box-shadow: var(--bh-focus-ring);
}
.bh-button:disabled,
.bh-button[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.bh-button--primary { background: var(--bh-color-action-primary); color: var(--bh-color-ink-900); }
.bh-button--primary:hover { background: #CC7700; color: var(--bh-color-ink-900); }
.bh-button--secondary { background: var(--bh-color-action-secondary); color: var(--bh-color-ink-900); }
.bh-button--secondary:hover { background: var(--bh-color-action-secondary-hover); color: var(--bh-color-white); }
.bh-button--outline { border-color: var(--bh-color-action-secondary-hover); color: var(--bh-color-action-secondary-hover); }
.bh-button--outline:hover { background: var(--bh-color-action-secondary-hover); color: var(--bh-color-white); }
.bh-button--outline-submit { border-color: var(--bh-color-action-primary); color: var(--bh-color-ink-900); }
.bh-button--outline-submit:hover { background: var(--bh-color-action-primary); color: var(--bh-color-ink-900); }
.bh-button--quiet { color: var(--bh-color-action-secondary-hover); }
.bh-button--quiet:hover { background: #EAF6FC; }
.bh-button--flat { background: #EEEEEE; color: var(--bh-color-ink-900); }
.bh-button--flat:hover { background: #C1C1C1; color: var(--bh-color-ink-900); }
.bh-button--danger { background: var(--bh-color-red-600); color: var(--bh-color-white); }
.bh-button--danger:hover { background: #A0001E; }
.bh-button--inverse { border-color: var(--bh-color-white); color: var(--bh-color-white); }
.bh-button--inverse:hover { background: var(--bh-color-white); color: var(--bh-color-navy-900); }
.bh-button--small { min-height: 36px; padding: 0.5rem 0.8125rem; font-size: 0.75rem; }
.bh-button--large { min-height: 48px; padding: 0.875rem 1.25rem; font-size: 0.9375rem; }
.bh-button--icon { width: 44px; min-width: 44px; padding: 0.5rem; }
.bh-button--inverse:focus-visible { box-shadow: 0 0 0 3px #FFFFFF; }

.bh-link { color: var(--bh-color-action-secondary-hover); text-decoration: underline; text-underline-offset: 0.15em; }
.bh-link:hover { color: var(--bh-color-navy-900); }
.bh-link:visited, .bh-link[data-state="visited"] { color: var(--bh-color-purple-700); }
.bh-container { width: min(100% - 2rem, 75rem); margin-inline: auto; }
.bh-stack { display: flex; flex-direction: column; gap: var(--bh-space-4); }
.bh-grid { display: grid; gap: var(--bh-space-4); }
.bh-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bh-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 48rem) {
  .bh-grid--2, .bh-grid--3 { grid-template-columns: 1fr; }
}

.bh-field { display: grid; gap: 0.375rem; max-width: 32rem; }
.bh-label { color: var(--bh-color-text-primary); font: 700 0.875rem/1.4 var(--bh-font-family-base); }
.bh-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #AEBEC8;
  border-radius: var(--bh-radius-control);
  padding: 0.625rem 0.75rem;
  background: var(--bh-color-surface);
  color: var(--bh-color-text-primary);
  font: 400 1rem/1.4 var(--bh-font-family-base);
}
.bh-input::placeholder { color: var(--bh-color-text-secondary); }
.bh-input[aria-invalid="true"] { border-color: var(--bh-color-red-600); background: #FFF7F8; }
.bh-hint { margin: 0; color: var(--bh-color-text-secondary); font: 400 0.75rem/1.5 var(--bh-font-family-base); }
.bh-error { margin: 0; color: var(--bh-color-feedback-error-text); font: 700 0.75rem/1.5 var(--bh-font-family-base); }

.bh-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-left: 4px solid currentColor;
  border-radius: var(--bh-radius-control);
  font: 400 0.875rem/1.5 var(--bh-font-family-base);
}
.bh-alert__title { display: block; margin-bottom: 0.125rem; font-weight: 700; }
.bh-alert--success { background: var(--bh-color-feedback-success-bg); color: var(--bh-color-feedback-success-text); }
.bh-alert--warning { background: var(--bh-color-feedback-warning-bg); color: var(--bh-color-feedback-warning-text); }
.bh-alert--error { background: var(--bh-color-feedback-error-bg); color: var(--bh-color-feedback-error-text); }
.bh-alert--info { background: var(--bh-color-feedback-info-bg); color: var(--bh-color-feedback-info-text); }

.bh-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font: 700 0.6875rem/1.2 var(--bh-font-family-base);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bh-status--success { background: var(--bh-color-feedback-success-bg); color: var(--bh-color-feedback-success-text); }
.bh-status--warning { background: var(--bh-color-feedback-warning-bg); color: var(--bh-color-feedback-warning-text); }
.bh-status--error { background: var(--bh-color-feedback-error-bg); color: var(--bh-color-feedback-error-text); }
.bh-status--info { background: var(--bh-color-feedback-info-bg); color: var(--bh-color-feedback-info-text); }

.bh-table-wrap { width: 100%; overflow-x: auto; }
.bh-table { width: 100%; border-collapse: collapse; color: var(--bh-color-text-primary); font: 400 0.875rem/1.5 var(--bh-font-family-base); }
.bh-table th { background: #004F71; color: var(--bh-color-white); font-weight: 700; text-align: left; }
.bh-table th, .bh-table td { padding: 0.625rem 0.75rem; border: 1px solid #DCE6EC; }
.bh-table tbody tr:nth-child(even) { background: #F5F8FA; }

.bh-dialog {
  width: min(32rem, calc(100vw - 2rem));
  max-height: min(80vh, 40rem);
  overflow: auto;
  border: 1px solid var(--bh-color-border);
  border-radius: var(--bh-radius-card);
  padding: 1.5rem;
  color: var(--bh-color-text-primary);
  background: var(--bh-color-surface);
  box-shadow: var(--bh-shadow-card);
}
.bh-dialog::backdrop { background: rgba(0, 25, 45, 0.64); }
.bh-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.bh-dialog__title { margin: 0; color: var(--bh-color-navy-900); font: 700 1.25rem/1.25 var(--bh-font-family-base); }
.bh-dialog__close { min-width: 44px; min-height: 44px; border: 1px solid var(--bh-color-border); border-radius: var(--bh-radius-control); background: #fff; color: var(--bh-color-navy-900); cursor: pointer; }
.bh-dialog__close:focus-visible { outline: none; box-shadow: var(--bh-focus-ring); }

@media (prefers-reduced-motion: reduce) {
  .bh-button { transition: none; }
}
