/**
 * ==========================================================================
 * Standardized Forms Framework - Ville de Rivière-du-Loup
 * Clean, Modern & Institutional Form Design Concept
 * ==========================================================================
 */

:root {
    --c-primary: #1b4332;
    --c-accent: #7ebc5a;
    --c-border: #e2e8f0;
    --c-bg-card: #ffffff;

    --form-primary: #0f172a;
    --form-primary-hover: #1b4332;
    --form-accent: #7ebc5a;
    --form-accent-light: rgba(126, 188, 90, 0.12);
    --form-bg-page: #f8fafc;
    --form-card-bg: #ffffff;
    --form-border: #e2e8f0;
    --form-border-focus: #7ebc5a;
    --form-text: #0f172a;
    --form-text-muted: #64748b;
    --form-text-light: #94a3b8;
    --form-radius-sm: 8px;
    --form-radius-md: 12px;
    --form-radius-lg: 16px;
    --form-shadow-card: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --form-shadow-section: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
}

/* ==========================================================================
   Base Container & Header (Matching rebuts.php)
   ========================================================================== */
.form-standard-wrapper,
.collecte-modern-ui,
form[service],
form[id^="form"] {
    max-width: 1000px !important;
    margin: 40px auto 60px auto !important;
    padding: 0 15px;
    box-sizing: border-box !important;
    font-family: 'Segoe UI', Roboto, 'Inter', sans-serif !important;
}

/* Universal Page Titles (all forms - Matching rebuts.php collecte-header) */
.form-standard-header,
.collecte-header,
form[service] .middle.text-center,
form[id^="form"]>div:first-of-type.middle,
form[id^="form"]>div:first-of-type.ml-auto {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 20px !important;
    margin-bottom: 25px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    position: relative !important;
    border-bottom: none !important;
}

.form-standard-header .form-standard-title,
.collecte-header h1,
form[service] h2,
form[id^="form"] h1,
form[id^="form"] h2 {
    color: #0f172a !important;
    font-weight: 800 !important;
    font-size: 2.2rem !important;
    margin-bottom: 25px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 15px !important;
    text-shadow: none !important;
    letter-spacing: -0.02em !important;
}

.form-standard-header .form-standard-title img,
.collecte-header h1 img,
.header-icon {
    height: 52px !important;
    filter: brightness(0.15) !important;
}

.form-standard-header .form-standard-subtitle {
    color: var(--form-text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Print Button Modernization */
#form #print.form-print-btn,
form #print,
.form-print-btn {
    position: fixed !important;
    left: 20px !important;
    top: 20px !important;
    background: #ffffff !important;
    border: 1px solid var(--form-border) !important;
    color: var(--form-text) !important;
    border-radius: 9999px !important;
    padding: 8px 18px !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    cursor: pointer !important;
    z-index: 500 !important;
}

#form #print.form-print-btn:hover,
form #print:hover,
.form-print-btn:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: var(--form-primary) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

/* Accueil button in form header */
.header-accueil-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 7px 18px !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 9999px !important;
    text-decoration: none !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
}

.header-accueil-btn i {
    color: #7ebc5a;
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}

.header-accueil-btn:hover {
    background: #f8fafc !important;
    border-color: #7ebc5a !important;
    color: #1b4332 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(126, 188, 90, 0.2) !important;
    text-decoration: none !important;
}

.header-accueil-btn:hover i {
    transform: translateX(-2px);
}

/* Mobile: Top Right, Icon Only, Side-by-Side with Print Button */
@media (max-width: 768px) {

    /* Clustered actions container when present */
    .form-header-actions {
        position: fixed !important;
        top: 14px !important;
        right: 14px !important;
        left: auto !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        z-index: 1050 !important;
    }

    /* Print button: icon only, square/circle pill */
    #form #print.form-print-btn,
    form #print,
    .form-print-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        font-size: 0.95rem !important;
    }

    /* Hide text inside print button on mobile */
    #form #print text,
    #form #print span,
    .form-print-btn text,
    .form-print-btn span {
        display: none !important;
    }

    #form #print i,
    .form-print-btn i {
        margin: 0 !important;
        font-size: 0.95rem !important;
    }

    /* If print button is isolated without form-header-actions container */
    #form:not(:has(.form-header-actions))>#print,
    body:not(:has(.form-header-actions)) #form #print,
    body:not(:has(.form-header-actions)) form #print {
        position: fixed !important;
        top: 14px !important;
        right: 58px !important;
        left: auto !important;
    }

    /* Accueil button: icon only, top right */
    .header-accueil-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        position: fixed !important;
        top: 14px !important;
        right: 14px !important;
        z-index: 1050 !important;
    }

    /* When inside form-header-actions, maintain natural flex flow beside print button */
    .form-header-actions .header-accueil-btn {
        position: static !important;
        top: auto !important;
        right: auto !important;
    }

    /* Hide text in Accueil button on mobile, show only the home icon */
    .header-accueil-btn span,
    .header-accueil-btn text {
        display: none !important;
    }

    .header-accueil-btn i {
        margin: 0 !important;
        font-size: 1.05rem !important;
    }
}

