/* assets/css/forms.css */

/* --- GLOBAL RESET & BASE --- */
* {
    box-sizing: border-box;
}

body {
    background-color: #f2f2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif; 
}

/* --- LAYOUT CONTAINER --- */
.container {
    width: 90%;
    max-width: 1000px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    margin: 20px auto;
    text-align: center; 
}

/* --- UTILITY --- */
.hidden {
    display: none !important;
}
.red-bold-warning {
    color: #ff0000;
    font-weight: bold;
}

/* --- SHARED BUTTON STYLES --- */
.form-navigation {
    margin-top: 20px;
}
button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    margin: 0 5px;
}

/* =========================================================
   INDEX PAGE STYLES
   ========================================================= */
.form-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.form-list li {
    margin: 15px 0;
}

.form-button {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    color: #fff;
    background-color: #007BFF;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    text-align: center;
}

.form-button:active, 
.form-button:hover {
    background-color: #0056b3;
}

/* =========================================================
   SUCCESS MESSAGE STYLES
   ========================================================= */
.success-message {
    text-align: center;
    margin: 2em auto;
    max-width: 600px;
    font-family: Arial, sans-serif;
}

.alert-text {
    color: red;
    font-weight: bold;
}

.success-message button {
    margin-top: 20px;
}

/* =========================================================
   CIVIL SUMMONS FORM STYLES
   ========================================================= */

#summonsForm, 
.container:has(#summonsForm) h1, 
.container:has(#summonsForm) .subtitle {
    font-family: "Times New Roman", Times, serif;
    text-align: left; 
}

.container:has(#summonsForm) h1 {
    color: #000;
    margin-bottom: 5px;
}

.container:has(#summonsForm) .subtitle {
    font-size: 1.2em;
    text-align: left;
    margin-bottom: 20px;
    font-weight: normal;
    text-transform: uppercase;
}

#summonsForm input[type="text"], 
#summonsForm input[type="email"], 
#summonsForm select, 
#summonsForm textarea {
    width: 600px;
    padding: 8px;
    margin: 5px 0;
    max-width: 100%;
    font-family: inherit;
    font-size: 1rem;
}

#summonsForm p {
    margin-top: 15px;
    margin-bottom: 5px;
    line-height: 1.4;
}

#summonsForm label {
    display: block;
    margin-top: 5px;
}

#summonsForm #finalWarning {
    margin: 1em 0;
    padding: 10px;
    background: #ffe6e6;
    border: 1px solid #ff0000;
    color: #000;
    text-align: left;
    font-family: inherit;
}

/* =========================================================
   CIVIL COMPLAINT FORM STYLES
   ========================================================= */

#complaintForm,
.container:has(#complaintForm) h1,
.container:has(#complaintForm) .subtitle {
    font-family: "Times New Roman", Times, serif;
    text-align: left;
}

.container:has(#complaintForm) h1 {
    color: #000;
    margin-bottom: 5px;
}

.container:has(#complaintForm) .subtitle {
    font-size: 1.2em;
    text-align: left;
    margin-bottom: 20px;
    font-weight: normal;
    text-transform: uppercase;
}

.instructions {
    background-color: #f9f9f9;
    padding: 15px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    text-align: left;
    font-family: Arial, sans-serif;
}
.instructions h2 { margin-top: 0; }
.instructions li { margin-bottom: 10px; }

#complaintForm input[type="text"],
#complaintForm input[type="email"],
#complaintForm select,
#complaintForm textarea {
    width: 600px;
    padding: 8px;
    margin: 5px 0;
    max-width: 100%;
    font-family: inherit;
    font-size: 1rem;
}

#complaintForm p {
    margin-top: 15px;
    margin-bottom: 5px;
    line-height: 1.4;
}

#complaintForm label {
    display: block;
    margin-top: 5px;
    font-weight: bold;
}

/* Radio and Checkbox Groups */
#complaintForm .radio-group,
#complaintForm .checkbox-group {
    margin: 10px 0;
}

