/*
 * style (1).css
 *
 * This stylesheet provides the layout and styling for a web application
 * designed to identify legal heirs under the Indian Succession Act.
 * It features a clean, card-like container, a grid-based form layout,
 * and responsive design for mobile devices.
 */

/* Import the Roboto font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/*
 * Global & Body Styles
 * -------------------
 * Sets the default font, background color, and uses Flexbox to center the content.
 */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/*
 * Container Styles
 * ----------------
 * Styles the main content area with a white background, rounded corners, and a shadow.
 */
.container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 700px;
    box-sizing: border-box; /* Ensures padding doesn't increase the total width */
}

/*
 * Typography
 * ----------
 * Defines styles for headings and text.
 */
h1, h2 {
    color: #004d40; /* Dark teal */
    text-align: center;
    margin-bottom: 10px;
}

h1 {
    font-size: 2em;
}

h2 {
    font-size: 1.5em;
    font-weight: 400;
    color: #00695c; /* Slightly lighter teal */
    border-bottom: 2px solid #b2dfdb; /* Light teal border */
    padding-bottom: 15px;
    margin-bottom: 25px;
}

/*
 * Form Layout
 * -----------
 * Uses CSS Grid to create a responsive, two-column form layout.
 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 25px; /* Spacing between grid items */
}

/*
 * Form Group and Input Styles
 * ---------------------------
 * Styles individual form elements, including labels, inputs, and their states.
 */
.form-group {
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease; /* Smooth transition for disabled state */
}

label {
    margin-bottom: 8px;
    font-weight: 700;
    color: #555;
    transition: color 0.3s ease;
}

input[type="number"], select {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}

input[type="number"]:focus, select:focus {
    border-color: #00796b; /* Teal border on focus */
    box-shadow: 0 0 8px rgba(0, 121, 107, 0.2);
    outline: none;
}

input:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.form-group.disabled {
    opacity: 0.5;
}

.form-group.full-width {
    grid-column: 1 / -1; /* Spans all columns in the grid */
}

/*
 * Button Styles
 * -------------
 * Defines styles for the submit and back buttons, including hover effects.
 */
.submit-btn {
    grid-column: 1 / -1;
    background: linear-gradient(45deg, #00796b, #004d40);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    margin-top: 20px;
    width: 100%; /* Ensure button is full width */
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.back-btn {
    display: inline-block;
    background-color: #004d40;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    margin-top: 20px;
    text-align: center;
    transition: background-color 0.3s;
}

.back-btn:hover {
    background-color: #00695c;
}

/*
 * Result Section Styles
 * ---------------------
 * Styles the output sections for eligible and excluded heirs.
 */
.result-section {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 8px;
}

.result-section.heirs {
    background-color: #e8f5e9; /* Light green */
    border: 1px solid #c8e6c9;
}

.result-section.excluded {
    background-color: #fff3e0; /* Light orange */
    border: 1px solid #ffe0b2;
}

.result-section h3 {
    color: #2e7d32; /* Dark green */
    margin-top: 0;
}

.result-section.excluded h3 {
    color: #ef6c00; /* Dark orange */
}

.result-section p {
    color: #555;
    line-height: 1.6;
}

.result-section ul {
    list-style: none;
    padding: 0;
}

.result-section li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.result-section li:last-child {
    border-bottom: none;
}

/*
 * Mobile Responsive Design
 * ------------------------
 * Adjusts the layout for screens smaller than 600px. The main change is
 * collapsing the grid into a single column.
 */
@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr; /* Single column layout */
    }

    .container {
        padding: 20px; /* Reduced padding on small screens */
    }

    h1 {
        font-size: 1.8em; /* Slightly smaller heading font size */
    }
}