.form-intro-alt {
    padding-left: 12px;
    border-left: 3px solid rgba(126, 188, 90, 0.3);
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 16px;
    color: #475569;
}

/* Main Form Card Container (Matching rebuts.php .collecte-main-card) */
.form-standard-card,
.collecte-main-card {
    background: var(--form-card-bg) !important;
    border-radius: 16px !important;
    border: 1px solid var(--form-border) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    padding: 40px !important;
    margin-bottom: 40px !important;
}

@media (max-width: 768px) {

    .form-standard-card,
    .collecte-main-card {
        padding: 20px 16px !important;
        border-radius: 12px !important;
    }

    .form-standard-header .form-standard-title,
    .collecte-header h1 {
        font-size: 1.6rem !important;
    }
}

/* Two Columns Container (Directly from rebuts.php) */
.cols-container {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}


.col-side {
    flex: 1;
}

.col-title {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #1b4332 !important;
    margin-bottom: 20px !important;
    border-bottom: 2px solid #f1f5f9 !important;
    padding-bottom: 8px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Top Meta Bar (e.g. Mandatory Fields notice) */
.form-required-note {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--form-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

.form-required-note .req-star {
    color: #ef4444;
    font-weight: 700;
}

/* ==========================================================================
   Standardized Form Sections (Modular Cards)
   ========================================================================== */
.form-section {
    background: #ffffff;
    border: 1px solid var(--form-border);
    border-radius: var(--form-radius-md);
    box-shadow: var(--form-shadow-section);
    padding: 24px 28px;
    margin-top: 20px;
    margin-bottom: 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-section:focus-within {
    border-color: #cbd5e1;
}

/* Section Header & Title */
.form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1b4332;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-section-subtitle {
    font-size: 0.85rem;
    color: var(--form-text-muted);
    margin-top: -8px;
    margin-bottom: 16px;
    line-height: 1.45;
}

/* Subsection / Nested Groups */
.form-subsection {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: var(--form-radius-sm);
    padding: 16px 18px;
    margin-top: 14px;
    margin-bottom: 14px;
}

.form-subsection-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--form-text);
    margin: 0 0 12px 0;
}

/* ==========================================================================
   Form Controls, Inputs, Labels & Grids
   ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 20px;
}

.form-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (max-width: 768px) {

    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.form-group label,
.form-section label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    line-height: 1.35;
}

.form-group label small,
.form-section label small {
    display: block;
    font-weight: 400;
    color: var(--form-text-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

/* Inputs & Textareas */
.form-standard-card input.form-control,
.form-standard-card select.form-control,
.form-standard-card textarea.form-control,
.form-section input.form-control,
.form-section select.form-control,
.form-section textarea.form-control {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid var(--form-border);
    border-radius: 8px;
    color: var(--form-text);
    font-size: 0.95rem;
    padding: 10px 14px;
    transition: all 0.2s ease-in-out;
    box-shadow: none;
    box-sizing: border-box;
    font-family: inherit;
}

.form-standard-card input.form-control:focus,
.form-standard-card select.form-control:focus,
.form-standard-card textarea.form-control:focus,
.form-section input.form-control:focus,
.form-section select.form-control:focus,
.form-section textarea.form-control:focus {
    border-color: var(--c-accent) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(126, 188, 90, 0.18) !important;
    background-color: #ffffff;
}

.form-standard-card textarea.form-control,
.form-section textarea.form-control {
    min-height: 90px;
    line-height: 1.5;
    resize: vertical;
}

/* Radio & Checkbox Styling */
.form-check-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.form-check-group input[type="radio"],
.form-check-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--form-primary);
}

