/* Etap M3 (FR-USR-005/006, WCAG AA):
   - Relative units throughout (rem/%/em), no fixed px widths, so the page reflows
     cleanly at 200% browser zoom without horizontal scrolling (WCAG 1.4.4/1.4.10).
   - Text color #1a1a1a on #ffffff and link color #0b4fa8 on #ffffff both exceed the
     4.5:1 minimum contrast ratio for normal text (WCAG 1.4.3).
   - :focus-visible is always drawn, never suppressed (WCAG 2.4.7) — every interactive
     element (links, buttons, form fields) gets the same visible outline.
   - No animation/motion, no color-only status indicators (status text always carries a
     plain-language label, never color alone — see Pages/Instrument/View.cshtml). */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&display=swap');

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  background-color: #f2f4f5;
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: -999rem;
  top: 0;
  background: #0b4fa8;
  color: #ffffff;
  padding: 0.75rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* Standard "screen-reader only" pattern — content stays in the accessibility tree
   (announced by assistive tech) but takes no visual space, unlike display:none which
   would remove it from both. */
.visually-hidden {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  padding: 0;
  margin: -0.0625rem;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: #0b4fa8;
}

a:visited {
  color: #5b3a9e;
}

:focus-visible {
  outline: 0.1875rem solid #005fcc;
  outline-offset: 0.125rem;
}

.site-header,
main,
.site-footer,
nav {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.site-header {
  padding-bottom: 0;
  padding-top: 1.5rem;
}

.site-brand {
  font-weight: 600;
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c757d;
}

h1 {
  font-size: 1.625rem;
  font-weight: 700;
  margin: 0.25rem 0 1rem 0;
  color: #1c1c1e;
}

h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: #6c757d;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.subhead {
  font-size: 0.9rem;
  color: #6c757d;
  margin: -0.5rem 0 1.5rem;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.5rem;
  padding: 0;
  margin: 0 auto 1rem auto;
  border-bottom: 0.0625rem solid #dde3df;
  padding-bottom: 1rem;
}

nav a {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: #495057;
  background: #eef1ef;
  border: 0.0625rem solid #dde3df;
  border-radius: 100px;
  padding: 0.35rem 0.85rem;
  display: inline-block;
}

nav a:hover,
nav a:focus-visible {
  background: #e3f0e9;
  color: #2f7d5a;
}

main {
  min-height: 40vh;
  background: #ffffff;
  border: 0.0625rem solid #e4e6e8;
  border-radius: 0.75rem;
  padding: 1.75rem 1.75rem 2rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 0.5rem 1.5rem rgba(20, 25, 30, 0.04);
}

.site-footer {
  border-top: none;
  color: #6c757d;
  font-size: 0.85rem;
  padding-top: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #adb5bd;
  font-weight: 600;
  padding: 0 0.5rem 0.5rem;
  border-bottom: 0.0625rem solid #e9ecef;
}

td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 0.0625rem solid #f1f3f5;
}

/* ---- instrument card (Pages/Instrument/View.cshtml) ---- */

.instrument-layout {
  display: grid;
  grid-template-columns: minmax(15rem, 18rem) 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 40rem) {
  .instrument-layout {
    grid-template-columns: 1fr;
  }
}

.instrument-card {
  background: #f4f7f5;
  border: 0.0625rem solid #dde3df;
  border-radius: 0.625rem;
  padding: 1.25rem 1.25rem 1.1rem;
}

.balance-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c757d;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.balance-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.85rem;
}

.balance-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 0.0625rem solid #e5eae7;
  font-size: 0.95rem;
}

.balance-list li:last-child {
  border-bottom: none;
}

.balance-list li span:last-child {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* When there's exactly one balance, present it as one large figure (matches the
   target mockup's single prominent amount) instead of a two-column row. */
.balance-list--single li {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  border-bottom: none;
  padding: 0 0 0.85rem;
}

.balance-list--single li span:first-child {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c757d;
  font-weight: 600;
}

.balance-list--single li span:last-child {
  font-size: 1.9rem;
  color: #1c1c1e;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
  padding: 0.6rem 0;
  border-top: 0.0625rem solid #dde3df;
}

.status-row:first-of-type {
  border-top: none;
}

.status-row .k {
  color: #6c757d;
}

.status-row .v {
  color: #212529;
  font-weight: 500;
  text-align: right;
}

.status-row .v.mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #e7eef8;
  color: #234a7c;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
}

.pill::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: currentColor;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.info-panel {
  padding-top: 0.25rem;
}

.info-panel p {
  color: #343a40;
}

/* ---- shared components (used across all Instrument pages) ---- */

.status-box {
  background: #f4f7f5;
  border: 0.0625rem solid #dde3df;
  border-radius: 0.625rem;
  padding: 1.25rem;
  margin: 1rem 0;
}

.status-box p {
  margin: 0.4rem 0;
}

.alert {
  border-radius: 0.5rem;
  padding: 1rem 1.1rem;
  margin: 1rem 0;
  border: 0.0625rem solid;
}

.alert-error {
  background-color: #fceeee;
  border-color: #e0a3a3;
  color: #a4342c;
}

.alert-success {
  background-color: #e3f0e9;
  border-color: #b7d9c8;
  color: #2f7d5a;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

textarea,
input[type="text"] {
  width: 100%;
  font: inherit;
  padding: 0.5rem;
  border: 0.0625rem solid #666666;
  border-radius: 0.25rem;
}

button,
.button,
.btn {
  font: inherit;
  padding: 0.6rem 1.1rem;
  border-radius: 0.5rem;
  border: 0.0625rem solid #0b4fa8;
  background-color: #0b4fa8;
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-block;
  text-align: center;
}

button.secondary,
.button.secondary,
.btn.neutral {
  background-color: #eef1ef;
  color: #495057;
  border-color: #dde3df;
}

.btn.danger {
  background-color: #fceeee;
  color: #a4342c;
  border-color: #e0a3a3;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
