/* =====================================================
   Engineering Tool – Concrete Strength Calculator
   Mobile-First, Card UI (EN / BS Oriented)
   ===================================================== */

.engineering-tool {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.engineering-tool *,
.engineering-tool *::before,
.engineering-tool *::after {
  box-sizing: border-box;
}

/* =====================
   Card Layout
   ===================== */

.tool-card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.tool-card h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

/* =====================
   Form Fields
   ===================== */

.tool-row {
  margin-bottom: 1rem;
}

.tool-row label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.tool-row input,
.tool-row select {
  width: 100%;
  padding: 0.65rem 0.7rem;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid #d0d7de;
  background: #fff;
}

.tool-row input:focus,
.tool-row select:focus {
  outline: none;
  border-color: #1e73be;
  box-shadow: 0 0 0 2px rgba(30,115,190,0.15);
}

/* =====================
   Buttons
   ===================== */

.tool-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.engineering-tool button {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

.engineering-tool button:focus-visible {
  outline: 3px solid rgba(30,115,190,0.35);
}

/* Button variants */
.btn-primary {
  background: #1e73be;
  color: #fff;
}

.btn-primary:hover {
  background: #155a8a;
}

.btn-secondary {
  background: #f1f3f5;
  color: #333;
}

.btn-reset {
  background: #d32f2f;
  color: #fff;
}

.btn-reset:hover {
  background: #b71c1c;
}

/* =====================
   Result Cards
   ===================== */

.tool-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: #f8f9fa;
  border-left: 6px solid #999;
}

.tool-result p {
  margin: 0.35rem 0;
  font-size: 0.95rem;
}

/* Status (JS aligned) */
.tool-pass {
  border-left-color: #2e7d32;
  background: #f1f8f4;
}

.tool-marginal {
  border-left-color: #ed6c02;
  background: #fff6ee;
}

.tool-fail {
  border-left-color: #c62828;
  background: #fdecea;
}

/* Neutral projection */
.tool-projection {
  border-left-color: #1e73be;
  background: #eef4fb;
}

/* =====================
   Strength Bar
   ===================== */

.strength-bar {
  margin-top: 0.75rem;
}

.strength-bar-track {
  width: 100%;
  height: 10px;
  background: #e0e0e0;
  border-radius: 20px;
  overflow: hidden;
}

.strength-bar-fill {
  height: 100%;
  width: 0%;
  background: #6c757d;
  transition: width 0.4s ease, background 0.3s ease;
  border-radius: 20px;
}

/* Color zones */
.strength-60 { background: #ed6c02; }
.strength-70 { background: #f9a825; }
.strength-80 { background: #7cb342; }
.strength-90 { background: #43a047; }
.strength-100 { background: #2e7d32; }

/* =====================
   Notes / Warnings
   ===================== */

.tool-note,
.tool-warning {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #555;
}

.tool-warning {
  color: #b71c1c;
  font-weight: 600;
}

/* =====================
   Desktop Enhancement
   ===================== */

@media (min-width: 640px) {
  .tool-actions {
    flex-direction: row;
  }

  .engineering-tool button {
    width: auto;
    flex: 1;
  }
}

/* =========================
   MANUAL OVERRIDE STYLING
   ========================= */

.tool-manual-override {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  background: #fafafa;
}

.tool-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 10px;
}

.tool-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.tool-manual-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tool-manual-input input {
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 14px;
  transition: border 0.2s ease;
}

.tool-manual-input input:focus {
  outline: none;
  border-color: #0077cc;
}

.tool-manual-input input:disabled {
  background-color: #f2f2f2;
  color: #666;
  cursor: not-allowed;
}

.tool-manual-input small {
  font-size: 12px;
  color: #777;
}