/**
 * GPS Case Management - Public Styles
 * Mobile-first approach for submission forms
 */

/* Form Wrapper */
.gps-submission-form-wrapper,
.gps-death-report-form-wrapper {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

/* Form Intro */
.gps-form-intro {
    background: #f0f7ff;
    border-left: 4px solid #0073aa;
    padding: 15px 20px;
    margin-bottom: 30px;
}

.gps-form-intro p {
    margin: 0;
    color: #333;
    line-height: 1.6;
}

/* Form Sections */
.gps-form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.gps-form-section:last-of-type {
    border-bottom: none;
}

.gps-form-section h3 {
    margin: 0 0 15px;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

/* Form Fields */
.gps-form-field {
    margin-bottom: 15px;
}

.gps-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.gps-form-field input[type="text"],
.gps-form-field input[type="email"],
.gps-form-field input[type="tel"],
.gps-form-field input[type="date"],
.gps-form-field input[type="number"],
.gps-form-field select,
.gps-form-field textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gps-form-field input:focus,
.gps-form-field select:focus,
.gps-form-field textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.gps-form-field textarea {
    resize: vertical;
    min-height: 120px;
}

.gps-form-field input[type="file"] {
    padding: 10px 0;
}

/* Required indicator */
.required {
    color: #d63638;
}

/* Help text */
.gps-form-help {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
    line-height: 1.4;
}

/* Form Row (side by side on larger screens) */
.gps-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.gps-form-field-half {
    flex: 1;
    min-width: 200px;
}

/* Checkbox Labels */
.gps-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: normal !important;
    line-height: 1.5;
}

.gps-checkbox-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 3px;
}

/* Person Rows */
.gps-persons-container {
    margin-bottom: 15px;
}

.gps-person-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
}

.gps-person-row .gps-form-field {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.gps-person-row .gps-form-field label {
    font-size: 13px;
}

.gps-person-row .remove-person {
    align-self: flex-end;
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #d63638;
    color: #d63638;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.gps-person-row .remove-person:hover {
    background: #d63638;
    color: #fff;
}

/* Add Button */
.gps-add-button {
    padding: 10px 20px;
    background: #f0f0f1;
    border: 1px dashed #999;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    width: 100%;
    text-align: center;
}

.gps-add-button:hover {
    background: #e0e0e0;
    border-color: #666;
    color: #333;
}

/* Consent Section */
.gps-form-consent {
    background: #fff8e5;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #f0c36d;
}

/* Form Actions */
.gps-form-actions {
    margin-top: 30px;
    text-align: center;
}

.gps-submit-button {
    padding: 15px 40px;
    background: #0073aa;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.gps-submit-button:hover {
    background: #005a87;
}

.gps-submit-button:disabled {
    background: #999;
    cursor: not-allowed;
}

/* Form Messages */
.gps-form-messages {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

.gps-form-messages.gps-message-success {
    display: block;
    background: #edfaef;
    border: 1px solid #00a32a;
    color: #00a32a;
}

.gps-form-messages.gps-message-error {
    display: block;
    background: #fcf0f1;
    border: 1px solid #d63638;
    color: #d63638;
}

.gps-form-messages.gps-message-loading {
    display: block;
    background: #f0f0f1;
    border: 1px solid #ccc;
    color: #666;
    text-align: center;
}

/* Success State */
.gps-form-success {
    text-align: center;
    padding: 40px 20px;
}

.gps-form-success h2 {
    color: #00a32a;
    margin-bottom: 15px;
}

.gps-form-success p {
    color: #333;
    margin: 10px 0;
}

.gps-form-success .gps-reference-number {
    font-size: 24px;
    font-weight: 600;
    background: #f0f0f1;
    padding: 15px 30px;
    border-radius: 4px;
    display: inline-block;
    margin: 20px 0;
    color: #1d2327;
}

/* Pending Deaths Count Widget */
.gps-pending-deaths-count {
    display: inline-block;
    font-weight: 600;
}

/* Responsive Adjustments */
@media screen and (max-width: 600px) {
    .gps-submission-form-wrapper,
    .gps-death-report-form-wrapper {
        padding: 15px;
    }

    .gps-form-row {
        flex-direction: column;
    }

    .gps-form-field-half {
        min-width: 100%;
    }

    .gps-person-row {
        flex-direction: column;
    }

    .gps-person-row .gps-form-field {
        min-width: 100%;
    }

    .gps-submit-button {
        width: 100%;
    }
}


/* ================================
   Death Report Search Workflow
   ================================ */

/* Search Step */
.gps-form-step {
    padding: 20px 0;
}

/* Search Results */
.gps-search-results {
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fff;
}

.gps-search-results h4 {
    margin: 0;
    padding: 12px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #666;
}

.gps-search-result-item {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.gps-search-result-item:last-child {
    border-bottom: none;
}

.gps-result-name {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 5px;
}

.gps-result-details {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.gps-select-record {
    padding: 8px 16px;
    background: #0073aa;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.gps-select-record:hover {
    background: #005a87;
}

/* No Results */
.gps-no-results {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
}

.gps-no-results p {
    margin: 0;
    color: #666;
}

/* Secondary Button */
.gps-button-secondary {
    background: #f0f0f1 !important;
    color: #1d2327 !important;
    border: 1px solid #c3c4c7 !important;
}

.gps-button-secondary:hover {
    background: #e0e0e0 !important;
    border-color: #999 !important;
}

/* Mode Banners */
.gps-form-mode-indicator {
    margin-bottom: 30px;
}

.gps-mode-banner {
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.gps-mode-new {
    background: #f0f7ff;
    border-left: 4px solid #0073aa;
}

.gps-mode-update {
    background: #edfaef;
    border-left: 4px solid #00a32a;
}

.gps-mode-banner h2 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #1d2327;
}

.gps-mode-banner p {
    margin: 0 0 15px;
    color: #555;
}

.gps-selected-details {
    font-size: 14px;
    color: #666;
}

.gps-back-to-search {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #999;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.gps-back-to-search:hover {
    background: #f0f0f1;
    border-color: #666;
    color: #333;
}

/* Field Error State */
.gps-field-error {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 2px rgba(214, 54, 56, 0.2) !important;
}

