/* =========================
    CSS Variables for Consistency
========================= */
:root {
    --primary-color: #0B1E4A;
    --secondary-color: #C03995;
    --hover-color: #CE1AA5;
    --background-color: #FFFFFF;
    --input-background: #F2F3F6;
    --input-border: #D1D1D1;
    --error-color: #BA0D0D;
    --font-family: 'Segoe UI', sans-serif;
    --font-color: #4E535D;
    --light-color: #4E535D; /* Added missing variable */
    --link-color: #1E4397;
    --link-hover-color: #CE1AA5;
    --shadow-color: rgba(0, 0, 0, 0.25);
    --footer-color: #000000;
    --text-muted: rgba(0, 0, 0, 0.47);
    --border-radius: 14px;
    --button-border-radius: 32px;
    --transition-duration: 0.2s; /* Reduced for faster animations */
    --tooltip-bg: rgba(0, 0, 0, 0.85); /* Slightly darker for better contrast */
    --tooltip-color: #FFFFFF;
    --spinner-overlay-bg: rgba(240, 244, 248, 0.95); /* Increased opacity for better visibility */
}

/* =========================
    Global Styles
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--font-color);
}

/* =========================
    Background Overlay Styling
========================= */
.background-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    background: url('/content/login/lspbackgrounds-03.png') no-repeat center center / cover;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-duration) ease;
}

/* =========================
    Tooltip Styling
========================= */
.tooltip {
    position: absolute;
    background-color: var(--tooltip-bg);
    color: var(--tooltip-color);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    display: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    white-space: nowrap;
}

    /* Tooltip Arrow Pointing Upwards (Default) */
    .tooltip::after {
        content: "";
        position: absolute;
        border-width: 6px 6px 0 6px;
        border-style: solid;
        border-color: var(--tooltip-bg) transparent transparent transparent;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
    }

/* Tooltip Arrow Pointing Downwards */
.tooltip-bottom::after {
    content: "";
    position: absolute;
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent var(--tooltip-bg) transparent;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
}

/* Tooltip Positioning */
.tooltip-top {
    transform: translateY(-10px);
}

.tooltip-bottom {
    transform: translateY(10px);
}

/* =========================
    Header Bar Styling
========================= */
.header-bar {
    position: absolute;
    top: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 2;
    background: linear-gradient(180deg, #BAC1CE 0%, rgba(217, 217, 217, 0) 100%);
}

/* Logo Container Styling */
.logo-container {
    width: 200px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity var(--transition-duration) ease, transform var(--transition-duration) ease;
}

    .logo-container img {
        width: 100%;
        height: auto;
        display: block;
        cursor: default;
    }

    .register-buttons {
    display: flex;
    gap: 8px;
}

/* Sign-Up Button Styling */
.btn-sign-up {
    padding: 10px 20px;
    background: var(--primary-color);
    border-radius: var(--button-border-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 600;
    transition: background var(--transition-duration) ease, transform var(--transition-duration) ease, box-shadow var(--transition-duration) ease;
    opacity: 0;
    transform: scale(0.9);
    position: relative;
}

    .btn-sign-up:hover,
    .btn-sign-up:focus {
        background: var(--hover-color);
        transform: scale(1.02);
        box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    }

    .btn-sign-up:focus {
        outline: 2px solid #C03995;
    }

/* =========================
    Main Content Styling
========================= */
.main-content {
    position: relative;
    flex: 1;
    display: flex;
    padding: 20px;
    justify-content: center;
    align-items: center;
    margin-top: 80px;
}

/* =========================
    Login Form Container Styling
========================= */
.login-form-container {
    width: 400px;
    background: var(--background-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 0 10px var(--shadow-color);
    text-align: center;
    z-index: 1;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity var(--transition-duration) ease, transform var(--transition-duration) ease;
    position: relative;
}

/* Form Header Styling */
.form-header {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-color);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity var(--transition-duration) ease, transform var(--transition-duration) ease;
}

/* Label Field Styling */
.label-field {
    display: block;
    font-weight: 700;
    font-size: 12px;
    text-align: left;
    color: var(--light-color);
    margin-bottom: 5px;
    position: relative;
    cursor: pointer;
}

    .label-field i {
        margin-left: 5px;
        color: #888;
        cursor: pointer;
        transition: color 0.2s ease;
    }

        .label-field i:hover,
        .label-field i:focus {
            color: var(--hover-color);
        }

/* Input Container Styling */
.input-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

/* Input Field Styling */
.input-field {
    width: 100%;
    height: 45px;
    padding: 10px 40px 10px 10px;
    margin-bottom: 10px;
    background: var(--input-background);
    border-radius: 8px;
    border: 1px solid var(--input-border);
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    color: var(--font-color);
    box-sizing: border-box;
}

input.input-field:disabled {
    color: #a7a7a7;
}

/* Adjust padding for password field to accommodate the toggle icon */
#password {
    padding-right: 40px;
}

/* Input Field Focus Styling */
.input-field:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 15px rgba(192, 57, 149, 0.4);
    transform: scale(1.02);
}

