/* ─── Classic split login — enhanced with animations ─── */

@keyframes loginBgZoom {
    0%   { transform: scale(1.06); }
    100% { transform: scale(1.1); }
}

@keyframes loginCardIn {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes loginLogoIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes loginLogoFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

@keyframes loginFormSlide {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes loginFormSlideRtl {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes loginFieldIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loginShakeInner {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    40%       { transform: translateX(5px); }
    60%       { transform: translateX(-3px); }
    80%       { transform: translateX(3px); }
}

@keyframes loginBtnShine {
    0%   { left: -100%; }
    100% { left: 150%; }
}

/* Language switcher on login page */
.admin-login-lang {
    --login-lang-bg: #f0eeff;
    --login-lang-bg-hover: #e6e2ff;
    --login-lang-border: rgba(var(--admin-primary-rgb, 115, 103, 240), 0.35);
    --login-lang-text: #3d3a5c;

    position: fixed;
    top: 1rem;
    inset-inline-end: 1rem;
    z-index: 100;
}

.admin-login-lang__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--login-lang-border);
    border-radius: 50px;
    background: var(--login-lang-bg);
    backdrop-filter: blur(8px);
    color: var(--login-lang-text);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, color 0.2s ease;
    box-shadow: 0 4px 16px rgba(var(--admin-primary-rgb, 115, 103, 240), 0.25);
}

.admin-login-lang__toggle:hover,
.admin-login-lang__toggle:focus {
    background: var(--login-lang-bg-hover);
    border-color: var(--admin-primary, #7367f0);
    color: var(--admin-primary, #7367f0);
    outline: none;
    transform: translateY(-1px);
}

.admin-login-lang__toggle .admin-login-lang__label {
    color: inherit;
}

.admin-login-lang__toggle .feather {
    width: 1.1rem;
    height: 1.1rem;
    stroke-width: 2.25px;
    color: inherit;
    stroke: currentColor;
}

.admin-login-lang__toggle::after {
    display: none;
}

.admin-login-lang__menu {
    min-width: 9.5rem;
    padding: 0.35rem 0;
    border-radius: 10px;
    border: 1px solid var(--login-lang-border);
    background: var(--login-lang-bg) !important;
    box-shadow: 0 8px 24px rgba(var(--admin-primary-rgb, 115, 103, 240), 0.22);
    margin-top: 0.35rem;
}

[dir="rtl"] .admin-login-lang__menu.dropdown-menu-right {
    right: 0;
    left: auto;
}

.admin-login-lang__menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.55rem 1rem;
    color: var(--login-lang-text) !important;
    background: var(--login-lang-bg) !important;
}

.admin-login-lang__menu .dropdown-item .fi {
    font-size: 1rem;
    border-radius: 2px;
    flex-shrink: 0;
}

.admin-login-lang__menu .dropdown-item:hover,
.admin-login-lang__menu .dropdown-item:focus {
    color: var(--admin-primary, #7367f0) !important;
    background: var(--login-lang-bg-hover) !important;
}

.admin-login-lang__menu .dropdown-item.active,
.admin-login-lang__menu .dropdown-item:active {
    color: var(--admin-primary, #7367f0) !important;
    background: var(--login-lang-bg-hover) !important;
}

html,
body.admin-auth-body {
    height: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden !important;
    overscroll-behavior: none;
    font-family: var(--admin-font-family, "Cairo", "Expo Arabic", "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif) !important;
    font-weight: 500;
}

/* Full-screen background + vertical center chain */
.admin-auth-body .app-content.content {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    background: #1a1a2e;
}

.admin-auth-body .content-wrapper,
.admin-auth-body .content-body {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    min-height: 0;
    overflow: hidden;
}

.admin-auth-body .flexbox-container.admin-auth-center {
    flex: 0 1 auto;
    width: 100%;
    max-width: 100%;
    height: auto !important;
    min-height: 0;
    margin: 0;
    padding: 0;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
}

.admin-auth-body .admin-auth-col {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    flex: 0 1 auto;
}

.admin-auth-body .app-content.content::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("https://images.unsplash.com/photo-1553095066-5014bc7b7f2d?q=80&w=1600&auto=format&fit=crop");
    background-size: cover;
    background-position: center;
    transform: scale(1.08);
    transform-origin: center center;
    animation: loginBgZoom 22s ease-in-out infinite alternate;
    z-index: 0;
    will-change: transform;
}

.admin-auth-body .app-content.content::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(var(--admin-primary-rgb, 115, 103, 240), 0.25) 50%,
        rgba(0, 0, 0, 0.45) 100%
    );
    z-index: 1;
}

.admin-auth-body .content-wrapper,
.admin-auth-body .content-body,
.admin-auth-body .flexbox-container.admin-auth-center {
    position: relative;
    z-index: 2;
}

html body.blank-page.admin-auth-body .content.app-content {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

html body.blank-page.admin-auth-body .content-wrapper .flexbox-container.admin-auth-center {
    height: auto !important;
    min-height: 0 !important;
}

/* Main split card — entrance once; no re-fade on validation */
.admin-auth-split {
    width: 100%;
    max-width: 920px;
    margin: 0;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(2px);
    opacity: 1;
    transform: translateY(0) scale(1);
}

html:not(.admin-auth-loaded) .admin-auth-split {
    animation: loginCardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.admin-auth-split__inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    margin: 0;
    max-height: calc(100dvh - 2rem);
    max-height: calc(100vh - 2rem);
    background: rgba(0, 0, 0, 0.35);
    transform: translateX(0);
}

html.admin-auth-loaded .admin-auth-split__inner.is-shake {
    animation: loginShakeInner 0.4s ease;
}

/* Logo panel */
.admin-auth-brand {
    flex: 1 1 42%;
    min-width: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.admin-auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(var(--admin-primary-rgb, 115, 103, 240), 0.35),
        rgba(0, 0, 0, 0.2)
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.admin-auth-split:hover .admin-auth-brand::before {
    opacity: 1;
}

.admin-auth-brand img.auth-logo {
    max-height: 120px;
    max-width: 85%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
    position: relative;
    z-index: 1;
    transition: transform 0.35s ease;
}

html:not(.admin-auth-loaded) .admin-auth-brand img.auth-logo {
    animation:
        loginLogoIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both,
        loginLogoFloat 4s ease-in-out 1.2s infinite;
}

html.admin-auth-loaded .admin-auth-brand img.auth-logo {
    animation: loginLogoFloat 4s ease-in-out infinite;
}

.admin-auth-brand img.auth-login-background {
    max-height: min(220px, 42vh);
    max-width: 92%;
}

.admin-auth-split:hover .admin-auth-brand img.auth-logo {
    transform: scale(1.04);
    animation-play-state: paused;
}

/* Form panel */
.admin-auth-form-panel {
    flex: 1 1 58%;
    min-width: 280px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transform: translateX(0);
}

html:not(.admin-auth-loaded) .admin-auth-form-panel {
    animation: loginFormSlide 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

html:not(.admin-auth-loaded)[dir="rtl"] .admin-auth-form-panel {
    animation-name: loginFormSlideRtl;
}

.admin-auth-form-panel .card {
    border: none;
    box-shadow: none;
    width: 100%;
    height: auto;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.admin-auth-form-panel .card-header {
    border-bottom: none;
    padding: 1.75rem 1.75rem 0;
    background: transparent;
}

.admin-auth-form-panel .card-title h4 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c2c2c;
    margin: 0;
}

.admin-auth-form-panel .auth-greeting {
    padding: 0 1.75rem 0.5rem;
    text-align: center;
    color: #6e6b7b;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
}

html:not(.admin-auth-loaded) .admin-auth-form-panel .auth-greeting {
    animation: loginFieldIn 0.5s ease 0.35s both;
}

.admin-auth-form-panel .card-body {
    padding: 0.5rem 1.75rem 1.75rem;
}

html:not(.admin-auth-loaded) .admin-auth-form-panel fieldset {
    animation: loginFieldIn 0.5s ease both;
}

html:not(.admin-auth-loaded) .admin-auth-form-panel fieldset:nth-of-type(1) { animation-delay: 0.4s; }
html:not(.admin-auth-loaded) .admin-auth-form-panel fieldset:nth-of-type(2) { animation-delay: 0.5s; }
html:not(.admin-auth-loaded) .admin-auth-form-panel .form-group.d-flex { animation: loginFieldIn 0.5s ease 0.6s both; }
html:not(.admin-auth-loaded) .admin-auth-form-panel .submit_button { animation: loginFieldIn 0.5s ease 0.7s both; }

.admin-auth-form-panel .form-label-group .form-control {
    border-radius: 8px;
    border-color: #ebe9f1;
    font-weight: 500;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

.admin-auth-form-panel .form-label-group .form-control:focus {
    border-color: var(--admin-primary, #7367f0);
    box-shadow: 0 0 0 0.2rem rgba(var(--admin-primary-rgb, 115, 103, 240), 0.18);
    transform: translateY(-1px);
}

.admin-auth-form-panel .form-label-group .form-control.border-danger {
    border-color: #ea5455 !important;
    animation: none !important;
}

.admin-auth-form-panel .form-control-position i {
    color: var(--admin-primary, #7367f0);
    transition: transform 0.25s ease, color 0.25s ease;
}

.admin-auth-form-panel .form-label-group:focus-within .form-control-position i {
    transform: scale(1.12);
}

.admin-auth-form-panel .field-label {
    font-weight: 600;
}

.admin-auth-form-panel .vs-checkbox-con .text-dark {
    color: #5e5873 !important;
    font-weight: 500;
}

.admin-auth-form-panel .vs-checkbox--check {
    transition: transform 0.2s ease;
}

.admin-auth-form-panel .vs-checkbox-con input:checked ~ .vs-checkbox .vs-checkbox--check {
    transform: scale(1.08);
}

.admin-auth-form-panel .btn-primary.submit_button {
    position: relative;
    overflow: hidden;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem;
    width: 100%;
    min-height: 2.85rem;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    text-align: center;
    background: linear-gradient(118deg, var(--admin-primary, #7367f0), rgba(var(--admin-primary-rgb, 115, 103, 240), 0.82)) !important;
    box-shadow: 0 6px 20px rgba(var(--admin-primary-rgb, 115, 103, 240), 0.4);
    transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.admin-auth-form-panel .btn-primary.submit_button .submit-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
}

.admin-auth-form-panel .btn-primary.submit_button .submit-btn-icon i {
    margin: 0 !important;
    float: none !important;
    font-size: 1.2rem;
    line-height: 1;
}

.admin-auth-form-panel .btn-primary.submit_button.is-loading .submit-btn-label,
.admin-auth-form-panel .btn-primary.submit_button.is-success .submit-btn-label {
    display: none;
}

.admin-auth-form-panel .btn-primary.submit_button::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: skewX(-20deg);
}

.admin-auth-form-panel .btn-primary.submit_button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(var(--admin-primary-rgb, 115, 103, 240), 0.5);
}

.admin-auth-form-panel .btn-primary.submit_button:hover:not(:disabled)::after {
    animation: loginBtnShine 0.65s ease;
}

.admin-auth-form-panel .btn-primary.submit_button:active:not(:disabled) {
    transform: translateY(0);
}

.admin-auth-form-panel .text-danger {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
    color: #ea5455;
    font-weight: 600;
    animation: none !important;
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .admin-auth-body .app-content.content::before,
    html:not(.admin-auth-loaded) .admin-auth-split,
    html:not(.admin-auth-loaded) .admin-auth-brand img.auth-logo,
    html:not(.admin-auth-loaded) .admin-auth-form-panel,
    html:not(.admin-auth-loaded) .admin-auth-form-panel fieldset,
    html:not(.admin-auth-loaded) .admin-auth-form-panel .auth-greeting,
    html:not(.admin-auth-loaded) .admin-auth-form-panel .form-group,
    html:not(.admin-auth-loaded) .admin-auth-form-panel .submit_button,
    .admin-auth-split__inner.is-shake {
        animation: none !important;
    }

    .admin-auth-form-panel .form-control:focus {
        transform: none;
    }
}

@media (max-width: 991px) {
    .admin-auth-body .app-content.content {
        padding: 0.75rem;
    }

    .admin-auth-split__inner {
        flex-wrap: wrap;
        align-items: center;
        max-height: calc(100dvh - 1.5rem);
        max-height: calc(100vh - 1.5rem);
        overflow: hidden;
    }

    .admin-auth-brand {
        flex: 0 0 auto;
        min-height: 0;
        padding: 1.25rem;
    }

    .admin-auth-brand img.auth-logo {
        max-height: 64px;
    }

    .admin-auth-brand img.auth-login-background {
        max-height: min(100px, 22vh);
        max-width: 88%;
    }

    .admin-auth-form-panel {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    .admin-auth-form-panel .card-header {
        padding: 1rem 1.25rem 0;
    }

    .admin-auth-form-panel .auth-greeting {
        padding: 0 1.25rem 0.25rem;
        font-size: 0.875rem;
    }

    .admin-auth-form-panel .card-body {
        padding: 0.25rem 1.25rem 1rem;
    }

    .admin-auth-form-panel fieldset {
        margin-bottom: 0.65rem !important;
    }
}
