/* forms.css */
body {
    /*font-family: 'Museo Sans', 'Stevie Sans';*/
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    margin-bottom: -20px;
    padding: 0;
    /*background-color: #c8dae1;*/
    background-color: #e6f3ff !important;
    color: #333;
}

.body-content {
    margin-top: 20px !important;
    padding-top: 10px !important;
}

.home-buttons-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    margin: 2rem auto !important;
    text-align: center !important;
    max-width: 600px !important;
}

.home-button {
    width: 200px !important;
    padding: 1rem !important;
    margin: 0.5rem !important;
    text-align: center !important;
}

.home-button-text {
    text-align: center !important;
    margin: 0.5rem 0 !important;
}

.card {
    height: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

    .card:hover {
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }

.card-body {
    padding: 1.5rem;
}

.card-title {
    text-align: center;
    margin-bottom: 1rem;
}

.card-text {
    text-align: left !important; /* Force left alignment for text */
    font-size: 1.2em; /* equivalent to 16px */
}

.btn-container {
    text-align: center;
}

.jumbotron {
    margin-bottom: 2rem;
}

.alert {
    margin-bottom: 1rem;
}

.alert-dismissible {
    padding-right: 4rem;
}

.btn-close {
    position: absolute;
    right: 0;
    padding: .75rem 1.25rem;
    cursor: pointer;
}
/* Password reset forms */

.form-horizontal {
    background-color: #fffaf0 !important; /* Set background color to floral white */
    color: #333; /* Set text color for better contrast */
    border: 1px solid #ccc; /* Set border color */
    padding: 20px; /* Add padding for better appearance */
    border-radius: 5px; /* Add rounded corners */
    box-sizing: border-box; /* Ensure padding is included in width */
    width: 100%; /* Ensure the form takes the full width */
    margin: 0; /* Remove any default margin */
}

    .form-horizontal h2 {
        margin-bottom: 20px;
        color: #333;
    }

    .form-horizontal .form-group {
        margin-bottom: 15px;
    }

    .form-horizontal .btn-primary {
        margin-top: 10px;
    }

.alert {
    margin: 20px 0;
    padding: 15px;
    border-radius: 5px;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}


/* 1. Common Form Container */

.form-container {
    background-color: #e2e8f0 !important; /* Add back the gray background  floral white: #fffaf0 */
    border-radius: 5px !important;
    padding: 2rem !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    margin-top: -20px;
}

.form-field-container .form-group {
    margin: 0 !important;
}

    /* Reduce the spacing within the form containers */
    .form-container .formset-row {
        margin-bottom: 15px;
    }

    .form-container .form-group {
        margin-bottom: 10px;
    }

.form-title {
    text-align: center !important;
    margin-bottom: 1rem !important;
    font-size: 24px !important;
}

.form-description {
    font-size: 16px !important;
}

label {
    display: block;
    margin-bottom: 0.5rem;
}

/* 1. Base Form Styles */


form {
    width: 90%;
    margin: 0 auto;
    font-size: 1.2em; /* equivalent to 16px */
}

.base-form {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
}

/* 2. Specific Form Layouts */
#UserInfoForm,
#UserRegistrationForm,
#FinancialInfoForm,
#LiabilitiesInfoForm,
#AssetForm {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 3. Future Expenses Form specific styles */
#FutureExpenseForm {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

#future-expenses-container {
    max-width: 800px;
    margin: 0 auto;
}

.expense-row {
    margin-bottom: 20px;
}

.row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.col-md-4 {
    flex: 1;
    margin-right: 20px; /* Add margin to the right for spacing */
}

label {
    font-weight: normal !important;
}

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

/* 4. Form Controls */
.form-control,
select {
    width: 300px;
    padding: 0.5rem 0.75rem;
    height: 38px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 16px;
}

/* 5. Form Groups */
.form-group {
    width: 100%;
    margin-bottom: 1.5rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
    }

/* 6. Button Containers */
.btn-container {
    display: flex !important;
    justify-content: center !important;
    gap: 1rem !important;
    margin-top: 2rem !important;
    width: 100% !important;
}

.button-container, .btn-container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

    /* If you need specific alignment */
    .button-container.center {
        justify-content: center;
    }

    .button-container.spaced {
        justify-content: space-between;
    }

.btn-group-left,
.btn-group-right {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* User Registration */
#UserRegistrationForm {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0; /* Remove default padding */
    margin-top: 40px; /* Remove default margin */
}

#UserRegistrationForm .form-horizontal {
    background-color: #fffaf0 !important; /* Set background color to floral white */
    color: #333; /* Set text color for better contrast */
    border: 1px solid #ccc; /* Set border color */
    padding: 20px; /* Add padding for better appearance */
    border-radius: 5px; /* Add rounded corners */
    box-sizing: border-box; /* Ensure padding is included in width */
    width: 100%; /* Ensure the form takes the full width */
    margin: 0; /* Remove any default margin */
}

