/* Styles for the onboarding form (templates/form.html).
   Readability restyle 2026-07: larger type scale, ≥44px touch targets,
   sticky section nav, responsive grids, zebra volume table. */
:root {
  --green:   #2d6a2d;
  --green2:  #245224;
  --green3:  #1b5e20;   /* badge text */
  --light:   #f4f7f4;
  --border:  #ccc;
  --border2: #d5ddd5;   /* section frame */
  --border3: #dbe4db;   /* inner cards */
  --input-b: #bbb;      /* input borders — darker for contrast */
  --hint:    #4f584f;   /* hint text — was #666, too light at small sizes */
  --red:     #c0392b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: system-ui, sans-serif; background: var(--light); color: #222; }

/* Header */
header { background: var(--green); color: white; padding: 1.6rem 2rem 1.4rem; }
header h1 { font-size: 1.55rem; font-weight: 650; letter-spacing: -0.01em; }
header p  { font-size: 0.95rem; opacity: 0.9; margin-top: 0.4rem;
            line-height: 1.5; max-width: 60ch; }

/* Sticky section nav (new — markup in §2 below) */
.section-nav { position: sticky; top: 0; z-index: 400; background: white;
               border-bottom: 1px solid var(--border3);
               box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.section-nav .nav-inner { max-width: 820px; margin: 0 auto; display: flex;
                          gap: 0.25rem; overflow-x: auto; padding: 0 1rem; }
.section-nav a { padding: 0.7rem 0.7rem; font-size: 0.85rem; font-weight: 600;
                 color: var(--green); text-decoration: none; white-space: nowrap;
                 border-bottom: 2px solid transparent; }
.section-nav a:hover { border-bottom-color: var(--green); }

main { max-width: 820px; margin: 2rem auto; padding: 0 1rem 4rem; }

/* Sections */
section { background: white; border: 1px solid var(--border2); border-radius: 10px;
          padding: 1.75rem 2rem; margin-bottom: 2rem; scroll-margin-top: 60px; }
section h2 { font-size: 1.15rem; font-weight: 650; color: var(--green2);
             border-bottom: 1px solid #e0e8e0; padding-bottom: 0.75rem;
             margin-bottom: 1.4rem; }
.section-note { font-size: 0.9rem; color: var(--hint); margin-bottom: 1.2rem;
                line-height: 1.55; max-width: 65ch; }

/* Fields */
.field { margin-bottom: 1.4rem; }
.field > label { display: block; font-size: 0.95rem; font-weight: 600;
                 margin-bottom: 0.45rem; }
.field > label .req { color: var(--red); }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="date"],
.field input[type="time"],
.field select,
.field textarea {
  width: 100%; padding: 0.65rem 0.8rem; border: 1px solid var(--input-b);
  border-radius: 6px; font-size: 1rem; background: white; }
.field textarea { min-height: 80px; resize: vertical; }
.field .hint { font-size: 0.85rem; color: var(--hint); margin-top: 0.4rem;
               line-height: 1.5; max-width: 65ch; }

/* Grids — auto-fit so rows collapse to one column on narrow screens */
.row  { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; }
.row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.1rem; }

/* Radio groups — bordered option cards, ≥44px touch targets */
.radio-group { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.1rem; }
.radio-group label { display: flex; align-items: center; gap: 0.5rem;
                     font-size: 0.95rem; font-weight: 500; cursor: pointer;
                     border: 1px solid var(--border); border-radius: 6px;
                     padding: 0.6rem 0.9rem; background: white; min-height: 44px; }
