/* Login.css - the login page: centred white box, boxes, Sign In button, eye icon.
   Uses: Site.css (loads first; defines .login-container, .btn and the fonts); background picture in wwwroot/Images.
   Used by: Views/Login/Index.cshtml; Scripts/COIDA/Login.js adds the class "showing" to the eye icon. */

/* Centres everything and makes the page at least window height; Inter font from Site.css with system fallback. */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    font-family: 'InterRegular', system-ui, 'Segoe UI', Arial, sans-serif;
    font-synthesis: weight;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Background picture; "#body" is the id only the login page sets (ViewData["BodyId"]). Check the file name matches wwwroot/Images. */
#body {
    background-image: url('../Images/SHEQEasyLoginBackground.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

/* White card, wider than the Site.css default. */
.login-container {
    width: 340px;
    padding: 34px 30px;
}

/* Red message under a box (usernameError / passwordError). */
.error-message {
    display: block;
    color: #dc3545;
    font-size: 13px;
    font-weight: 600;
    margin-top: 5px;
    text-align: center;
    padding-left: 5px;
}

/* "Login" heading. */
.login-title {
    display: block;
    font-size: 24px;
    font-weight: 800 !important;
    letter-spacing: 0.3px;
    color: #1E2B3C;
}

/* "Username" / "Password" labels; negative margin pulls them close to their box. */
.login-label {
    display: block;
    font-size: 14px;
    font-weight: 700 !important;
    margin-bottom: -8px;
    color: #1E2B3C;
    text-align: left;
}

/* The two boxes; "input.login-input" is more specific than Site.css's plain input rules, so these win. */
input.login-input {
    width: 100%;
    height: 46px;
    margin: 4px 0 12px;
    padding: 7px 9px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #F3F4F6;
    text-align: left;
    box-sizing: border-box;
    font-family: 'InterRegular', system-ui, 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #1E2B3C;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Typing: orange border, white background. */
input.login-input:focus {
    border-color: #FF4D00;
    background: #fff;
}

/* Wraps the password box and eye icon; relative so the icon can sit inside the right edge. */
.password-wrap {
    position: relative;
    margin: 4px 0 12px;
}

/* Right padding keeps typed text out from under the eye. */
.password-wrap input.login-input {
    margin: 0;
    padding-right: 48px;
}

/* Sign In button: full width, navy; !important beats the !important font size in Site.css. */
.login-btn {
    width: 100% !important;
    min-height: 46px;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: #1E2B3C;
    color: #fff;
    font-size: 16px !important;
    font-weight: 700 !important;
}

/* Orange on hover. */
.login-btn:hover {
    background: #FF4D00;
    color: #fff;
}

/* "Forgot Password?" link. */
.login-links {
    font-size: 14px;
    font-weight: 700 !important;
    color: #3B6CB7;
}

.login-links:hover {
    color: #3B6CB7;
    text-decoration: underline;
}

/* Eye icon: centred vertically, near the right edge, above the box. */
#togglePassword {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    cursor: pointer;
    color: #555;
    line-height: 0;
    transition: color 0.3s ease;
}

#togglePassword:hover {
    color: #1E2B3C;
}

/* Both eye pictures: 20px, drawn in the text colour. */
#togglePassword svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

    /* The slash is hidden by default (open eye). */
    #togglePassword .eye-slash {
        display: none;
    }

    /* Login.js adds "showing" when the password is visible: draw the slash. */
    #togglePassword.showing .eye-slash {
        display: inline;
    }

/* Reduced-motion devices: no fade. */
@media (prefers-reduced-motion: reduce) {
    #togglePassword {
        transition: none;
    }
}

/* High-contrast devices: black icon. */
@media (prefers-contrast: high) {
    #togglePassword {
        color: #000;
    }
}
