/* Tenant Login Page Styles - Sahal Systems Branding */
/* This CSS targets the website login page */

/* Full page styling when login page is detected */
html, body {
    min-height: 100%;
}

/* When on the login page, restyle the entire page */
body:has(.oe_website_login_container) {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
    min-height: 100vh;
}

/* Create header branding */
body:has(.oe_website_login_container) #wrapwrap::before {
    content: "Sahal360\A Enterprise Resource Planning Solutions";
    white-space: pre-line;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    z-index: 1000;
    line-height: 1.5;
}

/* Add footer */
body:has(.oe_website_login_container) #wrapwrap::after {
    content: "Powered by Sahal360 - Enterprise Solutions for Modern Businesses";
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    text-align: center;
    z-index: 1000;
}

/* Adjust main content area */
body:has(.oe_website_login_container) #wrapwrap {
    padding-top: 100px;
    padding-bottom: 60px;
}

body:has(.oe_website_login_container) main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 160px);
    padding: 20px;
}

/* Style the login container */
body:has(.oe_website_login_container) .oe_website_login_container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    padding: 40px;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

/* Add "Welcome Back" header */
body:has(.oe_website_login_container) .oe_website_login_container::before {
    content: "Welcome Back";
    display: block;
    color: #1a1a2e;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 25px;
}

/* Hide structure divs */
body:has(.oe_website_login_container) .oe_structure {
    display: none !important;
}

/* Hide owl-component user switch */
body:has(.oe_website_login_container) owl-component[name="web.user_switch"] {
    display: none !important;
}

/* Style the form */
body:has(.oe_website_login_container) .form-control {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

body:has(.oe_website_login_container) .form-control:focus {
    border-color: #0f3460;
    box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1);
}

body:has(.oe_website_login_container) .btn-primary {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

body:has(.oe_website_login_container) .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15, 52, 96, 0.3);
}

/* Form labels */
body:has(.oe_website_login_container) .form-label {
    color: #4a5568;
    font-weight: 500;
}

/* Hide OAuth and passkey options */
body:has(.oe_website_login_container) .o_login_auth {
    display: none !important;
}

/* Make login form visible */
body:has(.oe_website_login_container) .oe_login_form {
    display: block !important;
}

/* Style password reset link */
body:has(.oe_website_login_container) .btn-link {
    color: #0f3460;
    font-size: 0.85rem;
}

body:has(.oe_website_login_container) .btn-link:hover {
    color: #16213e;
}

/* Password toggle button */
body:has(.oe_website_login_container) .input-group .btn {
    border-color: #e2e8f0;
}

body:has(.oe_website_login_container) .o_show_password {
    background: transparent;
}

/* Alert styles */
body:has(.oe_website_login_container) .alert {
    border-radius: 10px;
}

/* Session-expired notice. The dark login theme flattens every .alert to the same
   grey, which makes a warning indistinguishable from an error; give this one an
   amber accent and make sure long text wraps inside the card instead of spilling
   over the footer. */
body:has(.oe_website_login_container) .alert.tm_session_expired {
    background: rgba(240, 173, 78, 0.12);
    border: 1px solid rgba(240, 173, 78, 0.45);
    border-left: 3px solid #f0ad4e;
    color: #f3d19e;
    font-size: 0.9rem;
    line-height: 1.45;
    padding: 12px 14px;
    margin-bottom: 18px;
    overflow-wrap: anywhere;
    box-sizing: border-box;
    max-width: 100%;
}

/* Hide website header, footer, and navigation on login page */
body:has(.oe_website_login_container) header#top,
body:has(.oe_website_login_container) header#top *,
body:has(.oe_website_login_container) footer#bottom,
body:has(.oe_website_login_container) footer#bottom * {
    display: none !important;
}

/* Tenant login page specific styles (for suspended page) */
.tenant-login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.tenant-header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 25px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tenant-brand-title {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.tenant-tagline {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin-top: 8px;
    margin-bottom: 0;
}

.tenant-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.login-card h2 {
    color: #1a1a2e;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
}

.tenant-footer {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tenant-footer p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    font-size: 0.9rem;
}

.tenant-footer .small-text {
    margin-top: 5px;
    font-size: 0.8rem;
}

.tenant-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.tenant-footer a:hover {
    color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    body:has(.oe_website_login_container) #wrapwrap::before {
        font-size: 1.4rem;
        padding: 15px 10px;
    }

    body:has(.oe_website_login_container) .oe_website_login_container {
        padding: 30px 20px;
        margin: 10px;
    }

    .tenant-brand-title {
        font-size: 1.6rem;
    }

    .tenant-tagline {
        font-size: 0.9rem;
    }
}