#complaintForm .radio-group label,
#complaintForm .checkbox-group label {
    display: inline-block;
    width: auto;
    font-weight: normal;
    margin-right: 15px;
    margin-top: 0;
    vertical-align: middle;
}

#complaintForm .radio-group input[type="radio"],
#complaintForm .checkbox-group input[type="checkbox"] {
    display: inline-block;
    width: auto;
    margin-right: 5px;
    margin-top: 0;
    vertical-align: middle;
}

.button-group {
    margin: 1em 0;
}

#complaintForm canvas {
    border: 1px solid #000;
    margin-bottom: 5px;
}

.extra-plaintiff, .extra-defendant, 
.extra-plaintiff-group, .extra-defendant-group {
    border: 1px solid #ccc;
    padding: 1em;
    margin: 1em 0;
}

#complaintForm #finalWarning {
    margin: 1em 0;
    padding: 10px;
    background: #ffe6e6;
    border: 1px solid #ff0000;
    color: #000;
    text-align: left;
    font-family: inherit;
}

/* =========================================================
   IFP (NON-PRISONER APPLICATION) FORM STYLES
   ========================================================= */

#ifpForm,
.container:has(#ifpForm) h1,
.container:has(#ifpForm) .subtitle {
    font-family: "Times New Roman", Times, serif;
    text-align: center;
}

.container:has(#ifpForm) h1 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.container:has(#ifpForm) .subtitle {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 30px;
    text-decoration: underline;
}

#ifpForm .form-section {
    text-align: left;
    line-height: 1.6;
}

/* General Text Inputs in IFP Form */
#ifpForm input[type="text"],
#ifpForm input[type="date"] {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
    font-family: inherit;
    font-size: 1rem;
    margin: 2px 0;
}

/* Specific styling for the header inputs (Plaintiff v Defendant) */
#ifpForm #plaintiff, 
#ifpForm #defendants {
    width: 100%;
    max-width: 400px;
}

/* Radio Group Styling */
#ifpForm .radio-group {
    display: inline-block;
    margin: 5px 0 5px 10px;
}

#ifpForm .radio-group input[type="radio"] {
    margin-right: 5px;
}

#ifpForm .radio-group label {
    margin-right: 15px;
    font-weight: normal;
}

/* Textareas */
#ifpForm textarea {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
    font-family: inherit;
    margin-top: 5px;
}

/* --- TABLE STYLES --- */
#ifpForm table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 0.95rem;
}

#ifpForm table th, 
#ifpForm table td {
    border: 1px solid #000;
    padding: 8px;
    vertical-align: middle;
}

#ifpForm table th {
    background-color: #f0f0f0;
    font-weight: bold;
    text-align: center;
}

#ifpForm table td {
    text-align: left;
}

/* Inputs inside tables - Make them fit nicely */
#ifpForm table input[type="text"] {
    width: 85%;
    padding: 4px;
    border: 1px solid #ccc;
    min-width: 60px;
}

/* --- SIGNATURE PAD --- */
#ifpForm canvas {
    border: 1px solid #000;
    background-color: #fff;
    cursor: crosshair;
    display: block;
    margin: 10px 0;
}

/* --- VALIDATION ERRORS --- */
#errorSummary {
    display: none;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: left;
}

#errorSummary ul {
    margin: 0;
    padding-left: 20px;
}

/* Highlight inputs when section has error */
.form-section.has-error input[type="text"],
.form-section.has-error input[type="date"],
.form-section.has-error textarea {
    border: 1px solid #dc3545 !important;
    background-color: #fff8f8;
}

/* Highlight radio groups */
.radio-group.has-error {
    border: 1px dashed #dc3545;
    padding: 2px 5px;
    border-radius: 4px;
    background-color: #fff8f8;
}

/* Highlight Signature Pad */
canvas.signature-error {
    border: 2px solid #dc3545 !important;
}

/* Final Warning Box */
#ifpForm #finalWarning {
    margin: 1em 0;
    padding: 10px;
    background: #ffe6e6;
    border: 1px solid #ff0000;
    color: #000;
    text-align: left;
}
