/* ==========================================================================
   Altegra Capital – Login Page Stylesheet
   Adapted from Pivolt/generic template
   ==========================================================================

   COLOUR MAPPING (old → new):
   ───────────────────────────────────────────────────────────────────────────
   Role                  | Old (Pivolt)  | New (Altegra Capital)
   ──────────────────────|───────────────|─────────────────────────────────
   Primary / CTA         | #244C5A       | #BEA167  (warm gold)
   Hover / accent        | #F94B5E       | #3E2F2F  (deep warm brown)
   Focus / floating label| #9EC5E1       | #C6AC79  (muted gold)
   Border / divider      | #E0D3D3       | #E0D3C5  (warm sand)
   Logo bg               | #222          | #1A1410  (near-black warm)
   Left-panel overlay    | rgba(0,0,0,.3)| gradient: #3E2F2F → #BEA167
   Background fallback   | —             | #3E2F2F  (deep brown)
   ───────────────────────────────────────────────────────────────────────────

   HERO IMAGE:
   ───────────────────────────────────────────────────────────────────────────
   Source : Unsplash – Albert Canite
   URL    : https://unsplash.com/photos/5n0xm2FSlQk
   Direct : https://unsplash.com/photos/a-city-at-night-with-a-lot-of-tall-buildings-5n0xm2FSlQk
   License: Unsplash License (free for commercial use)
   ========================================================================== */

.logo {
    background-color: #1A1410;
    padding: 20px;
}

/* 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;
}

/* Hide original container styling */
#core-login-container {
    /* Override any existing styles */
    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;
}

/* Hide original login form and display it properly in right panel */
#loginForm {
    /* Override original styling */
    width: 100%;
    max-width: 500px;
    padding: 20px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form {
    padding-top: 100px;
    width: 400px;
}

/* The left panel with background image */
.left-panel {
    width: 50%;
    /* TO ACTIVATE:
       1. Download: https://unsplash.com/photos/a-city-at-night-with-a-lot-of-tall-buildings-5n0xm2FSlQk
       2. Save as:  /custom/images/login_background.jpg
       3. Uncomment the line below */
    background-image: url('/custom/images/login_background.jpg');
    background-size: cover;
    background-position: center;
    background-color: #3E2F2F;
    position: relative;
}

    .left-panel::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(160deg, rgba(62, 47, 47, 0.85) 0%, rgba(190, 161, 103, 0.55) 100%);
        z-index: 1;
    }

/* The right panel with form */
.right-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Logo in top left */
.logo-container {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    z-index: 10;
}

.logo-box {
    width: 200px;
    height: 46px;
    margin-right: 10px;
    background-image: url('/custom/images/tenant_logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.logo-text {
    color: white;
    font-size: 18px;
    letter-spacing: 3px;
    font-weight: bold;
}

/* Block button */
.block-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: 1px solid #BEA167;
    border-radius: 50px;
    padding: 6px 16px;
    color: #BEA167;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

    /* Hover effect */
    .block-button:hover {
        background-color: #3E2F2F;
        color: white;
        border-color: #3E2F2F;
    }

/* Hide original logo */
.logo {
    display: none !important;
}

/* Login header */
h1 {
    font-size: 32px;
    margin-bottom: 20px;
    font-weight: normal;
    text-align: center;
}

/* Form inputs */
.input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 15px;
    border: 1px solid #E0D3C5;
    border-radius: 4px;
    font-size: 16px;
    background-color: transparent;
}

    .form-control:focus {
        outline: none;
        border-color: #BEA167;
    }

        /* Floating labels using pseudo-elements */
        .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; }

        .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;
        }

.floating-label {
    position: absolute;
    left: 15px;
    top: 15px;
    color: #C6AC79;
    font-size: 16px;
    transition: all 0.2s ease;
    pointer-events: none;
}

/* Password toggle */
.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #C6AC79;
    font-size: 18px;
    z-index: 1;
    transition: color 0.2s ease;
}

    .toggle-password:hover {
        color: #3E2F2F;
    }

/* Submit button */
#submit-btn {
    width: 100%;
    padding: 15px;
    background-color: #BEA167;
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 20px;
    transition: background-color 0.3s ease;
}

    /* Hover effect */
    #submit-btn:hover {
        background-color: #3E2F2F;
    }

/* Form footer links */
.form-footer {
    display: flex !important;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    visibility: visible;
}

    .form-footer a {
        color: #BEA167;
        text-decoration: none;
        font-size: 14px;
    }

        .form-footer a:hover {
            color: #3E2F2F;
            text-decoration: underline;
        }

.separator {
    color: #BEA167;
    font-size: 14px;
}

/* Footer disclaimer */
.disclaimer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    font-size: 12px;
    color: #3E2F2F;
    text-align: center;
    border-top: 1px solid #E0D3C5;
    background-color: white;
}

.disclaimer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

    .disclaimer-links a {
        color: #BEA167;
        text-decoration: none;
        font-size: 12px;
    }

        .disclaimer-links a:hover {
            color: #3E2F2F;
        }

.disclaimer-text {
    max-width: 800px;
    margin: 0 auto;
}

/* Validation messages */
.field-validation-message {
    color: #d32f2f;
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

.validation-summary {
    color: #d32f2f;
    margin-bottom: 20px;
}

    .validation-summary ul {
        list-style: none;
        padding-left: 0;
    }

/* Responsive design */
@media (max-width: 768px) {
    #login-wrapper {
        flex-direction: column;
    }

    #core-login-container,
    .left-panel {
        width: 100%;
        height: 40vh;
    }

    .right-panel {
        width: 100%;
        min-height: 60vh;
    }

    #loginForm {
        padding: 10px;
    }
}


/* 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: white;
    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: 1px solid #E0D3C5;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-title {
    font-size: 24px;
    font-weight: 500;
    margin: 0;
    color: #3E2F2F;
}

.modal-close {
    font-size: 28px;
    font-weight: 700;
    color: #C6AC79;
    cursor: pointer;
    transition: color 0.2s ease;
}

    .modal-close:hover {
        color: #3E2F2F;
    }

.modal-body {
    padding: 20px;
    line-height: 1.6;
}

    .modal-body h3 {
        font-size: 20px;
        margin-bottom: 10px;
        font-weight: 600;
    }

    .modal-body h4 {
        font-size: 16px;
        margin-top: 15px;
        margin-bottom: 10px;
        font-weight: 600;
    }

    .modal-body p {
        margin-bottom: 10px;
    }

    .modal-body ul {
        margin-left: 20px;
        margin-bottom: 10px;
    }

    .modal-body li {
        margin-bottom: 5px;
    }

/* Responsive styles for modal */
@media (max-width: 768px) {
    .modal-content {
        max-height: 90vh;
    }

    .modal-title {
        font-size: 20px;
    }

    .modal-body {
        padding: 15px;
    }
}