.form-check-group label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 500;
    color: #1e293b;
    font-size: 0.9rem;
}

.form-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 16px;
    margin-top: 8px;
}

/* Info Box / Notice Callout */
.form-info-callout {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid var(--form-accent);
    padding: 16px 18px;
    border-radius: var(--form-radius-sm);
    color: #166534;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 14px;
    margin-bottom: 14px;
}

.form-info-callout-primary {
    background: #f0f7fb;
    border: 1px solid #bae6fd;
    border-left: 4px solid var(--form-primary);
    color: #075985;
}

/* File Upload Rows */
.form-file-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--form-border);
    border-radius: var(--form-radius-sm);
    background: #ffffff;
    margin-bottom: 10px;
    transition: background-color 0.2s ease;
}

.form-file-row:hover {
    background-color: #f8fafc;
}

.form-file-row .btn_blue.open_file {
    min-width: 44px;
    height: 40px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #7ebc5a 0%, #2d5a14 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(126, 188, 90, 0.25) !important;
    cursor: pointer;
}

.form-file-label {
    flex: 1;
    font-size: 0.875rem;
    color: var(--form-text);
    font-weight: 500;
    margin: 0;
}

/* Form Actions / Submit Button */
.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--form-border);
}

.form-btn-submit {
    background: linear-gradient(135deg, #7ebc5a 0%, #2d5a14 100%) !important;
    color: #ffffff !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    padding: 12px 35px !important;
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(126, 188, 90, 0.35) !important;
    transition: all 0.2s ease !important;
    cursor: pointer;
}

.form-btn-submit:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 15px rgba(126, 188, 90, 0.4) !important;
}

/* ==========================================================================
   Universal Form & Compatibility Rules
   Applies across all portal forms (urbanisme, permis/feu, incendie, greffe, loisir, etc.)
   ========================================================================== */

/* Outer form containers across the portal */
/* ==========================================================================
   Universal Form & Compatibility Rules (Matching rebuts.php)
   Applies across all portal forms (urbanisme, permis/feu, incendie, greffe, loisir, etc.)
   ========================================================================== */

/* Universal Section Cards across all forms (.white_square) */
form[service] .white_square,
form[id^="form"] .white_square,
.form-card-container .white_square,
.combine_demandeur>.white_square,
.combine_demandeur,
.combine_emplacement,
.combine_executant,
#all_forms .white_square,
.standardize-form .white_square {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04) !important;
    padding: 24px 28px;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    transition: all 0.2s ease !important;
}

/* Nested child white_square cards (e.g. usage du bâtiment, sous-groupes) */
form[service] .white_square .white_square,
form[id^="form"] .white_square .white_square,
.form-card-container .white_square .white_square,
.combine_demandeur>.white_square .white_square,
#all_forms .white_square .white_square,
.standardize-form .white_square .white_square {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    padding: 18px 20px !important;
    margin-top: 14px !important;
    margin-bottom: 14px !important;
}