/* Error State Styling for Input Fields */
.input-field.error {
    border: 1px solid var(--error-color);
    background-color: #FDEDEC;
}

/* Password Visibility Toggle Styling */
.password-toggle {
    position: absolute;
    right: 10px;
    cursor: pointer;
    font-size: 18px;
    color: #888;
    transition: color 0.2s ease;
    z-index: 2;
}

    .password-toggle:hover,
    .password-toggle:focus {
        color: var(--hover-color);
    }

    .password-toggle:focus {
        outline: 2px solid #C03995;
    }

/* Error Message Styling */
.error-message {
    color: var(--error-color);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    margin-bottom: 10px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
}

    .error-message.active {
        visibility: visible;
        opacity: 1;
    }

/* Submit Button Styling */
.btn-submit {
    width: 100%;
    height: 45px;
    background-color: var(--secondary-color);
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #FFFFFF;
    cursor: pointer;
    transition: background var(--transition-duration) ease, transform var(--transition-duration) ease, box-shadow var(--transition-duration) ease;
    opacity: 0;
    transform: scale(0.9);
    position: relative;
}

    .btn-submit:hover:enabled {
        background-color: #a0317d;
        box-shadow: 0px 4px 12px rgba(192, 57, 149, 0.4);
    }

    .btn-submit:active {
        transform: scale(0.98);
        background-color: #8e2a6d;
    }

    .btn-submit:disabled {
        background-color: #D873B0;
        cursor: not-allowed;
    }

/* "Not You?" Button Container Styling */
.not-you-container {
    text-align: left;
    opacity: 0;
    display: none;
    transition: opacity 0.1s ease; /* Reduced duration for instant appearance */
    margin-bottom: 10px; /* Adjusted margin for less spacing */
}

    .not-you-container button {
        background: none;
        border: none;
        color: var(--secondary-color);
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        transition: color 0.2s ease;
    }

        .not-you-container button:hover,
        .not-you-container button:focus {
            color: #A1287C;
            text-decoration: underline;
        }

/* Help Sections Styling */
.help-section {
    margin-top: 20px;
    display: none;
    opacity: 0;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    transition: opacity 0.2s ease, height 0.2s ease;
}

    .help-section.active {
        display: flex;
        opacity: 1;
        height: auto;
    }

.help-column {
    background: var(--input-background);
    border-radius: var(--border-radius);
    box-shadow: 0px 0px 10px var(--shadow-color);
    padding: 20px;
    width: 48%;
}

    .help-column h3 {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 10px;
        color: var(--light-color);
        font-family: var(--font-family);
    }

    .help-column a {
        color: var(--link-color);
        text-decoration: none;
        transition: color 0.2s ease;
        font-family: var(--font-family);
        font-weight: 600;
        line-height: 24px;
        display: block;
        margin-top: 5px;
        font-size: 13px;
    }

        .help-column a:hover,
        .help-column a:focus {
            text-decoration: underline;
            color: var(--link-hover-color);
        }

/* Spinner Overlay Styling */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--spinner-overlay-bg);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    text-align: center;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--secondary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 0.4s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Shake Animation for Error Indication */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }
}

