/* Ensures proper mobile rendering */
* {
    box-sizing: border-box;
}

/* Viewport adjustment for mobile */
@media (max-width: 576px) {
    html {
        font-size: 16px; /* Ensures base font size is consistent */
    }
}

body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    min-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Form container styling */
form {
    background-color: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 700px; /* Reduced from 1000px to 700px for better desktop balance */
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

.logo {
    display: block;
    margin: 0 auto 2rem;
    max-width: 200px;
}

/* Headings */
h1, .h3 {
    color: #00A651;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
}

.font-weight-normal {
    font-weight: 400;
}

/* Spacing utilities */
.mb-3 {
    margin-bottom: 1rem !important;
}

/* Form elements */
label {
    margin-bottom: 0.5rem;
    color: #333333;
    display: block;
    font-weight: 500;
    font-size: 1.1rem;
}

.form-control {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid #DFE3E7;
    border-radius: 6px;
    width: 100%;
    font-size: 1.1rem;
    line-height: 1.5;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #00A651;
    outline: 0;
    box-shadow: 0 3px 8px 0 rgba(0,0,0,.1);
}

/* Checkbox styling */
.checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Button styling */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.267rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
}

.btn-primary {
    background-color: #00A651;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #008541;
}

.btn-lg {
    padding: 0.8rem 1.2rem;
    font-size: 1.2rem;
    line-height: 1.5;
    border-radius: 6px;
    width: 100%;
    margin-top: 1.5rem;
    max-width: 50%;
    margin-left: auto;
    margin-right: auto;
}

/* Auth links */
.auth-links {
    text-align: center;
    margin-top: 1rem;
}

.auth-links a, a {
    color: #007BFF;
    text-decoration: none;
}

.auth-links a:hover, a:hover {
    text-decoration: underline;
}

/* Alert messages */
.alert {
    position: relative;
    border: none;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
    font-weight: 400;
    width: 100%;
}

.alert p {
    margin-bottom: 0;
}

.alert button.close {
    padding: 0.75rem;
    line-height: 0.75;
    position: absolute;
    top: 0;
    right: 0;
    color: inherit;
}

.alert .alert-heading {
    margin-left: 0.4rem;
    font-weight: 600;
}

.alert .alert-heading + p {
    margin-left: 0.4rem;
}

/* Alert variants from variables */
.alert-primary {
    background-color: #029eff;
    color: #fff;
    box-shadow: 1px 2px 9px rgba(2, 158, 255, 0.3);
}

.alert-primary a {
    color: #fff;
    text-decoration: underline;
}

.alert-secondary {
    background-color: #ebeef3;
    color: #383d41;
    box-shadow: 1px 2px 9px rgba(235, 238, 243, 0.3);
}

.alert-secondary a {
    color: #383d41;
    text-decoration: underline;
}

.alert-success {
    background-color: #39DA8A;
    color: #fff;
    box-shadow: 1px 2px 9px rgba(57, 218, 138, 0.3);
}

.alert-success a {
    color: #fff;
    text-decoration: underline;
}

.alert-warning {
    background-color: #fdd347;
    color: #fff;
    box-shadow: 1px 2px 9px rgba(253, 211, 71, 0.3);
}

.alert-warning a {
    color: #fff;
    text-decoration: underline;
}

.alert-danger {
    background-color: #f55260;
    color: #fff;
    box-shadow: 1px 2px 9px rgba(245, 82, 96, 0.3);
}

.alert-danger a {
    color: #fff;
    text-decoration: underline;
}

.alert-dark {
    background-color: #454546;
    color: #fff;
    box-shadow: 1px 2px 9px rgba(69, 69, 70, 0.3);
}

.alert-dark a {
    color: #fff;
    text-decoration: underline;
}

.alert-light {
    background-color: #fefefe;
    color: #818182;
    box-shadow: 1px 2px 9px rgba(254, 254, 254, 0.3);
}

.alert-light a {
    color: #818182;
    text-decoration: underline;
}

.alert-info {
    background-color: #56b6f7;
    color: #fff;
    box-shadow: 1px 2px 9px rgba(86, 182, 247, 0.3);
}

.alert-info a {
    color: #fff;
    text-decoration: underline;
}

/* Light alert variants */
.alert-light-primary {
    background-color: #E2ECFF;
    color: #00a859;
}

.alert-light-secondary {
    background-color: #E6EAEE;
    color: #475F7B;
}

.alert-light-success {
    background-color: #D2FFE8;
    color: #39DA8A;
}

.alert-light-danger {
    background-color: #FFDEDE;
    color: #FF5B5C;
}

.alert-light-warning {
    background-color: #FFEED9;
    color: #FF5B5C;
}

.alert-light-info {
    background-color: #CCF5F8;
    color: #00CFDD;
}

/* Color utility classes */
.color-primary {
    color: #00a859;
}

.color-secondary {
    color: #475F7B;
}

.color-success {
    color: #39DA8A;
}

.color-danger {
    color: #FF5B5C;
}

.color-warning {
    color: #FF5B5C;
}

.color-info {
    color: #00CFDD;
}

.color-dark {
    color: #222f3e;
}

.color-light {
    color: #A3AFBD;
}

.color-link {
    color: #2178d1;
}

/* Additional responsive adjustments */
@media (min-width: 1500px) {
    form {
        max-width: 750px; /* Slight increase for very large screens */
    }
}

@media (max-width: 1100px) {
    form {
        max-width: 80%;
        padding: 2.5rem;
    }
}

@media (max-width: 768px) {
    form {
        max-width: 90%;
        padding: 2rem;
    }

    h1, .h3 {
        font-size: 1.7rem;
    }

    .btn-lg {
        max-width: 70%;
    }
}

@media (max-width: 576px) {
    body, html {
        align-items: flex-start;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    form {
        max-width: 95%;
        padding: 1.5rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .form-control {
        padding: 0.8rem;
        font-size: 1rem;
    }

    label {
        font-size: 1rem;
    }

    h1, .h3 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .btn-lg {
        padding: 0.7rem;
        font-size: 1.1rem;
        max-width: 100%;
    }

    .alert {
        padding: 0.6rem 1rem;
    }
}