form[service] .white_square h6::before,
form[service] .white_square h5::before,
form[id^="form"] .white_square h4::before,
form[id^="form"] .white_square h5::before,
form[id^="form"] .white_square h6::before,
.form-card-container h4::before,
.form-card-container h5::before,
.form-card-container h6::before,
.combine_demandeur h5::before,
.combine_demandeur h6::before,
#all_forms .white_square h6::before,
.standardize-form .white_square h6::before,
.standardize-form .white_square h5::before {
    display: none !important;
}

/* Sub-titles inside nested cards */
form[service] .white_square .white_square h6,
form[service] .white_square .white_square h5,
form[id^="form"] .white_square .white_square h6,
form[id^="form"] .white_square .white_square h5,
.form-card-container .white_square .white_square h6,
.combine_demandeur>.white_square .white_square h6,
#all_forms .white_square .white_square h6,
.standardize-form .white_square .white_square h6 {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #1b4332 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

form[service] .white_square .white_square h6::before,
form[service] .white_square .white_square h5::before,
form[id^="form"] .white_square .white_square h6::before,
form[id^="form"] .white_square .white_square h5::before,
.form-card-container .white_square .white_square h6::before,
.combine_demandeur>.white_square .white_square h6::before,
#all_forms .white_square .white_square h6::before,
.standardize-form .white_square .white_square h6::before {
    display: none !important;
}

/* ==========================================================================
   Standardized Form Controls (Inputs, Selects, Textareas - Matching rebuts.php)
   ========================================================================== */
form input.form-control,
form select.form-control,
form textarea.form-control,
.form-standard-card input.form-control,
.form-standard-card select.form-control,
.form-standard-card textarea.form-control,
.form-section input.form-control,
.form-section select.form-control,
.form-section textarea.form-control,
.white_square input.form-control,
.white_square select.form-control,
.white_square textarea.form-control,
form[service] input.form-control,
form[service] select.form-control,
form[service] textarea.form-control,
form[id^="form"] input.form-control,
form[id^="form"] select.form-control,
form[id^="form"] textarea.form-control,
.form-card-container input.form-control,
.form-card-container select.form-control,
.form-card-container textarea.form-control {
    width: 100% !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 0.95rem !important;
    transition: all 0.2s !important;
    box-sizing: border-box !important;
}

/* Textarea height exception */
form textarea.form-control,
.form-standard-card textarea.form-control,
.form-section textarea.form-control,
.white_square textarea.form-control,
form[service] textarea.form-control,
form[id^="form"] textarea.form-control,
.form-card-container textarea.form-control {
    height: auto !important;
    min-height: 96px !important;
    resize: vertical !important;
}

/* Form Controls Focus State - Matching rebuts.php */
form input.form-control:focus,
form select.form-control:focus,
form textarea.form-control:focus,
.form-standard-card input.form-control:focus,
.form-standard-card select.form-control:focus,
.form-standard-card textarea.form-control:focus,
.form-section input.form-control:focus,
.form-section select.form-control:focus,
.form-section textarea.form-control:focus,
.white_square input.form-control:focus,
.white_square select.form-control:focus,
.white_square textarea.form-control:focus,
form[service] input.form-control:focus,
form[service] select.form-control:focus,
form[service] textarea.form-control:focus,
form[id^="form"] input.form-control:focus,
form[id^="form"] select.form-control:focus,
form[id^="form"] textarea.form-control:focus,
.form-card-container input.form-control:focus,
.form-card-container select.form-control:focus,
.form-card-container textarea.form-control:focus {
    border-color: #7ebc5a !important;
    box-shadow: 0 0 0 3px rgba(126, 188, 90, 0.18) !important;
    outline: none !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
}

/* Standardize labels across all forms - Matching rebuts.php */
form label,
.form-standard-card label,
.form-section label,
.white_square label,
form[service] label,
form[id^="form"] label,
.form-card-container label {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
    margin-bottom: 6px !important;
    display: inline-block !important;
}

/* Radio & Checkbox label exception */
form .d-flex label,
form .form-check-group label,
form input[type="radio"]+label,
form input[type="checkbox"]+label,
.white_square input[type="radio"]+label,
.white_square input[type="checkbox"]+label {
    margin-bottom: 0 !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    cursor: pointer !important;
}

/* Radio & Checkbox color: Green accent */
form input[type="radio"],
form input[type="checkbox"],
.form-standard-card input[type="radio"],
.form-standard-card input[type="checkbox"],
.white_square input[type="radio"],
.white_square input[type="checkbox"] {
    accent-color: #709e55 !important;
    cursor: pointer !important;
}

/* Override any orange background/borders on option rows across all forms */
form .d-flex.align-items-baseline,
.form-standard-card .d-flex.align-items-baseline,
.white_square .d-flex.align-items-baseline,
form .w-100.d-flex.align-items-baseline {
    background-color: transparent !important;
    border: none !important;
    color: #1e293b !important;
    padding: 6px 0 !important;
}

form .d-flex.align-items-baseline label,
.form-standard-card .d-flex.align-items-baseline label,
.white_square .d-flex.align-items-baseline label,
form .w-100.d-flex.align-items-baseline label {
    color: #1e293b !important;
    font-weight: 500 !important;
    margin-bottom: 0 !important;
}

/* Consent & declaration checkbox callout boxes (Matching rebuts.php .signature-box) */
.form-standard-card>.d-flex.align-items-baseline,
form>.d-flex.align-items-baseline,
.white_square.combine_demandeur+.d-flex.align-items-baseline,
.white_square.combine_emplacement+.d-flex.align-items-baseline,
.signature-box {
    background: rgba(126, 188, 90, 0.05) !important;
    border: 1px dashed rgba(126, 188, 90, 0.3) !important;
    border-radius: 10px !important;
    padding: 20px !important;
    color: #2d5a14 !important;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
}

.form-standard-card>.d-flex.align-items-baseline label,
form>.d-flex.align-items-baseline label,
.signature-box label {
    color: #2d5a14 !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    cursor: pointer !important;
    font-weight: 500 !important;
}

.signature-check {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-top: 15px !important;
}

.signature-box input[type="checkbox"] {
    margin: 0 !important;
    margin-top: 3px !important;
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    accent-color: #709e55 !important;
    flex-shrink: 0 !important;
}

/* Standardize input containers spacing (rebuts.php .input-field) */
.input-field,
.white_square>div:not(.row):not(.d-flex),
.white_square .col-sm>div,
.white_square .w-50>div {
    margin-bottom: 15px !important;
}

/* Normalize intro notice boxes across all forms (Matching rebuts.php .form-intro / .collecte-intro-box) */
.form-intro,
.form-info-callout,
form[id^="form"] .text-left[style*="backdrop-filter"],
form[id^="form"] .text-left[style*="background: rgba(126, 188, 90"],
form[service] .text-left[style*="background: rgba(126, 188, 90"] {
    background: rgba(126, 188, 90, 0.05) !important;
    border: 1px solid rgba(126, 188, 90, 0.15) !important;
    color: #1e293b !important;
    padding: 25px !important;
    border-radius: 12px !important;
    margin-bottom: 30px !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.form-intro p,
.form-info-callout p,
form[id^="form"] .text-left[style*="backdrop-filter"] p,
form[id^="form"] .text-left[style*="background: rgba(126, 188, 90"] p,
form[service] .text-left[style*="background: rgba(126, 188, 90"] p {
    color: #1e293b !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    margin-bottom: 12px !important;
}

.form-intro a,
.form-info-callout a,
form[id^="form"] .text-left[style*="backdrop-filter"] a,
form[id^="form"] .text-left[style*="background: rgba(126, 188, 90"] a,
form[service] .text-left[style*="background: rgba(126, 188, 90"] a {
    color: #2d5a14 !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
}

/* Harmonize form titles across permis/feu forms */
form[id^="form"] h1.text-center,
form[id^="form"] h2.text-center {
    color: #0f172a !important;
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    margin-bottom: 25px !important;
}

/* Ensure proper spacing and border handling for repeated or combined containers */
form[service] .combine_demandeur,
form[service] .combine_emplacement,
form[service] .combine_executant,
form[id^="form"] .combine_demandeur,
form[id^="form"] .combine_emplacement {
    margin-top: 20px;
    margin-bottom: 20px;
}

/* Standardize form container wrappers */
.form-card-container,
div.form-card-container[style*="background-color:white"] {
    background-color: #ffffff !important;
    border: 1px solid var(--form-border) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    padding: 40px !important;
}

/* Actions */
.form-actions {
    display: flex !important;
    justify-content: flex-end !important;
    margin-top: 28px !important;
    padding-top: 20px !important;
    border-top: 1px solid var(--form-border) !important;
}

/* Submit buttons standardization - Matching rebuts.php #send gradient */
form button[type="button"]#send_form,
form button[type="button"]#send,
form button[type="submit"],
.save_button button,
form button#save,
form button#send,
.form-btn-submit {
    background: linear-gradient(135deg, #7ebc5a 0%, #2d5a14 100%) !important;
    color: white !important;
    padding: 12px 35px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(126, 188, 90, 0.35) !important;
    transition: all 0.2s !important;
    cursor: pointer !important;
}

form button[type="button"]#send_form:hover,
form button[type="button"]#send:hover,
form button[type="submit"]:hover,
.save_button button:hover,
form button#save:hover,
form button#send:hover,
.form-btn-submit:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 15px rgba(126, 188, 90, 0.4) !important;
}

form button[type="button"]#send_form:active,
form button[type="button"]#send:active,
form button[type="submit"]:active,
.save_button button:active,
form button#save:active,
form button#send:active,
.form-btn-submit:active {
    transform: translateY(0) !important;
}

form button[type="button"]#send_form:disabled,
form button[type="button"]#send:disabled,
form button[type="submit"]:disabled,
.save_button button:disabled,
form button#save:disabled,
form button#send:disabled,
.form-btn-submit:disabled {
    background: #cbd5e1 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Error validation states */
.border-danger {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.form-sub-title,
.col-title {
    font-size: 1.1rem !important;
    border-bottom: 2px solid #7ebc5a !important;
    font-weight: 700 !important;
    color: var(--c-primary) !important;
    margin-bottom: 20px !important;
    padding-bottom: 8px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Premium Standardized Checkbox & Radio Item Container */
.form-checkbox {
    border: 1px solid #e2e8f0 !important;
    background-color: #f8fafc !important;
    display: inline-flex;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease-in-out !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

.form-checkbox:hover {
    background-color: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    box-shadow: 0 2px 5px rgba(126, 188, 90, 0.12) !important;
}

.form-checkbox:has(input:checked) {
    background-color: rgba(114, 192, 69, 0.219) !important;
    border-color: #7ebc5a !important;
}

.form-checkbox input[type="checkbox"],
.form-checkbox input[type="radio"] {
    margin: 0 !important;
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    accent-color: #709e55 !important;
    flex-shrink: 0 !important;
}

.form-checkbox label {
    margin-bottom: 0 !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    line-height: 1.4 !important;
}

.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    gap: 10px;
}

@media (max-width: 768px) {
    .cols-container {
        flex-direction: column;
        gap: 30px;
    }

    .standardize-form,
    .form-standard-wrapper {
        padding: 0 5px !important;
    }

    .standardize-form .white_square {
        padding: 20px 20px !important;
    }

    .col-sm {
        padding: 0 !important;
    }
}