@import url("../prototype/styles.css");
@import url("../shared/ep-como-usar.css");

[hidden] { display: none !important; }

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.hero {
  padding-top: 38px;
  padding-bottom: 56px;
}

.hero h1 {
  max-width: 980px;
  font-size: clamp(30px, 3.55vw, 48px);
  line-height: 1.08;
}

.hero > div > p:not(.eyebrow) {
  max-width: 760px;
  font-size: 15px;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.account-link {
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.workspace {
  grid-template-columns: minmax(330px, 400px) minmax(0, 1fr) !important;
  align-items: start;
}

.input-panel {
  align-self: start;
}

.results-panel {
  min-width: 0;
}

.product-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: min(1420px, calc(100% - 48px));
  margin: -30px auto 60px;
}

.product-picker a {
  display: grid;
  gap: 10px;
  min-height: 210px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
}

.product-picker span,
.calculation-state {
  display: inline-flex;
  width: max-content;
  align-items: center;
  border-radius: 999px;
  background: #eef8f4;
  color: var(--blue);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .08em;
}

.product-picker span { padding: 6px 9px; }
.product-picker strong { color: var(--navy); font-size: 19px; line-height: 1.12; }
.product-picker small { color: var(--muted); font-size: 12px; line-height: 1.55; }

.calculation-state {
  padding: 8px 12px;
  border: 1px solid #b9d9ce;
  white-space: nowrap;
}

.calculation-state.failed {
  border-color: #efb8b8;
  background: #fff1f1;
  color: #9a2525;
}

.drawing-card {
  margin-top: 14px;
  box-shadow: inset 0 4px 0 var(--chart-blue-dark);
}

.result-cards {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.result-card {
  min-height: 92px;
  padding: 17px 18px;
}

.result-card > span {
  overflow: hidden;
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-card strong {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 12px;
  color: white;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: .98;
  white-space: nowrap;
}

.result-card.featured strong {
  color: #67d5af;
}

.result-card strong small {
  flex: 0 0 auto;
  margin-left: 0;
  color: #c8d8d3;
  font-size: 10px;
  letter-spacing: 0;
}

#tool-drawing {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 297 / 140;
  margin-top: 15px;
  border: 1px solid #d7e1dd;
  border-radius: 8px;
  background:
    radial-gradient(circle, rgb(8 127 91 / 9%) 1px, transparent 1.4px) 0 0 / 28px 28px,
    #fbfcfc;
}

#tool-drawing text {
  font-family: var(--ep-fonte);
  font-weight: 300;
}

.column-shape {
  fill: #edf4f1;
  stroke: #101715;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.column-axis {
  stroke: #cbd8d3;
  stroke-width: 1.1;
  stroke-dasharray: 5 6;
  vector-effect: non-scaling-stroke;
}

.section-bar {
  fill: #e5484d;
  stroke: white;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.tie-line {
  fill: none;
  stroke: #101715;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.cross-tie {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.longitudinal-elevation {
  stroke: #e5484d;
  stroke-width: 1.9;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.stirrup-elevation {
  stroke: #101715;
  stroke-width: 1.8;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.demand-line {
  stroke: #087f5b;
  stroke-width: 2.3;
  fill: none;
  marker-end: url(#arrow-green);
  vector-effect: non-scaling-stroke;
}

.moment-line {
  stroke: #2563eb;
  stroke-width: 2.3;
  fill: none;
  marker-end: url(#arrow-blue);
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.x-moment {
  stroke: #e5484d;
  marker-end: url(#arrow-red);
}

.drawing-label {
  fill: var(--navy);
  font-size: 10px;
  font-weight: 600 !important;
}

.drawing-note {
  fill: var(--muted);
  font-size: 8px;
}

.green-note {
  fill: var(--blue);
  font-size: 8px;
  font-weight: 650 !important;
  letter-spacing: .08em;
}

.support-line {
  stroke: #26332f;
  stroke-width: 1.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.support-fill {
  fill: white;
  stroke: #26332f;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.chart-frame {
  fill: rgb(255 255 255 / 78%);
  stroke: #d4dfdb;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-grid {
  stroke: #e2ebe7;
  stroke-width: .8;
  vector-effect: non-scaling-stroke;
}

.chart-axis {
  stroke: #9aaba4;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.chart-capacity {
  fill: rgb(22 164 118 / 13%);
  stroke: #087f5b;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.chart-demand {
  stroke: #e5484d;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
  vector-effect: non-scaling-stroke;
}

.chart-demand-point {
  fill: #e5484d;
  stroke: white;
  stroke-width: 1.3;
  vector-effect: non-scaling-stroke;
}

.dimension-line {
  fill: none;
  stroke: #98aaa4;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.drawing-panel-label {
  fill: var(--blue);
  font-size: 8px;
  font-weight: 650 !important;
  letter-spacing: .1em;
}

.verification-section {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.verification-board {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.check-row {
  display: grid;
  grid-template-columns: 18px minmax(120px, 1.1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.check-row.failed {
  border-color: #e8c0c0;
  background: #fff8f8;
}

.check-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chart-blue-dark);
  box-shadow: 0 0 0 4px #e7f7f1;
}

.failed .check-dot {
  background: #b42a2a;
  box-shadow: 0 0 0 4px #ffe7e7;
}

.check-row strong { color: var(--navy); font-size: 11px; }
.check-row span, .check-row small { color: var(--muted); font-size: 10px; }
.check-row b { color: var(--blue); font-size: 10px; white-space: nowrap; }
.failed b { color: #b42a2a; }

.specific-output {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.info-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.info-card h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 13px;
}

.info-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.memory-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.memory-actions .primary-button {
  width: auto;
  margin: 0;
  padding: 0 15px;
}

.memory-preview {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.62;
}

.memory-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.memory-table th,
.memory-table td {
  border: 1px solid #d8e1e7;
  padding: 7px 9px;
  color: #34443f;
  font-size: 9px;
  text-align: center;
}

.memory-table th {
  background: #f1f8f5;
  color: var(--blue);
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.result-card.textual strong {
  font-size: clamp(16px, 1.65vw, 23px);
  line-height: 1.1;
  white-space: normal;
}

.result-card.textual strong {
  display: block;
}

.result-card.textual strong small {
  margin-left: 4px;
}

@media (max-width: 1180px) {
  .result-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .hero, .workspace, .product-picker { width: auto; }
  .hero { grid-template-columns: 1fr; padding-inline: 24px; }
  .method-summary { grid-template-columns: 1fr; }
  .method-summary > div + div { border-left: 0; border-top: 1px solid rgb(255 255 255 / 15%); }
  .workspace { grid-template-columns: 1fr !important; margin-inline: 24px; }
  .product-picker { grid-template-columns: 1fr; margin-inline: 24px; }
  .specific-output, .result-cards { grid-template-columns: 1fr; }
  .check-row { grid-template-columns: 18px 1fr; }
  .check-row b { grid-column: 2; }
}

@media (max-width: 680px) {
  .field-grid { grid-template-columns: 1fr; }
  .memory-toolbar, .results-heading, .panel-heading { flex-direction: column; }
}

/* 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; }
