/* General Form Styling */
.leo-letter-form {
    max-width: 800px;
    margin: 40px auto;
    padding: 25px 30px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Fieldset Styling */
.leo-letter-form fieldset {
    border: none;
    padding: 0;
    margin-bottom: 25px;
}

.leo-letter-form legend {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    color: #002f6e; /* Primary Color */
    border-bottom: 2px solid #002f6e; /* Primary Color */
    padding-bottom: 5px;
}

/* Form Group Styling */
.form-group {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #333333;
}

/* Icon Styling */
.form-group i {
    position: absolute;
    top: 50%; /* Center the icon vertically */
    left: 10px; /* Adjust left position for consistency */
    transform: translateY(-50%);
    font-size: 18px;
    color: #002f6e; /* Primary Color */
}

/* Select Dropdown Styling */
.form-group select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23002f6e" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: left 10px center, right 10px center;
    background-size: 16px;
    padding-left: 35px; /* Space for the icon on the left */
    padding-right: 45px; /* Space for the dropdown arrow */
    height: 45px; /* Consistent height */
    line-height: 1.5;
    font-size: 15px;
    border: 1px solid #cccccc;
    border-radius: 5px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff; /* White background */
    color: #000000; /* Black text */
}

.form-group select:focus {
    border-color: #002f6e; /* Primary Color */
    box-shadow: 0 0 8px rgba(0, 47, 110, 0.2); /* Primary Color */
    outline: none;
}

/* Input and Textarea Styling */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 10px 10px 35px; /* Padding for icon */
    border: 1px solid #cccccc;
    border-radius: 5px;
    font-size: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff; /* White background */
    color: #000000; /* Black text */
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* On Focus Styles */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #002f6e; /* Primary Color */
    box-shadow: 0 0 8px rgba(0, 47, 110, 0.2); /* Primary Color */
    outline: none;
}

/* Placeholder Text Styling */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #888888; /* Lighter grey placeholder */
}

/* Submit Button Styling */
.leo-letter-form input[type="submit"] {
    background-color: #002f6e; /* Primary Color */
    color: #ffffff;
    padding: 12px 0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
}

.leo-letter-form input[type="submit"]:hover {
    background-color: #001a40; /* Darker Shade for Hover */
    transform: translateY(-2px);
}

/* Progress Bar Styling */
.progress-bar {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 25px;
    overflow: hidden;
    margin-top: 25px;
    height: 20px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: #002f6e; /* Primary Color */
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 12px;
    border-radius: 25px 0 0 25px;
}

/* Generated Letter Styling */
.generated-letter {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px 40px;
    background-color: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: 'Georgia', serif;
    line-height: 1.8;
    color: #333333;
}

.generated-letter h2 {
    color: #002f6e; /* Primary Color */
    border-bottom: 2px solid #002f6e; /* Primary Color */
    padding-bottom: 10px;
    margin-bottom: 25px;
}

.letter-content {
    white-space: pre-wrap;
    font-size: 16px;
    margin-bottom: 25px;
}

.copy-button {
    background-color: #002f6e; /* Primary Color */
    color: #ffffff;
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.copy-button:hover {
    background-color: #001a40; /* Darker Shade for Hover */
    transform: translateY(-2px);
}

/* Error Message Styling */
.error-message {
    color: #ff4d4d;
    font-weight: bold;
    text-align: center;
    margin-top: 20px;
}

/* Responsive Design Enhancements */
@media (max-width: 768px) {
    .leo-letter-form, .generated-letter {
        padding: 20px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .progress-bar {
        height: 18px;
    }

    .progress-fill {
        font-size: 11px;
    }

    .copy-button {
        width: 100%;
        padding: 12px 0;
    }
}

/* Flexbox for Form Sections */
.form-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.form-col {
    flex: 1 1 45%;
    min-width: 200px;
}

@media (max-width: 600px) {
    .form-col {
        flex: 1 1 100%;
    }
}

/* Additional Styles for Better Visual Hierarchy */
.leo-letter-form h3 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.form-section {
    margin-bottom: 20px;
}

/* Style for form validation */
.form-group input:invalid,
.form-group select:invalid,
.form-group textarea:invalid {
    border-color: #ff6b6b;
}

.form-group input:focus:invalid,
.form-group select:focus:invalid,
.form-group textarea:focus:invalid {
    box-shadow: 0 0 5px #ff6b6b;
}

/* Style for required field indicator */
.form-group label::after {
    content: "*";
    color: #ff6b6b;
    margin-left: 3px;
}

/* Optional fields without asterisk */
.form-group.optional label::after {
    content: "";
}
