/* RECATOOLS — A1C to Average Glucose Converter (RT-MED-013)
 *
 * Result surfaces are LIGHT (#eef2ff / #fafaf9), matching the sibling
 * medical-clinical tools. The --rt-result-* tokens are for the NAVY result
 * boxes and must not be used here — see docs/contrast-conventions.md and
 * scripts/contrast-gate/check-contrast.cjs.
 */

.a1c-form { display: flex; flex-direction: column; gap: .9rem; }

.a1c-grid-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; }
.a1c-field { display: flex; flex-direction: column; gap: .3rem; }
.a1c-field label { font-size: .78rem; font-weight: 700; color: #1a1814; }
.a1c-field .a1c-sub { font-size: .7rem; color: #6b6760; }
.a1c-inline { display: flex; align-items: center; gap: .4rem; }
.a1c-field input {
    width: 100%; min-width: 0; padding: .55rem .7rem; font-size: 1rem; font-family: inherit;
    color: #1a1814; background: #fff; border: 1px solid #ebebeb; border-radius: 8px;
}
.a1c-field input:focus-visible { outline: 2px solid #4338ca; outline-offset: 1px; border-color: #c7d2fe; }
.a1c-unit { font-size: .8rem; color: #6b6760; white-space: nowrap; }

.a1c-error {
    padding: .7rem .9rem; font-size: .82rem; line-height: 1.6; color: #7f1d1d;
    background: #fef2f2; border: 1px solid #fecaca; border-left: 3px solid #dc2626; border-radius: 0 8px 8px 0;
}

#a1c-results { display: flex; flex-direction: column; gap: .9rem; }

/* The caveats sit ABOVE the result by design — an A1C that is simply wrong is
   more dangerous than no A1C, because it looks like data. */
.a1c-caveats {
    padding: .85rem 1rem; font-size: .82rem; line-height: 1.65; color: #78350f;
    background: #fef9c3; border: 1px solid #fde047; border-left: 4px solid #d97706; border-radius: 0 8px 8px 0;
}
.a1c-caveats strong { display: block; margin-bottom: .3rem; font-size: .88rem; color: #713f12; }
.a1c-caveats ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.a1c-caveats li { margin-bottom: .15rem; }

.a1c-headline { padding: 1rem 1.1rem; background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 12px; text-align: center; }
.a1c-headline-lbl { font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #4338ca; }
.a1c-headline-val { font-size: 2.4rem; font-weight: 800; font-family: 'IBM Plex Serif', serif; color: #312e81; line-height: 1.05; margin-top: .1rem; }
.a1c-headline-sub { font-size: .8rem; color: #475569; margin-top: .3rem; }

.a1c-band { padding: .75rem 1rem; font-size: .875rem; line-height: 1.6; color: #1a1814; background: #f8fafc; border-left: 3px solid #64748b; border-radius: 0 6px 6px 0; }
.a1c-band:empty { display: none; }
.a1c-band.is-normal { border-left-color: #16a34a; background: #f0fdf4; }
.a1c-band.is-warn { border-left-color: #d97706; background: #fffbeb; }
.a1c-band.is-high { border-left-color: #dc2626; background: #fef2f2; }

.a1c-confirm { padding: .7rem 1rem; font-size: .82rem; line-height: 1.6; color: #7f1d1d; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; }

.a1c-explain { padding: .95rem 1.1rem; background: #fafaf9; border: 1px solid #ebebeb; border-radius: 10px; }
.a1c-explain h3 { margin: 0 0 .5rem; font-size: .92rem; font-weight: 800; color: #1a1814; }
.a1c-explain p { margin: 0 0 .6rem; font-size: .82rem; line-height: 1.7; color: #1a1814; }
.a1c-explain p:last-child { margin-bottom: 0; }
.a1c-explain code { padding: .1rem .3rem; font-size: .78rem; background: #eef2ff; border-radius: 4px; color: #312e81; }

@media (max-width: 560px) {
    .a1c-headline-val { font-size: 1.9rem; }
}

.a1c-calc-btn {
    padding: .7rem 1.1rem; font-size: .95rem; font-weight: 700; font-family: inherit;
    color: #fff; background: #e8622a; border: 0; border-radius: 999px; cursor: pointer;
}
.a1c-calc-btn:hover { background: #d4551f; }
.a1c-calc-btn:focus-visible { outline: 2px solid #1a1814; outline-offset: 2px; }
