/* Shared component styles: buttons, banners (ui/banner.js) and the
 * modal box. The rest of the starter library (toasts, KPI cards,
 * progress bars, skeletons, empty states, pills, the debt domino and
 * the data table) was never used by this app and was removed with
 * components.js and datatable.js; git history has it.
 */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--touch-target);
  padding: 0 var(--space-4);
  background: var(--color-info);
  color: var(--color-neutral-0);
  border: 1px solid var(--color-info);
  border-radius: var(--radius-md);
  font: var(--font-weight-medium) var(--font-size-base)/1 var(--font-family-sans);
  cursor: pointer;
  transition: background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}
.btn:hover   { background: #1d4ed8; }
.btn:active  { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn--ghost {
  background: transparent; color: var(--text-primary);
  border-color: var(--surface-border);
}
.btn--ghost:hover { background: var(--surface-muted); }
.btn--danger {
  background: var(--color-danger); border-color: var(--color-danger);
}
.btn--danger:hover { background: #991b1b; }

.banner {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  margin: var(--space-3) 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
}
.banner--info    { background: var(--color-info-bg);    border-color: var(--color-info-border);    color: var(--color-info); }
.banner--success { background: var(--color-success-bg); border-color: var(--color-success-border); color: var(--color-success); }
.banner--warn    { background: var(--color-warn-bg);    border-color: var(--color-warn-border);    color: var(--color-warn); }
.banner--danger  { background: var(--color-danger-bg);  border-color: var(--color-danger-border);  color: var(--color-danger); }
.banner__title   { font-weight: var(--font-weight-semi); margin: 0 0 var(--space-1); }
.banner__body    { margin: 0; color: var(--text-primary); }
.banner__list    { margin: var(--space-2) 0 0 var(--space-4); padding: 0; font-family: var(--font-family-mono); font-size: var(--font-size-xs); }

/* Modal box. The goals app sizes its own dialog in lib/goals/styles.css
 * (.modal, width 400px), which overrides the width here; the height
 * cap and scrolling here still apply to it.
 * A column: the title and the buttons stay put and only the body
 * scrolls, so Close / Next / Save are always on screen. */
.modal {
  display: flex; flex-direction: column;
  background: var(--surface-card); color: var(--text-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  max-width: 520px; width: 100%;
  max-height: calc(100vh - var(--space-8));
  /* The visible height: dvh follows the browser's toolbars showing and
     hiding, and (with the pages' interactive-widget=resizes-content)
     the keyboard on Android. On iOS the keyboard doesn't resize the
     page; modal.js scrolls the focused field into view instead. */
  max-height: calc(100dvh - var(--space-8));
  overflow: hidden;
}
.modal > h3, .modal-btns { flex: none; }
/* The scroller. The few pixels of padding (taken back by the margin)
 * keep a field's focus ring, a box-shadow, from being cut off at its
 * edges. */
.modal-body {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 3px; margin: -3px;
}