/* Login form styles */
#loginForm {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align items to the start (left) */
    padding: 0; /* Remove default padding */
    margin-top: 40px; /* Remove default margin */
}

    #UserRegistrationForm, #loginForm .form-horizontal {
        background-color: #fffaf0 !important; /* Set background color to floral white */
        color: #333; /* Set text color for better contrast */
        border: 1px solid #ccc; /* Set border color */
        padding: 20px; /* Add padding for better appearance */
        border-radius: 5px; /* Add rounded corners */
        box-sizing: border-box; /* Ensure padding is included in width */
        width: 100%; /* Ensure the form takes the full width */
        margin: 0; /* Remove any default margin */
    }

    #loginForm .align-text {
        margin-top: 20px; /* Adjust spacing as needed */
        padding: 0 20px; /* Match the form's padding for alignment */
        width: 100%; /* Match the form's width minus padding */
        box-sizing: border-box; /* Ensure padding is included in width */
    }



/* Asset Form - Two columns with less gap */
#AssetForm .formset-row {
    display: grid !important;
    grid-template-columns: repeat(2, 300px) !important;
    gap: 2rem !important;
    margin-bottom: 1rem !important;
    justify-content: center !important;
    align-items: start !important;
}

#AssetForm label {
    white-space: nowrap; /* Prevents label text from wrapping */
    margin-bottom: 0.5rem; /* Space below the label */
}

/* Income Stream form styling */
.form-container .form-description,
.form-container .form-description p,
#IncomeStreamForm .form-container .form-description p {
    max-width: 600px !important;
    margin: 0 auto 2rem auto !important;
    text-align: left !important;
}

#IncomeStreamForm {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 2rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

        #IncomeStreamForm .row {
        display: flex !important;
        align-items: flex-start !important;
        gap: 1rem !important;
        margin-bottom: 1rem !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: 800px !important;
    }

    /* Individual field widths */
    #IncomeStreamForm .form-field-container:nth-child(1),
    #IncomeStreamForm .form-field-container:nth-child(2) {
        width: 200px !important;
    }

    #IncomeStreamForm .form-field-container:nth-child(3) {
        width: 150px !important;
    }

    #IncomeStreamForm .form-field-container:nth-child(4),
    #IncomeStreamForm .form-field-container:nth-child(5) {
        width: 100px !important;
    }

    /* Form inputs */
    #IncomeStreamForm input,
    #IncomeStreamForm select {
        width: 100% !important;
        box-sizing: border-box !important;
    }

/* Liabilities form centering and layout */
#LiabilitiesInfoForm {
    max-width: 600px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

    #LiabilitiesInfoForm .form-group {
        width: 100% !important;
        max-width: 300px !important;
    }

        #LiabilitiesInfoForm .form-group input,
        #LiabilitiesInfoForm .form-group select {
            width: 100% !important;
            max-width: 400px;
        }

#FinancialHealthForm, #UserInfoForm {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    /* Form inputs */
    #FinancialHealthForm, #UserInfoForm input,
    #FinancialHealthForm, #UserInfoForm select {
        width: 100%;
        max-width: 400px;
    }

#FinancialInfoForm {
    width: 100% !important;
    max-width: 600px !important;
    margin: 0 auto !important;
    box-sizing: border-box;
    
}

    #FinancialInfoForm .form-group {
        display: flex;
        flex-direction: column; /* Ensure the label is above the input */
        width: 300px;
        margin: 0 auto 15px auto;
        padding: .5rem;
        align-items: flex-start;
    }

        #FinancialInfoForm .form-group label {
            width: 100%;
            margin-bottom: 0.5rem; /* Add some space between label and input */
            text-align: left; /* Ensure label text is left aligned */
        }

        #FinancialInfoForm .form-group input {
            width: 100% !important; /* Make input take full width of the form-group */
            box-sizing: border-box; /* Ensure padding is included in width */
        }


/* 9 Utility Classes */

/* Override browser default required indicator */
input:required:invalid,
select:required:invalid,
textarea:required:invalid {
    box-shadow: none !important;
}

/* Override Django's asterisk */
.required:after {
    content: none !important;
}

/* Override any other form asterisk */
.form-control:required::after,
.form-control:required:before {
    display: none !important;
    content: none !important;
}

/* Ensure only one asterisk shows */
label.required:after {
    content: "*" !important;
    color: #333;
    margin-left: 4px;
}

.help-text {
    font-size: 10px !important;
    color: #6b7280 !important;
    margin-top: 0.25rem !important;
    display: block;
}

.hidden {
    display: none !important;
}
