/* =====================================================================
   AI Forms Stylesheet — style2.css-inspired overrides for ai_*.jsp
   Scoped to .form-section so it only affects AI form content.
   Section header color driven by CSS variable --ai-section-bg
   (injected from getNarrativeBckGrndColor() in JSP, defaults to #98E8F5)
   ===================================================================== */

/* ── CSS VARIABLE DEFAULT ──────────────────────────────────────────── */
.form-section {
    --ai-section-bg: #98E8F5;          /* default = narrativeBckGrndColor */
    --ai-section-fg: #000;             /* text on section bg (dark on light) */
    --ai-label-bg: #e6e6e6;            /* label cell bg = 10% black (H1 gray) */
    --ai-border: 0.5pt solid #808080;  /* standard half-point gray rule */
    --ai-font: 'Myriad Pro', 'MyriadPro', Calibri, sans-serif;
}

/* ── BASE TYPOGRAPHY (style2.css body) ─────────────────────────────── */
.form-section {
    font-family: var(--ai-font);
    font-size: 9pt;
    line-height: 13pt;
    color: #000;
}

.form-section h1 {
    font-family: var(--ai-font);
    font-size: 24pt;
    font-weight: 400;
    letter-spacing: -0.3pt;
    line-height: 1.2;
    margin: 0;
    padding: 0;
}

/* ── SECTION HEADERS (replace .bg-black #000 with dynamic color) ──── */
.form-section .bg-black {
    background-color: var(--ai-section-bg) !important;
    color: var(--ai-section-fg) !important;
    font-size: 9pt;
    font-weight: 700;
    line-height: 13pt;
    padding: 3pt 4pt;
    text-transform: uppercase;
    letter-spacing: 0.3pt;
    border: none;
}

/* ── LABEL CELLS (replace .bg-secondary with light gray) ──────────── */
.form-section .bg-secondary {
    background-color: var(--ai-label-bg) !important;
    color: #000 !important;
    font-size: 9pt;
    font-weight: 700;
    line-height: 13pt;
    padding: 3pt 4pt;
}

/* ── TABLE FORMATTING ──────────────────────────────────────────────── */
.form-section .table {
    font-size: 8pt;
    line-height: 9pt;
    margin-bottom: 0;
    border-collapse: collapse;
}

.form-section .table-bordered {
    border: var(--ai-border);
}

.form-section .table-bordered > :not(caption) > * > * {
    border-width: 0.5pt;
    border-color: #808080;
    padding: 3pt 4pt 3.2pt 4pt;
    font-size: 9pt;
    line-height: 13pt;
}

.form-section .table-borderless > :not(caption) > * > * {
    padding: 3pt 4pt 3.2pt 4pt;
    font-size: 9pt;
    line-height: 13pt;
}

/* ── FORM INPUTS — transparent with underline only ─────────────────── */
.form-section .form-control {
    background: transparent;
    border: none;
    border-bottom: 0.5pt solid #808080;
    border-radius: 0;
    padding: 1px 2px;
    font-family: var(--ai-font);
    font-size: 9pt;
    line-height: 13pt;
    color: #000;
    box-shadow: none;
    height: auto;
    min-height: 0;
}

.form-section .form-control:focus {
    outline: none;
    box-shadow: none;
    border-color: #3a7bd5;
    background: transparent;
}

/* ── INPUT GROUPS — clean label styling ────────────────────────────── */
.form-section .input-group {
    display: flex;
    align-items: baseline;
    gap: 4pt;
}

.form-section .input-group-text {
    background: transparent;
    border: none;
    padding: 0;
    font-family: var(--ai-font);
    font-size: 9pt;
    font-weight: 700;
    line-height: 13pt;
    color: #000;
    white-space: nowrap;
    flex-shrink: 0;
}

.form-section .input-group > .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

/* ── TEXTAREAS ─────────────────────────────────────────────────────── */
.form-section textarea.form-control {
    background: #fff;
    border: 1px solid #aaa;
    border-radius: 0;
    padding: 3pt 4pt;
    line-height: 11pt;
    font-size: 9pt;
    resize: none;
    overflow: hidden;
    min-height: 24px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* ── CHECKBOXES & RADIOS — 12pt Wingdings style ───────────────────── */
.form-section .form-check-input {
    -webkit-appearance: none;
    appearance: none;
    width: 12pt;
    height: 12pt;
    margin: 0;
    border: 1.5px solid #333;
    border-radius: 0;
    background: #fff;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    flex-shrink: 0;
}

.form-section .form-check-input:checked {
    background: #fff;
    border-color: #333;
}

.form-section .form-check-input:checked::after {
    content: "\2713";
    display: block;
    position: absolute;
    top: -2px;
    left: 1.5px;
    font-size: 12pt;
    font-weight: 700;
    font-family: "Wingdings 2", "Wingdings", sans-serif;
    color: #000;
    line-height: 1;
}

.form-section .form-check-label {
    font-family: var(--ai-font);
    font-size: 9pt;
    font-weight: 700;
    line-height: 13pt;
    padding-left: 4pt;
}

.form-section .form-check-inline {
    margin-right: 8pt;
    align-items: center;
}

/* ── BOLD TEXT ──────────────────────────────────────────────────────── */
.form-section .font-weight-bold {
    font-weight: 700;
    font-family: var(--ai-font);
}

/* ── FOOTER ────────────────────────────────────────────────────────── */
.form-section footer,
.form-section + footer {
    font-family: var(--ai-font);
    font-size: 8pt;
    line-height: 11pt;
    margin-top: 4pt;
    padding-top: 4pt;
    border-top: 2pt solid #000;
}

/* ── SPACING OVERRIDES ─────────────────────────────────────────────── */
.form-section.mt-5 {
    margin-top: 0 !important;
}

.form-section .py-3 {
    padding-top: 6pt !important;
    padding-bottom: 6pt !important;
}

/* ── MISC ──────────────────────────────────────────────────────────── */
.form-section .border-end {
    border-right: var(--ai-border) !important;
}

.form-section .border-top {
    border-top: var(--ai-border) !important;
}

.form-section .border-bottom {
    border-bottom: var(--ai-border) !important;
}

.form-section img.img-fluid {
    max-width: 120px;
}