.shake {
    animation: shake 0.2s;
}

/* Footer Styling */
.footer {
    position: relative;
    margin-top: auto;
    margin-left: 20px;
    font-size: 1rem;
    color: var(--footer-color);
    z-index: 10;
}

.footer-logo-container img[src=""],
.footer-logo-container img:not([src]) {
    display: none;
}

.hubspot-section {
    position: fixed;
    bottom: 10px;
    width: 600px;
    height: 90px;
    text-align: center;
    max-width: 100%;
}

/* =========================
    Responsive Design Enhancements
========================= */
@media screen and (max-width: 1200px) {
    /* Adjust header padding for tablets */
    .header-bar {
        padding: 0 20px;
    }
}

@media screen and (max-width: 768px) {
    /* Adjust Login Form Container for Mobile */
    .login-form-container {
        width: 90%;
        padding: 20px;
    }

    /* Adjust Header Bar for Mobile */
    .header-bar {
        flex-direction: column;
        height: auto;
        padding: 20px;
    }

    .logo-container {
        width: 150px;
        margin-bottom: 10px;
    }

    .help-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .help-column {
        width: 100%;
        margin-bottom: 20px;
    }

    .hubspot-section {
        bottom: 50px;
    }
}

/* Additional Media Query for Very Small Devices (e.g., iPhone 13 & 14) */
@media screen and (max-width: 390px) {

    .main-content {
        margin-top: 100px; 
    }

    /* Adjust Background Overlay */
    .background-overlay {
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
        background: url('/content/login/lspbackgrounds-03.png') no-repeat center center / cover;
    }

    /* Adjust Sign-Up Button */
    .btn-sign-up {
        width: 101px;
        height: 31px;
        background: var(--primary-color);
        border: 1px solid rgba(0, 0, 0, 0.09);
        border-radius: var(--button-border-radius);
        padding: 6px 10px;
        font-size: 14px;
    }

    /* Adjust Login Form Container */
    .login-form-container {
        position: relative;
        width: 90%;
        max-width: 400px;
        height: auto;
        margin: 100px auto 20px auto;
        top: auto;
        background: #F2F3F6;
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.25);
        border-radius: 14px;
        padding: 20px;
        transform: none;
        opacity: 1;
    }

    /* Adjust Form Header */
    .form-header {
        font-size: 24px;
        font-weight: 600;
        margin-bottom: 20px;
        color: #000000;
        text-align: center;
        transform: none;
        opacity: 1;
    }

    /* Adjust Username Label */
    .label-field {
        font-size: 10px;
        line-height: 13px;
        color: var(--light-color);
        margin-bottom: 5px;
        cursor: pointer;
    }

    /* Adjust Username Input */
    .input-container {
        position: relative;
        width: 100%;
        display: flex;
        align-items: center;
    }

    .input-field {
        width: 100%;
        height: 42px;
        padding: 10px 35px 10px 10px;
        margin-bottom: 10px;
        background: #F2F3F6;
        border-radius: 14px;
        border: 1px solid #D1D1D1;
        font-size: 14px;
        transform: none;
        opacity: 1;
    }

    /* Adjust Password Toggle */
    .password-toggle {
        margin-left: -25px;
        font-size: 18px;
    }

    /* Adjust Submit Button */
    .btn-submit {
        width: 100%;
        height: 43px;
        background: var(--secondary-color);
        border-radius: 14px;
        font-size: 18px;
        font-weight: 600;
        color: #FFFFFF;
        cursor: pointer;
        transition: background var(--transition-duration) ease, transform 0.2s ease, box-shadow var(--transition-duration) ease;
        opacity: 1;
        transform: none;
    }

    /* Adjust Placeholder Text */
    .input-field::placeholder {
        color: rgba(0, 0, 0, 0.47);
        font-family: 'Segoe UI', sans-serif;
        font-style: normal;
        font-weight: 400;
        font-size: 14px;
        line-height: 19px;
    }

    /* Adjust Help Section (if needed) */
    .help-section {
        /* Add specific styles if required */
    }

    .help-column {
        padding: 5px;
    }
}
