/* The Tangivox receiver page on ezulabs' house theme (common/house.css): a document page, as the
   Tangivox support pages. This adds only what the flasher needs: the setup code field, the Install
   button's disabled state, the progress bar, the result box and the Details console. House
   variables throughout, so light and dark both follow house.css. */

/* Red text on paper, dark enough to read at small sizes (house.css's red is for marks). */
:root { --alert: color-mix(in srgb, var(--red) 75%, var(--ink)); }

/* .btn and the boxes set a display: hidden must still hide them. */
[hidden] { display: none !important; }

/* ---- the opening: the image's status sits where the documents' date does ---- */
.doc .image-status.bad { color: var(--alert); }
.doc .notice { margin: 1.5rem 0 0; }
.doc .notice strong { display: block; color: var(--alert); }
.doc .tldr ul { margin: 0; }
.doc .tldr li:last-child { margin-bottom: 0; }

/* house.css's steps (numbers on tape), in a document: no list indent, house spacing */
.doc .steps { padding-left: 0; }
.doc .steps li { margin-bottom: 1.1rem; }

/* ---- the setup code ---- */
.code-field { margin-top: 1.75rem; }
.code-field label { display: block; font: 600 1.1rem/1.2 var(--pixel); margin-bottom: .55rem; }
.code-field input { display: block; width: 100%; max-width: 24rem; padding: .75rem .9rem;
  font: 500 1.15rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 4px; box-shadow: inset 2px 2px 0 rgb(0 0 0 / .06); }
.code-field input::placeholder { color: var(--ink-soft); opacity: .55; }
.code-field input.bad { border-color: var(--red); }
.code-field input:disabled { opacity: .6; }
@media (max-width: 420px) { .code-field input { font-size: 1rem; letter-spacing: .03em; } }
.hint { min-height: 1.5em; margin: .45rem 0 0; font-size: .92rem; color: var(--ink-soft); }
.hint.bad { color: var(--alert); }
.fine { margin: .6rem 0 0; font-size: .88rem; color: var(--ink-soft); }

/* ---- the Install button: house .btn; full width on phones (house.css's .cta rule) ---- */
.doc .cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
button.btn { cursor: pointer; }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.btn:disabled:hover, .btn:disabled:active { transform: none; box-shadow: 4px 5px 0 var(--mat-shadow); }

/* ---- progress: a pixel bar; while there's no fraction, yellow blocks crawl along it ---- */
.progress { margin-top: 1.75rem; }
.progress-stage { font: 600 1.05rem/1.2 var(--pixel); margin: 0 0 .6rem; }
progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 1.1rem; overflow: hidden;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 3px; }
progress::-webkit-progress-bar { background: var(--paper); }
progress::-webkit-progress-value { background: var(--yellow); box-shadow: inset -2px 0 0 var(--ink); transition: width .2s; }
progress::-moz-progress-bar { background: var(--yellow); box-shadow: inset -2px 0 0 var(--ink); }
progress:indeterminate { background: repeating-linear-gradient(90deg, var(--yellow) 0 .75rem, transparent .75rem 1.5rem) var(--paper);
  animation: crawl .6s steps(3) infinite; }
progress:indeterminate::-webkit-progress-bar { background: transparent; }
progress:indeterminate::-moz-progress-bar { background: transparent; box-shadow: none; }
@keyframes crawl { to { background-position: 1.5rem 0; } }
@media (prefers-reduced-motion: reduce) { progress:indeterminate { animation: none; } }

/* ---- the result: a callout like .tldr, green when set up, red when not ---- */
.result { margin-top: 1.75rem; padding: 1.1rem 1.3rem; border-left: 4px solid var(--dash); }
.result.ok { border-left-color: var(--green-deep); background: color-mix(in srgb, var(--green) 24%, var(--paper-2)); }
.result.error { border-left-color: var(--red); background: color-mix(in srgb, var(--red) 9%, var(--paper-2)); }
@media (prefers-color-scheme: dark) {
  .result.ok { background: color-mix(in srgb, var(--green) 11%, var(--paper-2)); }
  .result.error { background: color-mix(in srgb, var(--red) 11%, var(--paper-2)); }
}
.doc .result h2 { font-size: clamp(1.2rem, 1.1rem + .5vw, 1.45rem); margin: 0 0 .55rem; }
.doc .result.ok h2::before { background: var(--green); }
.doc .result.error h2::before { background: var(--red); }
.result p { margin: 0; }
.result p + p { margin-top: .5rem; }
.result .mac { font: 500 .92rem/1.4 var(--mono); color: var(--ink-soft); overflow-wrap: anywhere; }
.result .btn { margin-top: 1rem; }

/* ---- Details: house.css's question list (.faq), opening on esptool-js's output ---- */
.doc .faq { margin-top: 2.5rem; }
.details pre { margin: 0 0 1.1rem; max-height: 16rem; min-height: 3rem; overflow: auto; padding: .8rem 1rem;
  font: 500 .8rem/1.55 var(--mono); color: #ebeae3; background: var(--code-bg); border-radius: 6px;
  white-space: pre-wrap; word-break: break-all; }

/* ---- footer: help, the credit, the company ---- */
.foot .wrap { gap: .55rem; }
