/* =====================================================================
   Martyn's Law Self-Assessment – arx-website matching styling.
   Designed to layer on top of Bootstrap 5, using arx palette.
   ===================================================================== */

:root {
  --ml-primary:       #7cc576;   /* arx green */
  --ml-primary-dark:  #5fa459;
  --ml-primary-soft:  #e8f5e6;
  --ml-ink:           #2b2b2b;
  --ml-muted:         #6e6e6e;
  --ml-border:        #e2e4e1;
  --ml-oos-bg:        #fde6e6;
  --ml-oos-ink:       #8a1f1f;
  --ml-std-bg:        #e2f0ff;
  --ml-std-ink:       #0b3d7a;
  --ml-enh-bg:        #e6f4ea;
  --ml-enh-ink:       #145c30;
}

body.ml-body {
  font-family: "Open Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #555;
  background: #fafbf9;
  margin: 0;
  line-height: 1.55;
}

.ml-body h1, .ml-body h2, .ml-body h3, .ml-body h4 {
  font-family: "Montserrat", "Open Sans", sans-serif;
  color: var(--ml-ink);
  font-weight: 600;
}

.ml-top {
  background: #fff;
  border-bottom: 1px solid var(--ml-border);
  padding: .9rem 0;
}
.ml-top .ml-brand {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  color: var(--ml-ink);
  text-decoration: none;
  font-size: 1.05rem;
}
.ml-top .ml-brand .dot { color: var(--ml-primary); }
.ml-top nav a {
  color: var(--ml-muted);
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: .95rem;
}
.ml-top nav a:hover { color: var(--ml-primary); }

.ml-wrap { max-width: 860px; margin: 0 auto; padding: 2rem 1rem 4rem; }

.ml-card {
  background: #fff;
  border: 1px solid var(--ml-border);
  border-radius: 10px;
  padding: 1.75rem;
  margin: 1.25rem 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}

.ml-progress { margin-bottom: 1.5rem; }
.ml-progress-bar {
  background: var(--ml-border);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}
.ml-progress-bar > span {
  display: block;
  height: 100%;
  background: var(--ml-primary);
  transition: width .3s ease;
}
.ml-progress-text {
  font-size: .85rem;
  color: var(--ml-muted);
  margin-top: .35rem;
}

.ml-question {
  font-size: 1.35rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  color: var(--ml-ink);
  margin-bottom: .75rem;
}
.ml-help {
  color: var(--ml-muted);
  font-size: .95rem;
  margin-bottom: 1.25rem;
  padding: .75rem 1rem;
  background: var(--ml-primary-soft);
  border-left: 4px solid var(--ml-primary);
  border-radius: 4px;
}

