/* ==========================================================================
   LitiGator CF7 Adapter — Intake Form Styles
   ==========================================================================
   Adapted from intake-form-styles.css for Contact Form 7.
   CF7 wraps forms in .wpcf7-form; our fields use .lg-* classes embedded
   directly in the CF7 template HTML.
   ========================================================================== */

/* ==========================================================================
   1. General Layout & Form Container
   ========================================================================== */
.entry-content {
    background-color: #f7f8fa;
    padding: 40px;
    border-radius: 8px;
    border: 1px solid #dde2e7;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    font-family: 'Lato', sans-serif;
}

.page-template-page-intake .entry-content {
    margin-bottom: 1.5em;
}

.wpcf7-form {
    background-color: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
    color: #333;
}

/* Dynamic Section Titles */
.section-info::before, .section-empl::before, .section-role::before,
.section-discrimination::before, .section-events::before, .section-conduct::before,
.section-evidence::before, .section-unemployment::before, .section-timeline::before,
.section-document::before, .section-witness::before, .section-what::before,
.section-medical::before {
    display: block;
    content: '';
    font-size: 20px;
    font-weight: 700;
    color: #3a506b;
    margin-top: 45px;
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 4px solid #007bff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-info::before { content: 'Your Information'; }
.section-empl::before { content: 'Employer Info'; }
.section-role::before { content: 'Your Role & Position'; }
.section-discrimination::before { content: 'Discrimination'; }
.section-events::before { content: "Employer's Actions"; }
.section-conduct::before { content: 'Workplace Environment'; }
.section-evidence::before { content: 'Supporting Evidence'; }
.section-unemployment::before { content: 'Post-Employment Status'; }
.section-timeline::before { content: 'Timeline of Events'; }
.section-document::before { content: 'Supporting Documents'; }
.section-witness::before { content: 'Witness Information'; }
.section-what::before { content: 'What Happened'; }
.section-medical::before { content: "Employer's Actions"; }

/* ==========================================================================
   2. Typography & Required Fields
   ========================================================================== */
.wpcf7-form label {
    color: #212529;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 15px;
    display: block;
}

.lg-required {
    color: #dc3545;
    font-weight: bold;
    font-size: 1.1em;
    margin-left: 3px;
}

/* ==========================================================================
   3. Multi-Step Navigation (Progress Bar & Breadcrumbs)
   ========================================================================== */
.lg-progress-bar {
    background-color: #e9ecef;
    border-radius: 20px;
    margin-bottom: 20px;
    height: 8px;
}

.lg-progress {
    background-color: #007bff;
    height: 8px;
    border-radius: 20px;
    transition: width 0.4s ease-in-out;
    width: 0;
}

.lg-breadcrumbs ol {
    display: flex;
    justify-content: space-around;
    padding: 0;
    margin: 0 0 35px 0;
    border-bottom: 1px solid #e9ecef;
    counter-reset: breadcrumb-counter;
    text-align: center;
    list-style: none;
}

.lg-breadcrumbs li {
    counter-increment: breadcrumb-counter;
    flex: 1;
    position: relative;
    padding-bottom: 15px;
}

.lg-breadcrumbs li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    padding: 5px 10px;
    line-height: 1.3;
}

.lg-breadcrumbs li a::before {
    content: 'Step ' counter(breadcrumb-counter);
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #868e96;
    margin-bottom: 4px;
}

/* Active step */
.lg-breadcrumbs li.active a,
.lg-breadcrumbs li.active a::before {
    color: #007bff;
}

.lg-breadcrumbs li.active a {
    border-bottom-color: #007bff;
}

/* Completed steps — checkmark */
.lg-breadcrumbs li.completed a::before {
    content: '\2714';
    color: #28a745;
    font-weight: bold;
}

/* Future steps — show step number */
.lg-breadcrumbs li:not(.active):not(.completed) a::before {
    content: 'Step ' counter(breadcrumb-counter);
    color: #868e96;
}

/* Hide breadcrumbs on intro page (handled by JS, but also CSS fallback) */
.lg-breadcrumbs li:first-child {
    display: none;
}

/* ==========================================================================
   4. Standard Form Inputs (Text, Select, Textarea)
   ========================================================================== */
.lg-input,
.wpcf7-form-control.lg-input {
    width: 100%;
    height: auto;
    padding: 10px 14px;
    background-color: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    color: #495057;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.lg-input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}

.lg-input::placeholder {
    color: #999;
}

select.lg-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 1.2em;
    padding-right: 40px;
}

textarea.lg-input {
    min-height: 100px;
    resize: vertical;
}

/* Error state */
.lg-error,
.wpcf7-not-valid {
    border-color: #dc3545 !important;
}

