.cms-auth-page {
    min-height: 100vh;
    margin: 0;
    background: #eef4fb;
    overflow-x: hidden;
}

/* ——— Login load animations ——— */
@keyframes cmsAuthOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(12px, -18px) scale(1.06); }
}

@keyframes cmsAuthOrbFloatAlt {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-14px, 12px) scale(1.08); }
}

@keyframes cmsAuthIllustrationFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes cmsAuthFadeDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes cmsAuthFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes cmsAuthCardBounce {
    0% {
        opacity: 0;
        transform: translateX(28px) scale(0.94);
    }
    55% {
        opacity: 1;
        transform: translateX(-6px) scale(1.02);
    }
    75% {
        transform: translateX(3px) scale(0.99);
    }
    100% {
        opacity: 1;
        transform: none;
    }
}

@keyframes cmsAuthInputIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.cms-auth-animate {
    opacity: 0;
}

.cms-auth-page.cms-auth-ready .cms-auth-animate-visual {
    animation: cmsAuthFadeDown 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cms-auth-page.cms-auth-ready .cms-auth-animate-title {
    animation: cmsAuthFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.cms-auth-page.cms-auth-ready .cms-auth-animate-desc {
    animation: cmsAuthFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}

.cms-auth-page.cms-auth-ready .cms-auth-animate-card {
    animation: cmsAuthCardBounce 0.75s cubic-bezier(0.34, 1.45, 0.64, 1) 0.12s both;
}

.cms-auth-page.cms-auth-ready .cms-auth-card .alert {
    animation: cmsAuthFadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.cms-auth-page.cms-auth-ready .cms-auth-card .input-group:nth-of-type(1) {
    animation: cmsAuthInputIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.38s both;
}

.cms-auth-page.cms-auth-ready .cms-auth-card .input-group:nth-of-type(2) {
    animation: cmsAuthInputIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.48s both;
}

.cms-auth-page.cms-auth-ready .cms-auth-card .btn-primary {
    animation: cmsAuthInputIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.58s both;
}

.cms-auth-page.cms-auth-ready .cms-auth-actions {
    animation: cmsAuthInputIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.68s both;
}

.cms-auth-page.cms-auth-ready .cms-auth-note,
.cms-auth-page.cms-auth-ready .cms-login-layouts {
    animation: cmsAuthFadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.78s both;
}

.cms-auth-wrapper {
    display: flex;
    min-height: 100vh;
}

.cms-auth-visual {
    flex: 1.05;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2.5rem;
    background: var(--cms-gradient-primary, linear-gradient(145deg, var(--cms-primary-dark) 0%, var(--cms-primary) 100%));
    color: #fff;
    position: relative;
    overflow: hidden;
}

.cms-auth-visual::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    animation: cmsAuthOrbFloat 8s ease-in-out infinite;
}

.cms-auth-visual::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    animation: cmsAuthOrbFloatAlt 9s ease-in-out infinite;
}

.cms-auth-visual img,
.cms-auth-illustration {
    width: min(420px, 90%);
    max-height: 340px;
    object-fit: contain;
    margin-bottom: 2rem;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.18));
    position: relative;
    z-index: 1;
}

.cms-auth-page.cms-auth-ready .cms-auth-illustration {
    animation: cmsAuthIllustrationFloat 4.5s ease-in-out infinite;
    animation-delay: 0.6s;
}

.cms-auth-visual h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    text-align: center;
}

.cms-auth-visual p {
    font-size: 1.15rem;
    opacity: 0.92;
    max-width: 420px;
    text-align: center;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.cms-auth-panel {
    flex: 0.95;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.cms-auth-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(21, 101, 192, 0.12);
    padding: 2.25rem 2rem 2rem;
    border-top: 5px solid var(--cms-primary, #1e88e5);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.cms-auth-page.cms-auth-ready .cms-auth-card:hover {
    box-shadow: 0 22px 56px rgba(21, 101, 192, 0.16);
}

.cms-auth-brand {
    text-align: center;
    margin-bottom: 1.25rem;
}

.cms-auth-brand a {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--cms-primary-dark, #1565c0);
    text-decoration: none;
}

.cms-auth-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #263238;
    text-align: center;
    margin-bottom: 0.35rem;
}

.cms-auth-subheading {
    text-align: center;
    color: #607d8b;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.cms-auth-card .form-control {
    font-size: 1.12rem;
    padding: 0.75rem 1rem;
    height: auto;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.cms-auth-card .form-control:focus {
    border-color: #64b5f6;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.18);
    transform: translateY(-1px);
}

.cms-auth-card .input-group-text {
    font-size: 1.05rem;
    border-radius: 0 10px 10px 0;
    background: #f5f9fc;
}

.cms-auth-card .input-group .form-control {
    border-radius: 10px 0 0 10px;
}

.cms-auth-card .btn {
    font-size: 1.08rem;
    font-weight: 600;
    padding: 0.72rem 1rem;
    border-radius: 10px;
}

.cms-auth-card .btn-primary {
    background: var(--cms-gradient-primary);
    border: none;
    box-shadow: 0 8px 18px rgba(var(--cms-primary-rgb, 30, 136, 229), 0.28);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.34, 1.45, 0.64, 1), box-shadow 0.2s ease, filter 0.2s ease;
}

.cms-auth-card .btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.45s ease;
    pointer-events: none;
}

