/* Transformação chuva–vazão.
 *
 * Base compartilhada da família de hidrologia; aqui ficam apenas os seletores
 * de método e os quadros de comparação entre métodos.
 */
@import url("../shared/ep-hidrologia.css");
@import url("../shared/ep-como-usar.css");

.option-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}
.option-picker button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  text-align: left;
}
.option-picker button strong { font-size: 12px; font-weight: 500; letter-spacing: -0.01em; }
.option-picker button small { font-size: 10px; color: var(--muted); line-height: 1.3; }
.option-picker button:hover { border-color: var(--chart-blue-light); }
.option-picker button[aria-pressed="true"] {
  border-color: var(--navy);
  background: var(--navy);
  box-shadow: 0 4px 13px rgb(17 24 22 / 18%);
}
.option-picker button[aria-pressed="true"] strong { color: #fff; }
.option-picker button[aria-pressed="true"] small { color: #a8e3cf; }

.survey-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 12px; margin-top: 14px; }
.survey-head label { flex: 1 1 auto; min-width: 0; margin-top: 0; font-size: 12px; font-weight: 500; }
.survey-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; padding: 0 10px; }
.survey-columns span { color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.survey-status { margin: 7px 0 0; padding-left: 16px; font-size: 11px; line-height: 1.5; text-indent: -16px; }
.survey-status::before { display: inline-block; width: 12px; margin-right: 4px; text-indent: 0; }
.survey-status.is-ok { color: #2b6b57; }
.survey-status.is-ok::before { content: "✓"; }
.survey-status.is-error { color: #a3312a; }
.survey-status.is-error::before { content: "!"; font-weight: 700; }
.survey-status.is-warn { color: #8a6212; }
.survey-status.is-warn::before { content: "△"; }
.survey-status:empty { display: none; }

textarea {
  width: 100%;
  margin-top: 3px;
  padding: 9px 10px;
  border: 1px solid #c8d4dd;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
  resize: vertical;
}
textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(8 127 91 / 12%); outline: none; }

.identification {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
}
.identification summary { position: relative; padding: 13px 40px 13px 15px; color: var(--navy); font-size: 12px; font-weight: 600; }
.identification summary::after { content: "+"; position: absolute; top: 10px; right: 15px; color: var(--blue); font-size: 18px; font-weight: 400; }
.identification[open] summary::after { content: "−"; }
.identification .field-grid { padding: 0 15px 15px; }
.identification label { font-size: 11px; }
.identification input { width: 100%; margin-top: 5px; padding: 8px 10px; border: 1px solid #c8d4dd; border-radius: 8px; font-size: 12px; }

.state-table { margin-top: 12px; overflow: auto; max-height: 420px; border: 1px solid var(--line); border-radius: 11px; }
.state-table table { font-size: 11px; }
.state-table th, .state-table td { padding: 8px 11px; border-bottom: 1px solid var(--line); text-align: right; }
.state-table th:first-child, .state-table td:first-child { text-align: left; }
.state-table thead th { position: sticky; top: 0; background: #f4f7f6; color: var(--muted); font-size: 9.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.state-table tbody tr:last-child td { border-bottom: 0; }
.state-table tbody tr.is-peak td { background: #f2f9f6; font-weight: 550; }
.state-table tbody tr.is-current td { background: #eef4ff; font-weight: 550; }

.panel-intro { margin: 0 0 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.panel-intro strong { color: var(--ink); font-weight: 600; }
.figure-note { margin: 8px 0 0; color: var(--muted); font-family: Georgia, serif; font-size: 12px; line-height: 1.5; }

.quantities { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1px; margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.quantities > div { padding: 12px 14px; background: white; }
.quantities dt { color: var(--muted); font-size: 9.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.quantities dd { margin: 5px 0 0; font-size: 17px; font-weight: 500; }
.quantities dd small { margin-left: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }

@media (max-width: 1100px) {
  .option-picker { grid-template-columns: minmax(0, 1fr); }
}

/* Gráficos.
 *
 * O vocabulário visual vem do módulo de Blocos Alternados, que é a referência
 * canônica de gráfico do padrão EP: fundo de área de plotagem, grade pontilhada,
 * barras arredondadas, curva acumulada com pontos e emblema de pico. Aqui entram
 * só as peças que este produto acrescenta — a barra de perdas, o hidrograma e a
 * chamada de retardo.
 */
.device-canvas .rain-bar.loss { fill: #c3d0cb; }
.device-canvas .rain-bar { fill: var(--chart-blue-dark); }
.device-canvas .rain-bar.peak { fill: #0f6f52; }

.hydrograph-area { fill: var(--chart-blue-dark); opacity: .12; }
.hydrograph-line { fill: none; stroke: var(--chart-blue-dark); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.hydrograph-peak { fill: #fff; stroke: #c0392b; stroke-width: 2.6; }

.baseflow-line { stroke: #c98232; stroke-width: 1.4; stroke-dasharray: 7 5; }
.chart-label.baseflow-label { fill: #a26520; }

.lag-guide { stroke: var(--chart-blue-dark); stroke-width: 1; stroke-dasharray: 4 4; opacity: .55; }
.lag-guide.is-peak { stroke: #c0392b; }

.canvas-legend i.swatch-rain { background: var(--chart-blue-dark); border-color: var(--chart-blue-dark); }
.canvas-legend i.swatch-loss { background: #c3d0cb; border-color: #a9bab4; }
.canvas-legend i.swatch-cumulative { height: 3px; background: var(--chart-orange); border-color: var(--chart-orange); }
.canvas-legend i.swatch-flow { height: 3px; background: var(--chart-blue-dark); border-color: var(--chart-blue-dark); }
.canvas-legend i.swatch-base { height: 0; border: 0; border-top: 2px dashed #c98232; }

/* Origem do tempo de concentração: calculado ou informado. */
.tc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.tc-head > span { color: var(--navy); font-size: 12px; font-weight: 550; }
.tc-modes { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: #f3f6f5; }
.tc-modes button { padding: 4px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 600; }
.tc-modes button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* ALINHAMENTO DOS CAMPOS DA GRADE.
 *
 * O label era `display: block`, então o campo começava onde o texto acabasse:
 * "Garantia temporal pretendida" ocupa duas linhas, "Anos mínimos de série"
 * ocupa uma, e os dois campos da mesma linha saíam em alturas diferentes.
 *
 * Coluna flexível com o campo empurrado para o fim resolve sem depender de o
 * rótulo caber numa linha — que é uma condição que nenhum texto em português
 * respeita por muito tempo. O `:not(.checkbox)` preserva a caixa de marcação,
 * que é deitada de propósito. */
.field-grid label:not(.checkbox) { display: flex; flex-direction: column; gap: 5px; }
.field-grid label:not(.checkbox) > .input-with-unit,
.field-grid label:not(.checkbox) > input,
.field-grid label:not(.checkbox) > select,
.field-grid label:not(.checkbox) > textarea { margin-top: auto; }
