/* Results Management App — Public Styles v2.0.0 */
/* Mobile-first, WCAG 2.2 accessible */

:root {
  --rma-primary:    #185FA5;
  --rma-primary-bg: #E6F1FB;
  --rma-success:    #0F6E56;
  --rma-error:      #A32D2D;
  --rma-gold:       #FAEEDA;
  --rma-gold-text:  #633806;
  --rma-silver:     #F1EFE8;
  --rma-silver-txt: #444441;
  --rma-bronze:     #FAECE7;
  --rma-bronze-txt: #712B13;
  --rma-border:     #D3D1C7;
  --rma-radius:     8px;
  --rma-radius-lg:  12px;
}

/* ── Wrap ─────────────────────────────────────────────────────────────── */
.rma-wrap { max-width: 800px; margin: 0 auto; font-size: 1rem; }

/* ── Form ─────────────────────────────────────────────────────────────── */
.rma-form {
  background: #fff;
  border: 1px solid var(--rma-border);
  border-radius: var(--rma-radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.rma-label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: .35rem;
  color: #444;
}

.rma-input {
  display: block;
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--rma-border);
  border-radius: var(--rma-radius);
  font-size: 1rem;
  margin-bottom: .75rem;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.rma-input:focus {
  outline: none;
  border-color: var(--rma-primary);
  box-shadow: 0 0 0 3px rgba(24,95,165,.2);
}
.rma-input--short { width: auto; max-width: 120px; display: inline-block; }

.rma-select {
  padding: .45rem .65rem;
  border: 1px solid var(--rma-border);
  border-radius: var(--rma-radius);
  font-size: .95rem;
  background: #fff;
  cursor: pointer;
}
.rma-select:focus {
  outline: none;
  border-color: var(--rma-primary);
  box-shadow: 0 0 0 3px rgba(24,95,165,.2);
}
.rma-select--xs { max-width: 90px; }

.rma-selects-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
}
.rma-select-wrap { display: flex; flex-direction: column; }

/* ── Radio group ──────────────────────────────────────────────────────── */
.rma-mode-group { border: none; padding: 0; margin: 0 0 1rem 0; }
.rma-radio-row  { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.rma-radio-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .95rem;
  cursor: pointer;
}
.rma-radio-label input[type=radio] { accent-color: var(--rma-primary); }

/* ── Button ───────────────────────────────────────────────────────────── */
.rma-btn {
  display: inline-block;
  padding: .6rem 1.75rem;
  background: var(--rma-primary);
  color: #fff;
  border: none;
  border-radius: var(--rma-radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, transform .1s;
  margin-top: .5rem;
}
.rma-btn:hover  { background: #0C447C; }
.rma-btn:active { transform: scale(.98); }
.rma-btn:focus  { outline: 3px solid rgba(24,95,165,.4); outline-offset: 2px; }

/* ── Notices ──────────────────────────────────────────────────────────── */
.rma-notice {
  padding: .85rem 1.1rem;
  border-radius: var(--rma-radius);
  font-size: .95rem;
  margin-bottom: 1rem;
  background: #F1EFE8;
  color: #444;
}
.rma-notice--error { background: #FCEBEB; color: var(--rma-error); }
.rma-notice--empty { background: #F1EFE8; color: #5F5E5A; }

/* ── Results table ────────────────────────────────────────────────────── */
.rma-result-count { font-size: .875rem; color: #888; margin-bottom: .5rem; }
.rma-table-wrap   { overflow-x: auto; border-radius: var(--rma-radius-lg); border: 1px solid var(--rma-border); }

.rma-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.rma-table th {
  background: #F1EFE8;
  font-weight: 500;
  text-align: left;
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--rma-border);
  white-space: nowrap;
}
.rma-table td {
  padding: .6rem .9rem;
  border-bottom: 1px solid #EBEBEB;
  vertical-align: middle;
}
.rma-table tr:last-child td { border-bottom: none; }
.rma-table tr:hover td      { background: #F8F8F6; }

/* ── Rank badges ──────────────────────────────────────────────────────── */
.rma-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 500;
  background: var(--rma-primary-bg);
  color: var(--rma-primary);
}
.rma-rank--gold   { background: var(--rma-gold);   color: var(--rma-gold-text); }
.rma-rank--silver { background: var(--rma-silver);  color: var(--rma-silver-txt); }
.rma-rank--bronze { background: var(--rma-bronze);  color: var(--rma-bronze-txt); }

/* ── Print button ─────────────────────────────────────────────────────── */
.rma-print-btn {
  background: none;
  border: 1px solid var(--rma-border);
  border-radius: var(--rma-radius);
  cursor: pointer;
  padding: .2rem .5rem;
  font-size: 1rem;
  transition: background .15s;
}
.rma-print-btn:hover { background: var(--rma-primary-bg); }

/* ── Calculator ───────────────────────────────────────────────────────── */
.rma-calc { padding: 1.5rem; background: #fff; border: 1px solid var(--rma-border); border-radius: var(--rma-radius-lg); }
.rma-calc-row      { margin-bottom: 1rem; }
.rma-input-group   { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; }
.rma-sep           { color: #888; font-size: .9rem; }
.rma-weight        { color: #888; font-size: .8rem; font-weight: 400; }

.rma-slider {
  width: 100%;
  accent-color: var(--rma-primary);
  margin: .5rem 0;
}

.rma-calc-result {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--rma-primary-bg);
  border-radius: var(--rma-radius-lg);
}
.rma-calc-total {
  font-size: 2.25rem;
  font-weight: 500;
  color: var(--rma-primary);
  margin-bottom: .75rem;
}
.rma-calc-label { font-size: .875rem; color: #555; margin-bottom: 0; }
.rma-calc-sub   { font-size: .875rem; color: #666; margin-top: .25rem; }
.rma-breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: .875rem;
  padding: .3rem 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.rma-breakdown-row:last-child { border-bottom: none; }

/* ── Stats ────────────────────────────────────────────────────────────── */
.rma-stats-title { font-size: 1.1rem; font-weight: 500; margin-bottom: 1rem; }
.rma-stats-total { font-size: .875rem; color: #666; margin-top: .75rem; }

/* ── Print stylesheet ─────────────────────────────────────────────────── */
@media print {
  .rma-form, .rma-btn, .rma-print-btn { display: none !important; }
  .rma-table-wrap { border: none; overflow: visible; }
  .rma-table th { background: #eee !important; }
}

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .rma-form { padding: 1rem; }
  .rma-selects-row { flex-direction: column; }
  .rma-table th, .rma-table td { padding: .5rem .6rem; font-size: .8rem; }
  .rma-calc-total { font-size: 1.75rem; }
}
