/* General Body Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6; /* Soft light background */
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 20px 0;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top */
    min-height: 100vh;
}

/* Container for the form */
.container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    width: 100%;
    box-sizing: border-box; /* Include padding in width */
}

/* Headings */
h1 {
    text-align: center;
    color: #0056b3; /* Darker blue for main heading */
    margin-bottom: 25px;
    font-size: 2.5em;
    font-weight: 700;
}

h2 {
    color: #007bff; /* Primary blue for step headings */
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    margin-top: 30px;
    margin-bottom: 25px;
    font-size: 1.8em;
}

h3 {
    color: #495057; /* Dark gray for heir categories */
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 1px dashed #e9ecef;
    padding-bottom: 8px;
    font-size: 1.3em;
}

/* Introduction and Disclaimer Text */
.intro-text, .disclaimer {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #555;
}

.disclaimer {
    color: #dc3545; /* Red for disclaimer */
    font-weight: 500;
    border: 1px dashed #ffc107;
    padding: 10px;
    background-color: #fff3cd;
    border-radius: 5px;
    margin-bottom: 30px;
}

.instructions {
    text-align: center;
    margin-bottom: 30px;
    font-style: italic;
    color: #6c757d;
}

/* Form Group Styles */
.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align labels to the left */
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 1.05em;
}

.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    box-sizing: border-box; /* Ensures padding doesn't increase width */
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="number"]:focus,
.form-group select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Specific styling for heir input fields to make them smaller */
.heir-input input[type="number"] {
    width: 80px; /* Shorter width for heir counts */
    text-align: center;
    display: inline-block; /* Allow label and input on same line */
    margin-left: 15px;
    padding: 8px 10px; /* Smaller padding */
    font-size: 0.95em;
}

.heir-input {
    display: flex;
    align-items: center; /* Vertically align label and input */
    justify-content: space-between; /* Push input to the right */
    padding: 8px 0;
    border-bottom: 1px dotted #ececec;
}

.heir-input label {
    margin-bottom: 0; /* Remove bottom margin from label in heir-input */
    flex-grow: 1; /* Allow label to take available space */
}

/* Styling for disabled fields */
.form-group input[disabled],
.form-group select[disabled] {
    background-color: #e9ecef; /* Light grey background */
    cursor: not-allowed;
    opacity: 0.7;
}

/* Optional: Add a class to dim the whole line for disabled fields */
.disabled-field {
    opacity: 0.6;
    background-color: #f8f9fa; /* Slightly different background for disabled rows */
    border-radius: 5px;
    padding: 5px 10px;
}

/* Section Cards for better visual separation */
.section-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* Heir Categories */
.heir-category {
    margin-bottom: 20px;
    padding: 15px 20px;
    background-color: #fcfcfc;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

/* Form Actions (Submit button) */
.form-actions {
    text-align: center;
    margin-top: 40px;
}

.button {
    background-color: #28a745; /* Green submit button */
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.button.primary:hover {
    background-color: #218838; /* Darker green on hover */
    transform: translateY(-2px); /* Slight lift effect */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.5em;
    }

    h3 {
        font-size: 1.1em;
    }

    .form-group input[type="number"],
    .form-group select {
        padding: 10px;
    }

    .heir-input {
        flex-direction: column;
        align-items: flex-start;
    }

    .heir-input label {
        margin-bottom: 5px;
    }

    .heir-input input[type="number"] {
        width: 100%;
        margin-left: 0;
        text-align: left;
    }

    .button {
        width: 100%;
        padding: 12px 20px;
    }
}