/* Change autocomplete styles in WebKit */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    border-top-color: #ffffff !important;
    -webkit-text-fill-color: #1a1a1a;
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset;
    transition: background-color 5000s ease-in-out 0s;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
}

html body {
    font-size: 1.1rem;
    margin: 0;
    padding: 0;
    font-family: "Open-Sans", "Segoe UI Regular", "Helvetica", "Sans-serif";
}

/* Modern Split Screen Layout */
.stsLoginInPanel {
    display: flex;
    flex-direction: row-reverse; /* Right to Left */
    height: 100vh;
    overflow: hidden;
}

/* Right Side - Login Form */
.login-container {
    flex: 0 0 45%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.support-info {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
}

.support-info p {
    color: #6c757d;
    font-size: 1.3rem;
    margin: 0;
}

.support-info a {
    color: rgb(0, 119, 139);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.support-info a:hover {
    color: rgb(0, 95, 111);
    text-decoration: underline;
}


.stsHeader {
    flex-shrink: 0;
    height: 85px;
    background: linear-gradient(135deg, rgb(0, 119, 139) 0%, rgb(0, 95, 111) 100%);
    box-shadow: 0 3px 10px rgba(0, 119, 139, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stsMainLogo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Password container */
.stsPasswordPlaceHolder {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.stsPasswordPlaceHolder .input-control {
    width: 100%;
    padding-right: 50px; /* room for the eye icon */
    box-sizing: border-box;
}

/* Eye icon container - positioned relative to input, not container */
.eye-icon {
    position: absolute;
    top: calc(32px + 23px); /* label height (8px margin + 24px text) + half of input height (46px / 2) */
    right: 16px;
    transform: translateY(-50%);
    cursor: pointer;
    display: inline-block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 10;
}

/* Gray eye (default) */
.eye-open {
    background-image: url('data:image/svg+xml;utf8,<svg fill="gray" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 12.5c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>');
}

/* Blue eye - active state */
.eye-open.blue {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%2300778B" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 12.5c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>');
}

/* Gray closed eye */
.eye-closed {
    background-image: url('data:image/svg+xml;utf8,<svg fill="gray" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24"><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>');
}

/* Blue closed eye - active state */
.eye-closed.blue {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%2300778B" xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24"><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>');
}

.logo-icon {
    width: 250px;
    height: 50px;
    background: url('Platinum2/Images/Icons/DesignerHome/SAR Logo.png') center center no-repeat,
                rgba(255, 255, 255, 0.95);
    background-size: 80%; /* adjust size */
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display:block;
    padding-bottom:5px;
}

.logo-text {
    text-align: center;
    color: white;
}

.logo-text h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.2;
}

.logo-text p {
    font-size: 1rem;
    margin: 2px 0 0 0;
    font-weight: 500;
    letter-spacing: 1.5px;
    opacity: 0.95;
    padding-top: 5px;
    padding-bottom: 5px;
}

.stsMain {
    flex: 1;
    overflow: auto;
    background: linear-gradient(to bottom, #ffffff 0%, #f5f8fa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.layout-table {
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
}

.stsLoginDetails {
    width: 100%;
    padding: 45px 40px;
    background: #ffffff;
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-header h2 {
    font-size: 2.6rem;
    color: #1a1a1a;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-header p {
    color: #6c757d;
    font-size: 1.4rem;
}

.stsLoginUserNamePlaceHolder {
    position: relative;
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 1.4rem;
    font-weight: 500;
}

.input-control {
    color: #1a1a1a;
    font-family: inherit;
    font-style: normal;
    background-color: #f8f9fa;
    box-sizing: border-box;
    min-height: 46px;
    width: 100%;
    font-size: 1.5rem;
    padding: 14px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.input-control::placeholder {
    color: #6c757d;
    font-style: normal;
    opacity: 1;
}

.input-control:focus {
    border-color: rgb(0, 119, 139);
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 119, 139, 0.1);
}

.input-control.invalid {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.validation-error {
    font-family: inherit;
    padding-top: 8px;
    font-size: 1.2rem;
    text-align: left;
    color: #dc3545;
    font-weight: 500;
}

.forgot-password-link {
    text-align: left;
    margin-bottom: 20px;
}

.forgot-password-link a {
    color: rgb(0, 119, 139);
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password-link a:hover {
    color: rgb(0, 95, 111);
    text-decoration: underline;
}

.stsSignInButton {
    text-align: center;
    margin-top: 8px;
}

.stsSignInButton .button {
    font-family: inherit;
    text-transform: uppercase;
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-overflow: ellipsis;
    color: #FFFFFF;
    display: inline-block;
    background: linear-gradient(135deg, rgb(0, 119, 139) 0%, rgb(0, 95, 111) 100%);
    box-sizing: border-box;
    margin: 0 auto;
    width: 100%;
    height: 50px;
    line-height: 50px;
    padding: 0 28px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 119, 139, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.stsSignInButton .button:hover {
    background: linear-gradient(135deg, rgb(0, 95, 111) 0%, rgb(0, 75, 88) 100%);
    box-shadow: 0 6px 16px rgba(0, 119, 139, 0.4);
    transform: translateY(-2px);
}

.stsSignInButton .button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 119, 139, 0.25), 0 4px 12px rgba(0, 119, 139, 0.3);
}

.stsSignInButton .button.disabled {
    color: #ffffff;
    background: #adb5bd;
    border: none;
    pointer-events: none;
    box-shadow: none;
    transform: none;
}

.create-account {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e1e8ed;
}

.create-account p {
    color: #6c757d;
    font-size: 1.4rem;
}

.create-account a {
    color: rgb(0, 119, 139);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.create-account a:hover {
    color: rgb(0, 95, 111);
    text-decoration: underline;
}

/* Left Side - Image */
.image-section {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgb(0, 119, 139) 0%, rgb(0, 95, 111) 100%);
}

.image-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 119, 139, 0.85) 0%, rgba(0, 95, 111, 0.9) 100%);
    z-index: 1;
}

.building-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.95);
}

.image-overlay {
    position: absolute;
    bottom: 60px;
    right: 60px;
    left: 60px;
    z-index: 2;
    color: white;
    text-align: left;
}

.image-overlay h3 {
    font-size: 4.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.image-overlay p {
    font-size: 1.8rem;
    line-height: 1.6;
    opacity: 0.95;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media only screen and (max-width: 1024px) {
    .login-container {
        flex: 0 0 50%;
    }

    .image-overlay h3 {
        font-size: 3.6rem;
    }

    .image-overlay p {
        font-size: 1.6rem;
    }
}

@media only screen and (max-width: 768px) {
    .stsLoginInPanel {
        flex-direction: column;
    }

    .login-container {
        flex: 1;
        width: 100%;
    }

    .image-section {
        display: none;
    }

    .stsMain {
        padding: 20px;
    }

    .stsLoginDetails {
        padding: 30px 25px;
    }

    .login-header h2 {
        font-size: 2.2rem;
    }

    .stsHeader {
        height: 80px;
    }

    .logo-icon {
        width: 225px;
        height: 45px;
    }

    .logo-text h1 {
        font-size: 1.8rem;
    }

    .logo-text p {
        font-size: 1rem;
    }
}

@media only screen and (max-width: 374px) {
    .stsLoginDetails {
        padding: 25px 20px;
    }

    .input-control {
        font-size: 1.3rem;
        min-height: 40px;
        padding: 11px 12px;
    }

    .stsSignInButton .button {
        font-size: 1.4rem;
        height: 46px;
        line-height: 46px;
    }
    
    .eye-icon {
        top: calc(32px + 20px); /* Adjust for smaller input on mobile */
    }
}

/* Loading Animation */
.stsSignInButton .button.loading {
    pointer-events: none;
    opacity: 0.8;
    position: relative;
}

.stsSignInButton .button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Don't show IE's clear and reveal buttons */
.input-control::-ms-clear,
.input-control::-ms-reveal {
    display: none;
}