/* Split-Screen Login & Signup Pages - Walmart Style Design */

/* Reset and base styles */
body.auth-page {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* Hide Odoo header and footer on auth pages */
body.auth-page header,
body.auth-page footer,
body.auth-page #wrapwrap > header,
body.auth-page #wrapwrap > footer {
    display: none !important;
}

/* Hide any duplicate titles and content that might come from parent templates */
body.auth-page .auth-form-card h2,
body.auth-page .auth-form-card h3,
body.auth-page .auth-form-card .text-center.pb-3.border-bottom,
body.auth-page .auth-form-card > h1:not(.auth-title),
body.auth-page .auth-form-card > h2:not(.auth-title),
body.auth-page .oe_signup_form > h1:not(.auth-title),
body.auth-page .oe_signup_form > h2:not(.auth-title),
body.auth-page form + h1,
body.auth-page form + h2,
body.auth-page .oe_signup_form::before,
body.auth-page .oe_login_form::before {
    display: none !important;
    content: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide default Odoo field labels and form groups that come from parent */
body.auth-page .form-group.field-portal-role,
body.auth-page .field-portal-role,
body.auth-page .field-portal-role + br,
body.auth-page .mb-3.field-portal-role {
    display: none !important;
}

/* Ensure our title is the only one showing */
body.auth-page .auth-title {
    display: block !important;
}

/* Hide any titles inside the form */
body.auth-page form h1:not(.auth-title),
body.auth-page form h2:not(.auth-title),
body.auth-page form h3:not(.auth-title) {
    display: none !important;
}

/* Main container - full screen split */
.auth-container {
    display: flex;
    min-height: 100vh;
    max-height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Left side - Logo section */
.auth-left {
    flex: 0 0 35%;
    background: linear-gradient(180deg, #041E42 0%, #003D7A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.auth-logo-container {
    text-align: center;
}

.auth-logo-container img {
    max-width: 220px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Right side - Form section */
.auth-right {
    flex: 0 0 65%;
    background: #F7F9FC;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-y: auto;
    max-height: 100vh;
}

/* Language selector */
.auth-language {
    position: absolute;
    top: 30px;
    right: 40px;
    z-index: 10;
}

.auth-language select {
    padding: 8px 40px 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 12px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Form card */
.auth-form-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 35px 30px;
    width: 100%;
    max-width: 380px;
}

/* Form title */
.auth-title {
    font-size: 24px;
    font-weight: 600;
    color: #1F2937;
    text-align: center;
    margin: 0 0 20px 0;
}

/* Hide title on signup page only */
.oe_signup_form ~ .auth-title,
form.oe_signup_form + .auth-title,
.auth-form-card:has(.oe_signup_form) .auth-title {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}

/* Reduce padding on signup form card but keep top padding */
.auth-form-card:has(.oe_signup_form) {
    padding: 30px 25px 15px 25px;
    margin-top: 80px;
}

/* Add padding to signup form itself */
.oe_signup_form {
    padding-top: 0;
}

/* Form groups */
.auth-form-group {
    margin-bottom: 12px;
}

.auth-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

/* Input fields */
.auth-form-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 2px solid #D1D5DB;
    border-radius: 4px;
    font-size: 14px;
    color: #1F2937;
    background: white;
    transition: all 0.2s;
    box-sizing: border-box;
}

.auth-form-input:focus {
    outline: none;
    border-color: #0071CE;
    box-shadow: 0 0 0 3px rgba(0, 113, 206, 0.1);
}

.auth-form-input::placeholder {
    color: #9CA3AF;
}

/* Password field with eye icon */
.auth-password-container {
    position: relative;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #6B7280;
    font-size: 16px;
}

.auth-password-toggle:hover {
    color: #374151;
}

/* Submit button */
.auth-submit-btn {
    width: 100%;
    height: 40px;
    background: #0071CE;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-submit-btn:hover {
    background: #005FA3;
    box-shadow: 0 2px 8px rgba(0, 113, 206, 0.3);
}

.auth-submit-btn:active {
    transform: scale(0.98);
}

/* Forgot password link */
.auth-forgot-link {
    text-align: center;
    margin-top: 12px;
}

.auth-forgot-link a {
    color: #0071CE;
    text-decoration: none;
    font-size: 13px;
}

.auth-forgot-link a:hover {
    text-decoration: underline;
}

/* Footer links */
.auth-footer {
    text-align: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #E5E7EB;
}

.auth-footer-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.auth-footer-links a {
    color: #374151;
    text-decoration: none;
    font-size: 12px;
}

.auth-footer-links a:hover {
    text-decoration: underline;
    color: #0071CE;
}

.auth-footer-links span {
    color: #9CA3AF;
}

/* Signup specific - role selection */
.auth-role-group {
    margin-bottom: 14px;
    margin-top: 0;
    padding-top: 0;
}

.auth-role-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.auth-role-option {
    position: relative;
}

.auth-role-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.auth-role-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #F9FAFB;
    white-space: nowrap;
    min-height: 38px;
}

.auth-role-option input[type="radio"]:checked + .auth-role-label {
    background: #EFF6FF;
    color: #0071CE;
}

.auth-role-label::before {
    content: '';
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 2px solid #9CA3AF;
    border-radius: 50%;
    margin-right: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.auth-role-option input[type="radio"]:checked + .auth-role-label::before {
    border-color: #0071CE;
    border-width: 5px;
    background: white;
}

/* Alert messages */
.auth-alert {
    padding: 10px 12px;
    border-radius: 4px;
    margin-bottom: 14px;
    font-size: 13px;
}

.auth-alert-error {
    background: #FEE2E2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.auth-alert-success {
    background: #D1FAE5;
    border: 1px solid #A7F3D0;
    color: #065F46;
}

.auth-alert-info {
    background: #DBEAFE;
    border: 1px solid #BFDBFE;
    color: #1E40AF;
}

/* Toggle link (login/signup switch) */
.auth-toggle-link {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: #6B7280;
}

.auth-toggle-link a {
    color: #0071CE;
    font-weight: 600;
    text-decoration: none;
}

.auth-toggle-link a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 1024px) {
    .auth-left {
        flex: 0 0 35%;
        padding: 25px;
    }

    .auth-right {
        flex: 0 0 65%;
        padding: 25px;
    }

    .auth-logo-container img {
        max-width: 240px;
    }
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-left {
        flex: 0 0 auto;
        min-height: 150px;
        padding: 30px 20px;
    }

    .auth-right {
        flex: 1;
        padding: 30px 20px;
    }

    .auth-logo-container img {
        max-width: 200px;
    }

    .auth-form-card {
        padding: 30px 25px;
        max-width: 100%;
    }

    .auth-language {
        top: 15px;
        right: 15px;
    }

    .auth-title {
        font-size: 22px;
        margin-bottom: 18px;
    }

    .auth-role-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-form-card {
        padding: 25px 20px;
    }

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

    .auth-footer-links {
        flex-direction: column;
        gap: 8px;
    }

    .auth-footer-links span {
        display: none;
    }
}

/* Loading state */
.auth-submit-btn:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
}

.auth-submit-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    margin-left: 10px;
    animation: spin 0.8s linear infinite;
}

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

/* FINAL OVERRIDES - Force hide old login_page.css pseudo-elements */
.oe_login_form::before,
.oe_signup_form::before,
form.oe_login_form::before,
form.oe_signup_form::before {
    content: "" !important;
    display: none !important;
    visibility: hidden !important;
}

/* Force our custom radio buttons to show properly */
.auth-role-option input[type="radio"] + .auth-role-label {
    display: flex !important;
}