.radio-group label:hover { border-color: var(--green); background: #f7faf7; }
.radio-group input[type="radio"] { width: 1.05rem; height: 1.05rem; margin: 0;
                                   cursor: pointer; accent-color: var(--green); }

/* Conditional blocks */
.cond { display: none; }
.cond.on { display: block; }

/* Inline time pairs */
.time-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.time-pair .sublabel { font-size: 0.82rem; color: #556155;
                       margin-bottom: 0.25rem; display: block; }

/* Address type-ahead */
.addr-suggestions { display: none; position: absolute; left: 0; right: 0; top: 100%;
                    z-index: 20; margin: 0.2rem 0 0; padding: 0; list-style: none;
                    background: white; border: 1px solid var(--border); border-radius: 6px;
                    max-height: 260px; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.addr-suggestions .addr-item { padding: 0.6rem 0.8rem; cursor: pointer; font-size: 0.95rem; }
.addr-suggestions .addr-item:hover,
.addr-suggestions .addr-item.active { background: #f0f6f0; }
.addr-suggestions .addr-empty { padding: 0.6rem 0.8rem; color: #6b746b; font-size: 0.9rem; }

/* Field-level validation hints */
.fhint { font-size: 0.85rem; margin-top: 0.4rem; }
.fhint.ok  { color: #2d8a2d; }
.fhint.err { color: var(--red); }
.field-err { border-color: var(--red) !important; background: #fdecea; }

/* Partners */
.partner-header { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 5.5rem 1.75rem; gap: 0.6rem;
                  font-size: 0.82rem; font-weight: 600; color: #556155;
                  margin-bottom: 0.35rem; }
.partner-header span:last-child { text-align: center; }
.partner-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 5.5rem 1.75rem; gap: 0.6rem;
               margin-bottom: 0.6rem; align-items: center; }
.partner-row .signatory-cell { display: flex; justify-content: center; }
.partner-row .signatory-cell input[type="radio"] { width: 1.2rem; height: 1.2rem;
               cursor: pointer; accent-color: var(--green); }
.partner-remove { justify-self: center; background: none; border: none; color: var(--red);
                  cursor: pointer; font-size: 0.95rem; line-height: 1; padding: 0.2rem 0.3rem; }

/* Contacts */
.contact-block { border: 1px solid var(--border3); border-radius: 8px;
                 padding: 1rem 1.1rem; margin-bottom: 0.8rem;
                 background: #f9fbf9; position: relative; }
.contact-block h4 { font-size: 0.95rem; font-weight: 650; color: var(--green2);
                    margin-bottom: 0.8rem; }
/* Two-row contact layout (requires the form.js change in §3) */
.contact-grid-top    { display: grid;
                       grid-template-columns: minmax(110px, 0.6fr) minmax(200px, 1.6fr) minmax(150px, 1fr);
                       gap: 0.8rem; margin-bottom: 0.8rem; }
.contact-grid-2      { display: grid; grid-template-columns: 1fr 1fr;
                       gap: 0.8rem; margin-bottom: 0.8rem; }
.contact-grid-2:last-child { margin-bottom: 0; }
/* "at least one phone required" note under the signatory's phone pair */
.phone-req-note { font-size: 0.85rem; color: var(--hint); margin-top: 0.6rem; }
@media (max-width: 560px) { .contact-grid-top, .contact-grid-2 { grid-template-columns: 1fr; } }
/* Smaller labels inside contact/tank cards */
.contact-block .field, .tank-block .field { margin-bottom: 0; }
.contact-block .field > label, .tank-block .field > label { font-size: 0.85rem; }

.add-row-btn { display: inline-flex; align-items: center; gap: 0.35rem;
               background: none; border: 1px dashed #8a8; color: var(--green);
               padding: 0.55rem 1rem; border-radius: 6px; cursor: pointer;
               font-size: 0.9rem; font-weight: 600; margin-top: 0.2rem; min-height: 44px; }
.add-row-btn:hover { border-color: var(--green); background: #f0f6f0; }

/* Tank blocks */
.tank-block { border: 1px solid var(--border3); border-radius: 8px;
              padding: 1rem 1.1rem; margin-bottom: 0.8rem;
              background: #f9fbf9; position: relative; }
.tank-block h4 { font-size: 0.95rem; font-weight: 650; color: var(--green2);
                 margin-bottom: 0.8rem; }
.remove-btn { position: absolute; top: 0.7rem; right: 0.8rem;
              background: none; border: none; color: var(--red);
              cursor: pointer; font-size: 0.85rem; padding: 0.2rem 0.4rem; }

/* Monthly volumes — zebra rows, right-aligned numbers, stronger header */
table.months { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.months th { text-align: left; font-weight: 600; padding: 0.55rem 0.6rem;
                  background: #f0f5f0; border-bottom: 2px solid #c9d6c9;
                  color: var(--green2); }
table.months th:first-child { width: 150px; }
table.months td { padding: 0.4rem 0.6rem; border-bottom: 1px solid #e6ede6; }
table.months tbody tr:nth-child(even) { background: #f6faf6; }
table.months td label { font-weight: 600; }
table.months td input { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid #c4c4c4;
                        border-radius: 5px; font-size: 0.95rem; text-align: right; }

/* Submit */
.submit-btn { display: block; width: 100%; padding: 1rem;
              background: var(--green); color: white; border: none;
              border-radius: 8px; font-size: 1.1rem; font-weight: 650;
              cursor: pointer; margin-top: 1rem;
              box-shadow: 0 2px 6px rgba(45,106,45,0.25); }
.submit-btn:hover { background: var(--green2); }
.error-box { background: #fdecea; border: 1px solid #f5c6c6; border-radius: 6px;
             padding: 1rem; margin-bottom: 1.5rem; color: var(--red); }
hr.divider { border: none; border-top: 1px solid #e0e8e0; margin: 1.4rem 0; }

/* §1 Authorised-signatory badge + locked signatory name */
.sig-badge { display: inline-block; margin-left: 0.6rem; padding: 0.15rem 0.6rem;
             font-size: 0.78rem; font-weight: 600; color: var(--green3);
             background: #e8f5e9; border: 1px solid #a5d6a7;
             border-radius: 999px; vertical-align: middle; }
input.locked { background: #f4f4f4; color: #555; cursor: not-allowed; }

  /* DISABLED FEATURE: FSA lookup — autocomplete dropdown styles, turned off.
     Re-enable alongside the FSA field (form.html §3) and its JS.
  .fsa-wrap { position: relative; }
  .fsa-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: white;
    border: 1px solid #ccc; border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12); z-index: 200;
    max-height: 220px; overflow-y: auto; display: none; }
  .fsa-item { padding: 0.45rem 0.75rem; cursor: pointer; border-bottom: 1px solid #f0f0f0; }
  .fsa-item:last-child { border-bottom: none; }
  .fsa-item:hover { background: #f0f7f0; }
  .fsa-item .fi-name { font-size: 0.85rem; font-weight: 500; }
  .fsa-item .fi-loc  { font-size: 0.75rem; color: #888; }
  .fsa-status { font-size: 0.78rem; margin-top: 0.25rem; }
  .fsa-status .found { color: var(--green); } */
