/* Same design tokens as the public SSR site (TopEtc.Host/wwwroot/app.css): the logged-in
   area is a different render host, not a different product. */
:root {
  --ink: #16181d;
  --muted: #61666f;
  --line: #dfe2e8;
  --accent: #1d4ed8;
  --warn-bg: #fff6e5;
  --warn-line: #e0a800;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  color: var(--ink);
}

main { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .4rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 .3rem; }

a { color: var(--accent); }

.meta { color: var(--muted); font-size: .875rem; }

section { border-top: 1px solid var(--line); padding-top: .5rem; }

table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }

.estimate { font-size: 1.05rem; margin-bottom: .2rem; }
.estimate strong { font-size: 2rem; }
.interval { color: var(--muted); margin-left: .5rem; }

.warning {
  background: var(--warn-bg);
  border-left: 3px solid var(--warn-line);
  padding: .6rem .8rem;
  font-size: .9rem;
}

.status-message { padding: .6rem .8rem; border-radius: 4px; font-size: .9rem; margin-bottom: 1rem; }
.status-message.error { background: #fdecea; border-left: 3px solid #b00020; color: #7a0015; }
.status-message.success { background: #eaf7ec; border-left: 3px solid #1e7e34; color: #14532d; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.field select {
  padding: .5rem .6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  max-width: 24rem;
  width: 100%;
}

button.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: .6rem 1.2rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.primary:hover:not(:disabled) { opacity: .92; }
button.primary:disabled { background: var(--muted); cursor: not-allowed; }

/* The answer sheet. Mobile-first and tap-first: the peak is the night the answer key
   drops, on a phone, on 100 items (AGENTS.md §9 — friction here is the worst enemy). */
.sheet { list-style: none; padding: 0; margin: 0; }

.sheet-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem 0;
  border-bottom: 1px solid var(--line);
}

.item-number {
  width: 2.5rem;
  flex-shrink: 0;
  color: var(--muted);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

.choices { display: flex; gap: .35rem; flex-wrap: wrap; }

/* 2.75rem clears the ~44px minimum touch target on every mobile platform. */
.choice {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice.blank { font-weight: 400; color: var(--muted); }
.choice.blank.selected { background: var(--muted); border-color: var(--muted); color: #fff; }
.choice:disabled { opacity: .6; cursor: not-allowed; }

.sheet-progress {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: .75rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.block-heading { margin: 1.5rem 0 .3rem; font-size: 1rem; }
.block-heading .range { color: var(--muted); font-weight: 400; font-size: .85rem; }

#blazor-error-ui {
  color-scheme: light only;
  background: lightyellow;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

.loading-progress {
  position: absolute;
  display: block;
  width: 8rem;
  height: 8rem;
  inset: 20vh 0 auto 0;
  margin: 0 auto 0 auto;
}

.loading-progress circle {
  fill: none;
  stroke: #e0e0e0;
  stroke-width: 0.6rem;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
}

.loading-progress circle:last-child {
  stroke: var(--accent);
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
  transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
  position: absolute;
  text-align: center;
  font-weight: bold;
  inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
  content: var(--blazor-load-percentage-text, "Carregando");
}
