/* =========================================================
   FDI PORTAL FORM SECTIONS (Company Info, HMRC, etc.)
   ========================================================= */

section.panel form {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 10px;
}

/* Headings for each subsection */
section.panel h4 {
  font-size: 17px;
  font-weight: 700;
  color: #002d5c;
  margin-bottom: 6px;
  border-left: 4px solid #31a6d6;
  padding-left: 10px;
}

/* Label + Input layout */
section.panel label {
  display: block;
  font-size: 14px;
  color: #0f172a;
  font-weight: 500;
  margin-top: 4px;
}

section.panel input,
section.panel select,
section.panel textarea {
  width: 100%;
  font-size: 14px;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 4px;
  background-color: #f9fafc;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

section.panel input:focus,
section.panel select:focus,
section.panel textarea:focus {
  border-color: #4e8bda;
  outline: none;
  box-shadow: 0 0 0 3px rgba(78, 139, 218, 0.15);
}

/* Inline fields (short questions side-by-side) */
.inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.inline label {
  margin-top: 0;
  font-weight: 500;
}

/* File uploads */
.upload {
  margin-top: 6px;
}
.upload input[type="file"] {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px;
  background-color: #fff;
}
.upload.hidden {
  display: none;
}

.hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* Two-column layout for wide screens */
@media (min-width: 800px) {
  section.panel form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 24px;
  }
  section.panel h4 {
    grid-column: 1 / -1;
  }
  section.panel .actions-sticky {
    grid-column: 1 / -1;
  }
}

/* Narrow screens */
@media (max-width: 799px) {
  section.panel form {
    display: flex;
    flex-direction: column;
  }
}

/* General panel styling */
section.panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  padding: 32px;
}

/* Selects */
section.panel select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23002d5c' height='12' viewBox='0 0 20 20' width='12' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5H5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
}

/* Numeric inputs alignment */
section.panel input[type="number"] {
  text-align: right;
}


/* =========================================================
   FDI FORM SECTION GROUP ENHANCEMENTS v2
   ========================================================= */

/* Each logical group wrapper (around h4 + inputs) */
section.panel h4 {
  background: linear-gradient(to right, #f5f7fb, #e9edf5);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 15.5px;
  font-weight: 700;
  color: #002d5c;
  margin: 30px 0 12px;
  border-left: 4px solid #31a6d6;
  box-shadow: 0 2px 6px rgba(0, 45, 92, 0.05);
}

/* Subtle container gap between groups */
section.panel h4:first-of-type {
  margin-top: 0;
}
section.panel h4 + label,
section.panel h4 + .inline {
  margin-top: 10px;
}

/* Optional faint divider line between groups */
section.panel h4::after {
  content: "";
  display: block;
  height: 1px;
  background: #dfe4ec;
  margin-top: 10px;
}

/* Background band behind grouped fields */
section.panel label,
section.panel .inline,
section.panel .upload {
  background-color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
}

/* Add visual band separation every few groups */
section.panel h4:nth-of-type(odd) {
  background: linear-gradient(to right, #f7f9fc, #edf2fb);
}
section.panel h4:nth-of-type(even) {
  background: linear-gradient(to right, #f9fbfd, #f1f5fb);
}

/* Improve readability in 2-column layout */
@media (min-width: 800px) {
  section.panel form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 28px;
  }
  section.panel h4 {
    grid-column: 1 / -1;
  }
  section.panel .inline,
  section.panel label,
  section.panel .upload {
    grid-column: span 1;
  }
}

/* Add breathing space after the last field */
section.panel form > *:last-child {
  margin-bottom: 40px;
}


/* =========================================================
   FDI FORM SECTION HEADINGS (h4 + h5) AND GROUP ENHANCEMENTS
   ========================================================= */

/* Main section (e.g., Creditors, Company Info) */
section.panel h4 {
  background: linear-gradient(to right, #f5f7fb, #e9edf5);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 16.5px;
  font-weight: 700;
  color: #002d5c;
  margin: 36px 0 18px;
  border-left: 5px solid #31a6d6;
  box-shadow: 0 2px 6px rgba(0, 45, 92, 0.05);
}
section.panel h4:first-of-type { margin-top: 0; }

/* Subsection headings (e.g., Trade Creditors, Utilities, etc.) */
section.panel h5 {
  background: #f9fafc;
  border-left: 3px solid #4e8bda;
  border-radius: 4px;
  padding: 6px 12px;
  margin: 26px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #002d5c;
  letter-spacing: 0.1px;
}
section.panel h5:first-of-type {
  margin-top: 12px;
}

/* Descriptive prompts (info boxes) */
.prompt {
  background: #f7f8fa;
  border-left: 4px solid #31a6d6;
  padding: 0.6rem 0.9rem;
  margin: 0.5rem 0 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #0f172a;
}

/* Input containers */
section.panel label,
section.panel .inline,
section.panel .upload {
  background-color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
}

/* Alternate background tones for visual rhythm */
section.panel h4:nth-of-type(odd) {
  background: linear-gradient(to right, #f7f9fc, #edf2fb);
}
section.panel h4:nth-of-type(even) {
  background: linear-gradient(to right, #f9fbfd, #f1f5fb);
}

/* Consistent grid layout */
@media (min-width: 800px) {
  section.panel form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 28px;
  }
  section.panel h4,
  section.panel h5,
  section.panel .prompt {
    grid-column: 1 / -1;
  }
}

/* Clean spacing below last field */
section.panel form > *:last-child {
  margin-bottom: 50px;
}


/* =========================================================
   DIRECTORS / REPEATABLE CARD STYLING
   ========================================================= */

/* =========================================================
   DIRECTORS / REPEATABLE CARD STYLING — FIXED FULL-WIDTH
   ========================================================= */

/* Wrapper always full width inside panel */
#directors-wrapper {
  width: 100%;
  display: block;
  margin-top: 0.5rem;
}

/* Director card block */
.director-card {
  border: 1px solid #d8e0eb;
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 18px 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.director-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
}

/* Card contents */
.director-card label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  margin-top: 10px;
}
.director-card input,
.director-card select,
.director-card textarea {
  width: 100%;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 4px;
  font-size: 14px;
  background: #f9fafc;
}

/* Remove button */
.remove-director-btn {
  background: #e


/* =========================================================
   FIX: Directors form section should take full width
   ========================================================= */

/* Force the whole directors wrapper to span both grid columns */
#directors-wrapper,
#directors-wrapper .director-card,
#directors-wrapper + .actions {
  grid-column: 1 / -1 !important;
  width: 100% !important;
}

/* Ensure the panel form recognises directors wrapper as block */
section.panel form #directors-wrapper {
  display: block !important;
}

/* Make Add Director button left-aligned and full width if needed */
#directors-wrapper + .actions {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  margin-top: 10px;
}