.ml-choices { display: flex; flex-direction: column; gap: .75rem; margin: 1rem 0 1.5rem; }
.ml-choice {
  /* Behave as a full-width card whether rendered as <label> or <button>. */
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 1rem 1.15rem;
  border: 1px solid var(--ml-border);
  border-radius: 10px;
  background: #f7faf6;        /* very soft off-white with a hint of green */
  color: var(--ml-ink);
  font: inherit;
  font-weight: 400;
  line-height: 1.45;
  cursor: pointer;
  transition: all .15s ease;
  /* Reset the default iOS/Android button chrome so these aren't painted
     as system-blue buttons on mobile. */
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.ml-choice:hover,
.ml-choice:focus-visible { border-color: var(--ml-primary); background: #eef7ec; outline: none; }
.ml-choice input {
  position: absolute;
  opacity: 0;
}
.ml-choice.selected,
.ml-choice:has(input:checked) {
  border-color: var(--ml-primary);
  background: var(--ml-primary-soft);
  color: var(--ml-ink);
}
/* Title sits on its own line, bold, with a clear gap above the description. */
.ml-choice strong {
  display: block;
  margin: 0 0 .35rem 0;
  font-family: "Montserrat", "Open Sans", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ml-ink);
}
.ml-choice-desc {
  display: block;
  color: var(--ml-muted);
  font-weight: 400;
  font-size: .95rem;
}

.ml-nav { display: flex; justify-content: space-between; gap: .5rem; margin-top: 1rem; }

.btn-arx,
.ml-body .btn-primary {
  background: var(--ml-primary);
  border-color: var(--ml-primary);
  color: #fff;
  padding: .6rem 1.4rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  border: 2px solid var(--ml-primary);
  cursor: pointer;
}
.btn-arx:hover,
.ml-body .btn-primary:hover {
  background: var(--ml-primary-dark);
  border-color: var(--ml-primary-dark);
  color: #fff;
}
.btn-arx-outline {
  background: #fff;
  color: var(--ml-ink);
  border: 2px solid var(--ml-border);
  padding: .6rem 1.4rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}
.btn-arx-outline:hover { border-color: var(--ml-primary); color: var(--ml-primary); }

.ml-field { margin: 1rem 0; }
.ml-field label { display: block; font-weight: 600; color: var(--ml-ink); margin-bottom: .35rem; }
.ml-field input, .ml-field textarea, .ml-field select {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid #c9cdc6;
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
.ml-field input:focus, .ml-field textarea:focus {
  outline: 2px solid var(--ml-primary);
  border-color: var(--ml-primary);
}

.ml-result {
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  margin: 1.5rem 0;
  font-size: 1.05rem;
}
.ml-result h2 { margin-top: 0; }
.ml-result.oos { background: var(--ml-oos-bg); color: var(--ml-oos-ink); border-left: 6px solid #c62828; }
.ml-result.oos h2 { color: var(--ml-oos-ink); }
.ml-result.std { background: var(--ml-std-bg); color: var(--ml-std-ink); border-left: 6px solid #1565c0; }
.ml-result.std h2 { color: var(--ml-std-ink); }
.ml-result.enh { background: var(--ml-enh-bg); color: var(--ml-enh-ink); border-left: 6px solid #2e7d32; }
.ml-result.enh h2 { color: var(--ml-enh-ink); }

.ml-badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.ml-badge.oos { background: var(--ml-oos-bg); color: var(--ml-oos-ink); }
.ml-badge.std { background: var(--ml-std-bg); color: var(--ml-std-ink); }
.ml-badge.enh { background: var(--ml-enh-bg); color: var(--ml-enh-ink); }
.ml-badge.unk { background: #eee; color: #555; }

.ml-errors {
  background: var(--ml-oos-bg);
  color: var(--ml-oos-ink);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.ml-table { width: 100%; border-collapse: collapse; background: #fff; margin-top: 1rem; }
.ml-table th, .ml-table td { padding: .55rem .8rem; text-align: left; border-bottom: 1px solid var(--ml-border); vertical-align: middle; }
.ml-table th { background: #f3f6f1; color: var(--ml-ink); font-weight: 600; }
.ml-table td.ml-nowrap, .ml-table th.ml-nowrap { white-space: nowrap; }
.ml-table td.ml-num { font-variant-numeric: tabular-nums; color: var(--ml-muted); }

footer.ml-foot {
  color: var(--ml-muted);
  font-size: .85rem;
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--ml-border);
  background: #fff;
}
footer.ml-foot a { color: var(--ml-primary); }

/* ---------------------------------------------------------------------
   Info "i" icon next to a question, and the modal popup it opens.
   --------------------------------------------------------------------- */
.ml-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  margin-left: .4rem;
  padding: 0;
  vertical-align: middle;
  background: var(--ml-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: .9rem;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.ml-info-btn:hover { background: var(--ml-primary-dark); transform: scale(1.08); }
.ml-info-btn:focus { outline: 3px solid var(--ml-primary-soft); outline-offset: 1px; }

.ml-help-more {
  color: var(--ml-primary-dark);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.ml-help-more:hover { text-decoration: underline; }

.ml-modal[hidden] { display: none; }
.ml-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.ml-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 20, .55);
  backdrop-filter: blur(2px);
}
.ml-modal-dialog {
  position: relative;
  background: #fff;
  max-width: 640px;
  width: 100%;
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  padding: 1.75rem 1.75rem 1.25rem;
  border-top: 6px solid var(--ml-primary);
}
.ml-modal-close {
  position: absolute;
  top: .5rem;
  right: .75rem;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ml-muted);
  cursor: pointer;
  border-radius: 50%;
}
.ml-modal-close:hover { color: var(--ml-ink); background: #f1f3ef; }

.ml-modal-body h3 {
  font-family: "Montserrat", sans-serif;
  color: var(--ml-ink);
  margin: 0 0 .5rem;
}
.ml-modal-body p { color: #444; margin: .5rem 0; }
.ml-modal-body ul,
.ml-modal-body ol { color: #444; padding-left: 1.25rem; margin: .5rem 0 .75rem; }
.ml-modal-body li { margin-bottom: .25rem; }
.ml-modal-body blockquote {
  margin: .75rem 0;
  padding: .75rem 1rem;
  border-left: 4px solid var(--ml-primary);
  background: var(--ml-primary-soft);
  color: var(--ml-ink);
  border-radius: 0 6px 6px 0;
}
.ml-modal-body blockquote p { margin: .25rem 0; }
.ml-modal-body a { color: var(--ml-primary-dark); font-weight: 600; }

.ml-modal-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

body.ml-modal-open { overflow: hidden; }

/* Print stylesheet for the PDF report */
@media print {
  body.ml-body { background: #fff; }
  .ml-top, footer.ml-foot, .ml-no-print, .ml-modal, .ml-info-btn { display: none !important; }
  .ml-wrap { max-width: none; padding: 0; }
  .ml-card { border: none; box-shadow: none; padding: 0; }
}