.wpcf7-not-valid-tip {
    color: #dc3545;
    font-size: 13px;
    margin-top: 4px;
}

/* ==========================================================================
   5. Card-Style Checkboxes
   ========================================================================== */
.lg-checkbox-grid .wpcf7-checkbox,
.lg-checkbox-grid .wpcf7-form-control.wpcf7-checkbox {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    padding: 0;
    margin: 10px 0;
}

.lg-checkbox-grid .wpcf7-list-item {
    position: relative;
    margin: 0 !important;
}

/* CF7 wraps checkbox INSIDE label: <label><input type="checkbox"><span class="wpcf7-list-item-label">Text</span></label>
   So we style the label directly and use :has() for checked state. */
.lg-checkbox-grid .wpcf7-list-item > label {
    display: block !important;
    position: relative;
    background-color: #ffffff;
    border: 2px solid #ced4da;
    border-radius: 8px;
    padding: 20px 20px 20px 55px;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin: 0;
}

.lg-checkbox-grid .wpcf7-list-item > label > input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 100% !important;
    height: 100% !important;
    left: 0;
    top: 0;
    cursor: pointer;
    margin: 0 !important;
    z-index: 2;
}

.lg-checkbox-grid .wpcf7-list-item > label::before {
    content: '' !important;
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 2px solid #adb5bd;
    border-radius: 4px;
    background-color: #fff;
    transition: all 0.2s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

.lg-checkbox-grid .wpcf7-list-item > label::after {
    content: '\2714' !important;
    position: absolute;
    left: 23px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    transform-origin: center;
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    transition: transform 0.2s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

.lg-checkbox-grid .wpcf7-list-item:hover > label {
    border-color: #80bdff;
}

/* Checked state — CF7 nests input inside label, so use :has() */
.lg-checkbox-grid .wpcf7-list-item > label:has(input[type="checkbox"]:checked) {
    background-color: #eaf5ff;
    border-color: #007bff;
    color: #004a99;
}

.lg-checkbox-grid .wpcf7-list-item > label:has(input[type="checkbox"]:checked)::before {
    background-color: #007bff;
    border-color: #007bff;
}

.lg-checkbox-grid .wpcf7-list-item > label:has(input[type="checkbox"]:checked)::after {
    transform: translateY(-50%) scale(1);
}

/* ==========================================================================
   6. Discrimination "Other" Input
   ========================================================================== */
.discrim-other {
    width: 95%;
    margin-top: -5px;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
    float: right;
}

.discrim-other + * {
    clear: both;
}

/* ==========================================================================
   7. Buttons (Next, Previous, Submit, Add)
   ========================================================================== */

/* Next button */
.lg-nav .lg-next {
    background-color: #007bff;
    color: #ffffff;
    border: 2px solid #007bff;
    border-radius: 6px;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.lg-nav .lg-next:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Previous button */
.lg-nav .lg-prev {
    display: inline-block;
    width: auto;
    padding: 12px 30px;
    background-color: transparent;
    color: #6c757d;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-family: inherit;
}

.lg-nav .lg-prev:hover {
    background-color: #f8f9fa;
    color: #212529;
    border-color: #6c757d;
}

/* Submit button */
.wpcf7-form .lg-submit,
.wpcf7-form input[type="submit"].wpcf7-submit {
    padding: 15px 30px;
    background-color: #28a745;
    color: #ffffff;
    border: 2px solid #28a745;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.25);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    font-family: inherit;
}

.wpcf7-form .lg-submit:hover,
.wpcf7-form input[type="submit"].wpcf7-submit:hover {
    background-color: #218838;
    border-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.35);
}

.wpcf7-form .lg-submit:active,
.wpcf7-form input[type="submit"].wpcf7-submit:active {
    transform: translateY(0);
}

/* Add Row button */
.lg-add-row {
    background-color: #28a745;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s ease;
    font-family: inherit;
}

.lg-add-row:hover {
    background-color: #218838;
}

/* Intro CTA button */
.lg-nav .lg-next.le-intro-btn {
    width: 100%;
    display: block;
    margin-top: 25px;
    padding: 15px 30px;
    background-color: #005A9C;
    color: #ffffff;
    border: 2px solid #005A9C;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(0, 90, 156, 0.3);
    border-radius: 4px;
}

.lg-nav .lg-next.le-intro-btn:hover {
    background-color: #004275;
    border-color: #004275;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 90, 156, 0.4);
}

/* Navigation container */
.lg-nav {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.lg-nav button,
.lg-nav .lg-prev,
.lg-nav .lg-next {
    display: inline-block !important;
    width: auto !important;
    flex: none;
}

.lg-nav .lg-prev {
    margin-right: auto;
}

/* Date / Approx inline layout */
.inline-date {
    display: inline-block;
    width: 65%;
    vertical-align: bottom;
}

.inline-approx {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    width: 31%;
    margin-left: 2%;
    vertical-align: bottom;
}

.inline-approx label {
    margin-bottom: 8px;
    text-align: right;
    width: 100%;
}

.inline-approx input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

/* ==========================================================================
   8. Repeater Fields
   ========================================================================== */
.lg-repeater-row {
    position: relative;
    background-color: #fdfdfd;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 30px;
    padding-top: 40px;
    margin-top: 15px;
    margin-bottom: 20px;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.04);
}

.lg-repeater-row legend {
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
    padding: 0 5px;
    margin-left: 10px;
}

.lg-remove-row {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background-color: transparent;
    border: none;
    color: #dc3545;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    padding: 5px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.lg-remove-row:hover {
    background-color: #f8f9fa;
}

/* ==========================================================================
   9. File Upload Fields
   ========================================================================== */
.wpcf7-form .lg-file-input input[type="file"],
.wpcf7-form input[type="file"] {
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
}

/* File description list */
.lg-file-list {
    margin-top: 10px;
}

.lg-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
}

.lg-file-name {
    font-weight: 600;
    color: #333;
    flex-shrink: 0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lg-file-size {
    color: #868e96;
    font-size: 13px;
    flex-shrink: 0;
}

.lg-file-desc {
    flex-grow: 1;
}

/* ==========================================================================
   10. Intake Form Review Page
   ========================================================================== */
.review-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    max-width: 1140px;
    margin: 2rem auto;
    padding: 2rem 3rem;
    color: #333;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.review-container h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #2c3e50;
    text-align: left;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.review-container p {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

/* ==========================================================================
   11. Pages — Hidden by Default
   ========================================================================== */
.lg-page {
    display: none;
}

.lg-page:first-child {
    display: block;
}

/* Hidden conditional fields */
.lg-conditional {
    display: none;
}

/* ==========================================================================
   12. CF7 Response Messages
   ========================================================================== */
.wpcf7-response-output {
    border: 1px solid #28a745 !important;
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output {
    border-color: #dc3545 !important;
    background: #f8d7da;
    color: #721c24;
}

.wpcf7 form.invalid .wpcf7-response-output {
    border-color: #ffc107 !important;
    background: #fff3cd;
    color: #856404;
}

/* Hide CF7's default spinner — our progress bar handles UX */
.wpcf7-spinner {
    display: none;
}

/* ==========================================================================
   13. Responsive Styles
   ========================================================================== */

/* --- Mobile & Tablet (up to 991px) --- */
@media (max-width: 991px) {
    .entry-content {
        padding: 20px;
    }

    .lg-breadcrumbs ol {
        border-bottom: none;
        margin-bottom: 25px;
    }

    .lg-breadcrumbs li:not(.active) {
        display: none;
    }

    .lg-breadcrumbs li.active {
        width: 100%;
        text-align: center;
        padding-bottom: 0;
    }

    .lg-breadcrumbs li.active a {
        flex-direction: column;
        border-bottom: none;
        font-size: 20px;
    }

    .lg-breadcrumbs li.active a::before {
        font-size: 14px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: #868e96;
        margin-bottom: 5px;
    }

    .lg-nav {
        gap: 12px;
    }
}

/* --- Small Mobile (up to 768px) --- */
@media (max-width: 768px) {
    .lg-breadcrumbs li a {
        font-size: 13px;
        padding: 5px;
    }

    .lg-breadcrumbs li a::before {
        font-size: 11px;
    }

    .review-container {
        padding: 1rem 1.5rem;
    }

    .lg-repeater-row {
        padding: 20px 15px;
        padding-top: 35px;
    }

    .lg-file-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .lg-file-name {
        max-width: 100%;
    }

    .lg-file-desc {
        width: 100%;
    }
}

/* --- Desktop (992px and up) --- */
@media (min-width: 992px) {
    .frm-100 { display: block; width: 100%; }
    .frm-75  { display: inline-block; width: 74.5%; vertical-align: top; }
    .frm-50  { display: inline-block; width: 49%; vertical-align: top; }
    .frm-33  { display: inline-block; width: 32.75%; vertical-align: top; }
    .frm-25  { display: inline-block; width: 24.5%; vertical-align: top; }

    .discrim-other {
        max-width: 47%;
        margin-top: -102px;
    }
}

@media (min-width: 1400px) {
    .discrim-other {
        max-width: 42.5%;
        margin: 0 auto;
        float: none;
    }
}