.cms-auth-card .btn-primary:hover,
.cms-auth-card .btn-primary:focus {
    background: linear-gradient(135deg, var(--cms-primary-dark) 0%, var(--cms-primary) 100%);
    box-shadow: 0 10px 22px rgba(var(--cms-primary-rgb, 30, 136, 229), 0.34);
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.cms-auth-card .btn-primary:hover::after,
.cms-auth-card .btn-primary:focus::after {
    transform: translateX(120%);
}

.cms-auth-card .btn-outline-primary {
    color: var(--cms-primary-dark);
    border-color: rgba(var(--cms-primary-rgb, 30, 136, 229), 0.45);
    background: var(--cms-primary-light);
}

.cms-auth-card .btn-outline-primary:hover {
    background: var(--cms-primary-light);
    color: var(--cms-primary-dark);
    border-color: var(--cms-primary);
}

.cms-auth-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.cms-auth-links {
    margin-top: 1.25rem;
    text-align: center;
}

.cms-auth-links a {
    color: #1565c0;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
}

.cms-auth-links a:hover {
    color: #0d47a1;
    text-decoration: underline;
}

.cms-auth-note {
    margin-top: 1rem;
    text-align: center;
    color: #78909c;
    font-size: 0.95rem;
}

.cms-auth-card .alert {
    font-size: 1rem;
    border-radius: 10px;
}

@media (max-width: 991px) {
    .cms-auth-wrapper {
        flex-direction: column;
    }

    .cms-auth-visual {
        min-height: 280px;
        padding: 2rem 1.5rem;
    }

    .cms-auth-visual img {
        width: min(280px, 80%);
        margin-bottom: 1rem;
    }

    .cms-auth-visual h2 {
        font-size: 1.5rem;
    }

    .cms-auth-visual p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .cms-auth-actions {
        grid-template-columns: 1fr;
    }

    .cms-auth-card {
        padding: 1.5rem 1.25rem;
    }
}

.cms-login-layouts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.82rem;
}

.cms-login-layouts-label {
    color: #6c757d;
    margin-right: 0.25rem;
}

.cms-login-layout-link {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #dee2e6;
    color: #495057;
    text-decoration: none;
}

.cms-login-layout-link:hover {
    text-decoration: none;
    background: #f8f9fa;
    color: #212529;
}

.cms-login-layout-link.active {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.user-theme-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-theme-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
    .cms-auth-visual::before,
    .cms-auth-visual::after,
    .cms-auth-page.cms-auth-ready .cms-auth-illustration,
    .cms-auth-page.cms-auth-ready .cms-auth-animate,
    .cms-auth-page.cms-auth-ready .cms-auth-animate-visual,
    .cms-auth-page.cms-auth-ready .cms-auth-animate-title,
    .cms-auth-page.cms-auth-ready .cms-auth-animate-desc,
    .cms-auth-page.cms-auth-ready .cms-auth-animate-card,
    .cms-auth-page.cms-auth-ready .cms-auth-card .alert,
    .cms-auth-page.cms-auth-ready .cms-auth-card .input-group,
    .cms-auth-page.cms-auth-ready .cms-auth-card .btn-primary,
    .cms-auth-page.cms-auth-ready .cms-auth-actions,
    .cms-auth-page.cms-auth-ready .cms-auth-note,
    .cms-auth-page.cms-auth-ready .cms-login-layouts {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .cms-auth-card .form-control:focus,
    .cms-auth-card .btn-primary:hover,
    .cms-auth-card .btn-primary:focus {
        transform: none;
    }
}