/* Tidy up card appearance */
.director-card {
  border: 1px solid #d8e0eb;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin: 20px 0;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}
.director-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* Uniform inputs */
.director-card input,
.director-card select,
.director-card textarea {
  width: 100%;
  background: #f9fafc;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 4px;
  font-size: 14px;
}

/* Buttons */
.remove-director-btn {
  background: #e11d48;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
}
#add-director-btn {
  background: #002d5c;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.25s ease;
}
#add-director-btn:hover {
  background: #004a94;
}

/* =========================================================
   DIRECTORS SECTION — Full Width Responsive Design
   ========================================================= */

#directors-wrapper {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  display: block !important;
  margin-top: 0.5rem;
}

#directors-wrapper h4 {
  grid-column: 1 / -1;
  background: linear-gradient(to right, #f5f7fb, #e9edf5);
  border-left: 5px solid #31a6d6;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 700;
  color: #002d5c;
  margin-bottom: 16px;
}

/* Make each card full width and visually distinct */
.director-card {
  width: 100%;
  border: 1px solid #d8e0eb;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin: 18px 0;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.director-card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* Inputs inside cards */
.director-card input,
.director-card select,
.director-card textarea {
  width: 100%;
  border: 1px solid #d0d7e2;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 4px;
  font-size: 14px;
  background: #f9fafc;
}
.director-card label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  margin-top: 10px;
}

/* Remove button */
.remove-director-btn {
  background: #e11d48;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.remove-director-btn:hover {
  background: #b91c1c;
}

/* Add Director button — left aligned */
#add-director-btn {
  background: #002d5c;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
  display: inline-block;
  margin-top: 12px;
}
#add-director-btn:hover {
  background: #004a94;
  transform: translateY(-1px);
}

/* Keep add button aligned under cards */
#directors-wrapper + .actions {
  grid-column: 1 / -1 !important;
  display: flex;
  justify-content: flex-start;
  width: 100%;
  margin-top: 10px;
}

/* Muted and upload blocks */
.director-card .muted {
  color: #64748b;
  font-size: 13px;
  font-style: italic;
}
.director-card .upload {
  margin: 6px 0 12px 0;
}

/* Responsive behaviour */
@media (max-width: 799px) {
  #directors-wrapper,
  .director-card {
    width: 100%;
  }
}
/* =========================================================
   DIRECTORS PANEL — Force Full-Width Display
   ========================================================= */

/* Force wrapper and its children to span both grid columns */
#directors-wrapper,
#directors-wrapper .director-card,
#directors-wrapper + .actions {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Make sure the wrapper itself is treated as a block element */
section.panel form #directors-wrapper {
  display: block !important;
}

/* Let the Add button sit below all cards and stay left-aligned */
#directors-wrapper + .actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 12px;
  grid-column: 1 / -1 !important;
  width: 100%;
}

/* Ensure cards stretch fully */
.director-card {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d8e0eb;
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  margin: 20px 0;
  box-shadow
