/* General Form Styling */
.sra-letter-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    font-family: Arial, sans-serif;
}

.sra-letter-form fieldset {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.sra-letter-form legend {
    font-weight: bold;
    padding: 0 10px;
    color: #0071ad;
}

.sra-letter-form .form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.sra-letter-form .form-group {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-bottom: 1rem;
}

.sra-letter-form .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.sra-letter-form .col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

.sra-letter-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #0071ad;
}

.sra-letter-form input[type="text"],
.sra-letter-form input[type="email"],
.sra-letter-form input[type="tel"],
.sra-letter-form input[type="date"],
.sra-letter-form select,
.sra-letter-form textarea {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
}

.sra-letter-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230071ad%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 12px auto;
    padding-right: 30px; /* Add space for the dropdown arrow */
}

/* Fix for dropdown options not displaying */
.sra-letter-form select option {
    color: #333;
    background-color: #fff;
}

.sra-letter-form button[type="submit"] {
    background-color: #0071ad;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.sra-letter-form button[type="submit"]:hover {
    background-color: #005177;
}

/* Font Awesome Icons */
.sra-letter-form .form-group i.fa {
    position: absolute;
    left: 25px;
    top: 35px;
    font-size: 16px;
    color: #0071ad;
}

/* Progress Bar Styling */
.progress-bar {
    width: 100%;
    background-color: #f3f3f3;
    padding: 3px;
    border-radius: 3px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2);
    margin-top: 20px;
}

.progress-fill {
    display: block;
    height: 22px;
    background-color: #0071ad;
    border-radius: 3px;
    transition: width 500ms ease-in-out;
    text-align: center;
    line-height: 22px;
    color: white;
    font-weight: bold;
}

/* Generated Letter Styling */
.generated-letter {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.copy-button {
    background-color: #0071ad;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
    font-size: 16px;
    font-weight: bold;
}

.copy-button:hover {
    background-color: #005177;
}

.error-message {
    color: #ff0000;
    font-weight: bold;
}

.disclaimer {
    font-size: 0.9em;
    font-style: italic;
    margin-top: 20px;
}

/* Word Count Display */
#word_count, #impact_word_count, #outcome_word_count {
    font-size: 0.9em;
    color: #666;
    text-align: right;
}

/* Hide Other Fields by Default */
#other_complaint_group, #other_impact_group, #other_desired_outcome_group {
    display: none;
}

/* Required Field Indicator */
.sra-letter-form label:after {
    content: " *";
    color: red;
}

/* Improve focus styles for accessibility */
.sra-letter-form input:focus,
.sra-letter-form select:focus,
.sra-letter-form textarea:focus {
    outline: none;
    border-color: #0071ad;
    box-shadow: 0 0 5px rgba(0, 113, 173, 0.5);
}

/* Consent and Declarations Section */
.consent-declarations {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.consent-declarations legend {
    font-size: 1.2em;
    font-weight: bold;
    color: #0071ad;
    padding: 0 10px;
}

.consent-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
}

.consent-item:last-child {
    border-bottom: none;
}

.consent-item input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 5px;
}

.consent-item label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.consent-item i {
    margin-right: 10px;
    color: #0071ad;
    font-size: 1.2em;
}

.consent-item span {
    flex: 1;
}

.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    color: #0071ad;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    white-space: nowrap;
    z-index: 1;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .sra-letter-form .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .consent-item {
        flex-direction: column;
    }
    
    .consent-item input[type="checkbox"] {
        margin-bottom: 5px;
    }
    
    .consent-item label {
        padding-left: 25px;
    }
    
    .consent-item i {
        position: absolute;
        left: 0;
        top: 2px;
    }
}

/* Accessibility improvements */
.consent-item input[type="checkbox"]:focus + label {
    outline: 2px solid #0071ad;
    outline-offset: 2px;
}