/**
 * Libro ERP - Tenant Portal Auth Stylesheet
 * 
 * Defines the split-screen glassmorphic layout for Login, Registration,
 * and Account Recovery pages.
 */

:root {
    --primary-color: #FFD700;
    --primary-hover: #E6C200;
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --portal-brand-purple: #7c3aed;
    --portal-brand-dark: #6d28d9;
}

body {
    font-family: 'Cairo', sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.split-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    background: linear-gradient(135deg, #7c3aed 0%, #7c3aed 50%, #7c3aed 100%);
    min-width: 0;
}

/* Full-column glass wrap (login + register) — no nested radius */
.split-container.layout-glass .form-side {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    background: #7c3aed;
}

.split-container.layout-glass .auth-main,
.split-container.layout-glass .auth-main.auth-main-wide {
    max-width: none;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.split-container.layout-glass .glass-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-block: none;
    border-inline-end: none;
    box-shadow: none !important;
    padding: 2rem 2.75rem 1.25rem;
    min-height: 100vh;
}

/* Login keeps compact form width */
.split-container.layout-glass .glass-card > .auth-panel-body {
    width: 100%;
    max-width: 480px;
    margin-inline: auto;
}

.split-container.layout-glass .form-control,
.split-container.layout-glass .form-select,
.split-container.layout-glass .input-group-text {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.split-container.layout-glass .form-control:focus,
.split-container.layout-glass .form-select:focus {
    background: rgba(255, 255, 255, 0.08);
}

.split-container.layout-glass .auth-panel-footer {
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
}

/* Register only: wider column + wider form body */
.split-container.layout-register .form-side {
    flex: 1.45;
}

.split-container.layout-register .image-side {
    flex: 0.75;
}

.split-container.layout-register .glass-card > .auth-panel-body {
    max-width: 720px;
}

.image-side {
    flex: 1;
    background-size: 30px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.image-side::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.side-image-container {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
}

.side-image-container img {
    max-width: 80%;
    max-height: 60vh;
    object-fit: contain;
    filter: drop-shadow(0 25px 50px rgba(124, 58, 237, 0.3));
}

.side-image-text {
    margin-top: 2rem;
    color: #7c3aed;
}

.side-image-text h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.side-image-text p {
    font-size: 1rem;
    color: #6366f1;
    opacity: 0.8;
}

@media (max-width: 991.98px) {
    .image-side {
        display: none;
    }

    .form-side {
        flex: none;
        width: 100%;
    }

    .split-container.layout-glass .form-side {
        flex: none;
        width: 100%;
    }

    .split-container.layout-glass .glass-card {
        border: none;
        min-height: 100vh;
        padding: 1.5rem 1.25rem;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
}

.auth-main {
    max-width: 480px;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
}

.auth-main.auth-main-wide {
    max-width: 720px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none !important;
    position: relative;
}

.card-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.25rem;
}

.card-toolbar .glass-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.glass-card .logo-wrap {
    padding-top: 0;
}

.logo-img {
    height: 72px;
}

.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    color: white;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.72);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

.toggle-password-btn {
    color: rgba(255, 255, 255, 0.75) !important;
}

.toggle-password-btn:hover {
    color: #fff !important;
}

.form-select option {
    background: #7c3aed;
    color: #fff;
}

.input-group-text {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #7c3aed;
    font-weight: 700;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    transform: translateY(0);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #7c3aed;
    transform: translateY(-2px);
}

.btn-primary:disabled,
.btn-primary.disabled,
.btn-primary:active,
.btn-primary:focus {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #7c3aed !important;
    opacity: 1 !important;
    box-shadow: none !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-background-clip: text;
    -webkit-text-fill-color: #ffffff;
    transition: background-color 5000s ease-in-out 0s;
    box-shadow: inset 0 0 20px 20px rgba(255,255,255,0);
}

.text-white-70 { color: rgba(255, 255, 255, 0.7); }
.text-white-90 { color: rgba(255, 255, 255, 0.9); }
.text-white-40 { color: rgba(255, 255, 255, 0.4); }
.text-white-60 { color: rgba(255, 255, 255, 0.6); }
.text-white-80 { color: rgba(255, 255, 255, 0.8); }

.glass-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50px;
    padding: 8px 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

::selection {
    background: var(--primary-color);
    color: #7c3aed;
}

.text-danger,
.invalid-feedback {
    color: #fca5a5 !important;
}

.form-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.form-check-input {
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

a.text-link,
.glass-card a:not(.btn) {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.glass-card a:not(.btn):hover {
    color: var(--primary-color);
}

.alert {
    border-radius: 12px;
}

.alert-danger {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

@media (max-width: 576px) {
    .form-side {
        padding: 1rem !important;
        align-items: flex-start !important;
    }

    .split-container.layout-glass .form-side {
        padding: 0 !important;
        align-items: stretch !important;
    }

    .form-side main.auth-main {
        max-width: 100% !important;
        padding: 0 !important;
        margin-top: 1rem;
    }

    .split-container.layout-glass .form-side main.auth-main {
        margin-top: 0;
    }

    .form-side .glass-card {
        padding: 1.25rem !important;
        border-radius: 18px !important;
    }

    .split-container.layout-glass .form-side .glass-card {
        border-radius: 0 !important;
        padding: 1.5rem 1.25rem !important;
    }

    .form-side .logo-img {
        height: 64px !important;
    }

    .mobile-auth-row {
        flex-direction: column-reverse;
        align-items: flex-start !important;
        gap: .65rem;
    }

    #loginBtn {
        min-height: 52px;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .form-side main.auth-main {
        max-width: 95% !important;
    }

    .auth-main.auth-main-wide {
        max-width: 95% !important;
    }
}
