/* =============================================================================
   forms.css  —  Endeavos Online SOW
   Step 1 and Step 2 form cards: inputs, textareas, segmented controls,
   analysis type list, help panel, file upload zones.
============================================================================= */

/* ── Form overlay — scrollable area behind steps 1-2 ─────────────────────── */
#form-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  background: radial-gradient(1200px 500px at 80% -10%, #fff 0%, transparent 60%), var(--bg);
  padding: 14px 20px 40px 256px;
}
#form-overlay::-webkit-scrollbar { width: 6px; }
#form-overlay::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}

/* ── Card container ───────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}
.card-body { padding: 24px; }

/* ── Form fields ──────────────────────────────────────────────────────────── */
.field { margin-bottom: 20px; }
.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}
.nda { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 16px; }
.nda a { color: var(--orange); }

textarea,
input[type=text],
input[type=number] {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  resize: vertical;
  transition: .15s;
}
textarea:focus,
input[type=text]:focus,
input[type=number]:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}
textarea::placeholder,
input::placeholder { color: var(--c-muted); font-style: italic; font-size: var(--t-ph); font-weight: var(--w-body); }

/* ── File upload boxes ────────────────────────────────────────────────────── */
.file-row { display: flex; gap: 20px; flex-wrap: wrap; }
.file-cell { flex: 1; min-width: 240px; }
.filebox {
  border: 1.5px dashed var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: .15s;
  background: #fcfcfd;
}
.filebox:hover { border-color: var(--orange); color: var(--orange); }
.filebox span.fn { color: var(--ink); font-weight: 500; }

/* ── Segmented project-type control ──────────────────────────────────────── */
.seg-wrap  { display: flex; justify-content: center; width: 100%; }
.seg {
  display: flex;
  border: 1.5px solid var(--line-strong);
  border-radius: 9px;
  overflow: hidden;
  max-width: 620px;
  width: 100%;
}
.seg label {
  flex: 1;
  padding: 14px 20px;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: .15s;
  border-right: 1.5px solid var(--line);
  font-weight: 500;
}
.seg label:last-child { border-right: none; }
.seg input {
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-content: center;
  flex: none;
}
.seg input:checked { border-color: var(--orange); }
.seg input:checked::after {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
}
.seg label:has(input:checked) { background: var(--orange-soft); font-weight: 600; }

/* ── Two-column layouts ───────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.layout2 { display: grid; grid-template-columns: 1.2fr .9fr; gap: 24px; }

/* ── Analysis type rows ───────────────────────────────────────────────────── */
.atype {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 4px;
  margin-bottom: 6px;
}
.arow {
  padding: 11px 14px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
  transition: .12s;
}
.arow:hover { background: var(--bg); }
.arow input {
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-content: center;
  flex: none;
}
.arow input:checked { border-color: var(--orange); }
.arow input:checked::after {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
}
.arow label { font-size: 14px; font-weight: 600; cursor: pointer; }
.arow:has(input:checked) { background: var(--orange-soft); }

/* Sub-options panel (expands when analysis type is selected) */
.suboptions {
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
  padding: 0 14px 0 41px;
}
.suboptions.open { max-height: 340px; padding-bottom: 12px; }
.subgrid { display: flex; flex-direction: column; gap: 9px; padding-top: 4px; }
.subchk {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.subchk input {
  appearance: none;
  width: 15px; height: 15px;
  border: 1.4px solid var(--line-strong);
  border-radius: 4px;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.subchk input:checked { background: var(--orange); border-color: var(--orange); }
.subchk input:checked::after {
  content: "";
  width: 8px; height: 4px;
  border: 2px solid #fff;
  border-top: 0; border-right: 0;
  transform: rotate(-45deg) translateY(-1px);
}

/* Nested sub-options (e.g. Large Deformation → Non-Linear Buckling) */
.nest {
  padding-left: 24px;
  border-left: 2px solid var(--line);
  margin-left: 6px;
  display: none;
  flex-direction: column;
  gap: 9px;
  margin-top: 2px;
}
.nest.open { display: flex; }

/* ── Help / preview panel (right of analysis type list) ──────────────────── */
.help { position: sticky; top: 20px; align-self: start; }
.help-inner { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.help-img {
  height: 170px;
  background: linear-gradient(135deg,#2b3a67 0%,#3d6cb9 30%,#27a572 55%,#e8c33a 75%,#e8741e 92%,#c0392b 100%);
  display: grid;
  place-content: center;
}
.help-img .badge {
  font-family: "Archivo";
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,.28);
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: .04em;
}
.help-txt { padding: 16px 18px; }
.help-txt h4 { font-family: "Archivo"; margin: 0 0 7px; font-size: 15px; color: var(--ink); }
.help-txt p  { margin: 0; font-size: 13px; color: var(--ink-soft); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media(max-width: 820px) {
  .layout2 { grid-template-columns: 1fr; }
  .two-col  { grid-template-columns: 1fr; }
}
