/* ============================================================
   Ameris - Login Page Styles
   Based on new layout template, adapted for Ameris branding.

   Brand palette (extracted from www.ameris.cl):
     Dark navy:      #001883   (CSS --main-color)
     Primary blue:   #004CDC
     Cyan CTA:       #33BFFD
     Teal accent:    #59DBD6
     Brand gradient: linear-gradient(-45deg, #001883, #004CDC, #33BFFD, #59DBD6)
   ============================================================ */

/* Reset and basic styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #fff;
}

/* ---- Layout structure ---- */
#login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Override core container so it fills correctly in split layout */
#core-login-container {
    display: block;
    width: 50%;
    margin: 0;
    padding: 0;
}

.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Original login form - overridden to fit right panel */
#loginForm {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form {
    padding-top: 80px;
    width: 400px;
}

/* ---- Left panel: Ameris brand image / gradient ---- */
/*
 * Drop a brand image file at:
 *   /custom-ameris/images/login_background.jpg
 * and un-comment the background-image line below.
 * Until then a branded gradient is used as placeholder.
 */
.left-panel {
    width: 50%;
    background-color: #001883;
    /* Ameris dark navy fallback */
    background-image:
        /* Santiago cityscape hero photo */
        url('/custom/images/login_background.jpg'),
        linear-gradient(-45deg, #001883 0%, #004CDC 45%, #33BFFD 80%, #59DBD6 100%);
    background-size: cover;
    background-position: center;
    position: relative;
}

.left-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 24, 131, 0.20);
    /* subtle Ameris navy tint over photo */
    z-index: 1;
}

/* ---- Right panel: form area ---- */
.right-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: #ffffff;
}

/* ---- Logo in top-left of left panel ---- */
.logo-container {
    position: absolute;
    top: 28px;
    left: 28px;
    display: flex;
    align-items: center;
    z-index: 10;
}

/*
 * The logo box shows the white tenant_logo.png.
 * Adjust width/height to match the actual Ameris logo proportions.
 */
.logo-box {
    width: 160px;
    height: 45px;
    /* Use MARCA_AMERIS_SOLA_RGB.png if the white-on-dark version is available */
    background-image: url('/custom/images/ameris_logo.png'),
        url('/custom/images/tenant_logo.png');
    /* fallback */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
}

/* ---- "Back to Home" button (top-right of right panel) ---- */
.block-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: 1px solid #004CDC;
    border-radius: 50px;
    padding: 6px 16px;
    color: #004CDC;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.block-button:hover {
    background-color: #004CDC;
    color: #ffffff;
}

/* Hide the original logo element (it is replaced by logo-box) */
.logo {
    display: none !important;
}

/* ---- Login header ---- */
h1 {
    font-size: 32px;
    margin-bottom: 20px;
    font-weight: normal;
    text-align: center;
    color: #001883;
    letter-spacing: 0.5px;
}

/* ---- Form inputs ---- */
.input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    background-color: transparent;
}

.form-control:focus {
    outline: none;
    border-color: #004CDC;
    box-shadow: 0 0 0 3px rgba(0, 76, 220, 0.12);
}

/* Floating label: hide placeholder text when focused or filled */
.form-control:focus::placeholder,
.form-control:not(:placeholder-shown)::placeholder {
    color: transparent;
}

/* Detect Chrome/Edge autofill via animation */
@keyframes onAutoFillStart {
    from {
        /**/
    }

    to {
        /**/
    }
}

input:-webkit-autofill {
    animation-name: onAutoFillStart;
}

        /* Use ~ (general sibling) instead of + (adjacent sibling) because
           password managers like LastPass inject icon elements between the
           input and the floating-label, breaking the adjacent selector. */
        .form-control:focus ~ .floating-label,
        .form-control:not(:placeholder-shown) ~ .floating-label,
        .form-control:-webkit-autofill ~ .floating-label,
        .form-control.autofilled ~ .floating-label {
    top: -10px;
    left: 10px;
    font-size: 12px;
    padding: 0 5px;
    background-color: white;
    color: #004CDC;
}

.floating-label {
    position: absolute;
    left: 15px;
    top: 15px;
    color: #999;
    font-size: 16px;
    transition: all 0.2s ease;
    pointer-events: none;
}

/* ---- Password visibility toggle ---- */
.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    z-index: 1;
}

/* ---- Submit button ---- */
#submit-btn {
    width: 100%;
    padding: 15px;
    background-color: #33BFFD;
    /* Ameris cyan CTA (matches website buttons) */
    border: none;
    border-radius: 50px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease;
}

#submit-btn:hover {
    background-color: #004CDC;
    /* Ameris primary blue on hover */
}

/* ---- Forgot password / footer links ---- */
.form-footer {
    display: flex !important;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    visibility: visible;
}

.form-footer a {
    color: #004CDC;
    text-decoration: none;
    font-size: 14px;
}

.form-footer a:hover {
    text-decoration: underline;
}

.separator {
    color: #999;
    font-size: 14px;
}

/* ---- Validation messages ---- */
.field-validation-message,
.field-validation-error {
    display: block;
    color: #d32f2f;
    font-size: 12px;
    margin-top: 5px;
    margin: 6px 12px;
}

.validation-summary {
    color: #d32f2f;
    margin-bottom: 20px;
}

.validation-summary ul {
    list-style: none;
    padding-left: 0;
}

ul li {
    color: #d32f2f;
}

/* ---- Footer disclaimer ---- */
.disclaimer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 18px 20px;
    font-size: 12px;
    color: #666;
    text-align: center;
    border-top: 1px solid #eee;
    background-color: #ffffff;
}

.disclaimer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 8px;
}

.disclaimer-links a {
    color: #004CDC;
    text-decoration: none;
    font-size: 12px;
}

.disclaimer-links a:hover {
    text-decoration: underline;
}

.disclaimer-text {
    max-width: 800px;
    margin: 0 auto;
    color: #999;
}

/* ---- Responsive design ---- */
@media (max-width: 768px) {
    #login-wrapper {
        flex-direction: column;
    }

    #core-login-container,
    .left-panel {
        width: 100%;
        height: 35vh;
    }

    .right-panel {
        width: 100%;
        min-height: 65vh;
    }

    #loginForm {
        padding: 10px;
    }

    .login-form {
        width: 100%;
        max-width: 380px;
        padding-top: 40px;
    }
}

/* ---- Modal styles ---- */
.modal-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 10px;
    border-bottom: 3px solid #33BFFD;
    /* Ameris cyan accent */
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 10;
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #001883;
    margin: 0;
}

.modal-close {
    font-size: 28px;
    font-weight: 700;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #004CDC;
}

.modal-body {
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

.modal-body h3 {
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 700;
    color: #001883;
}

.modal-body h4 {
    font-size: 15px;
    margin-top: 15px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #004CDC;
}

.modal-body p {
    margin-bottom: 10px;
}

.modal-body ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.modal-body li {
    margin-bottom: 5px;
    color: #333;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        max-height: 90vh;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-body {
        padding: 15px;
    }
}