/* Логин в стилистике панели AF-RENT / Italy Luxury */
:root { --af-login-shadow: 0 18px 60px rgb(0 0 0 / 0.10), 0 6px 18px rgb(0 0 0 / 0.08); }
.dark { --af-login-shadow: 0 22px 70px rgb(0 0 0 / 0.45), 0 8px 22px rgb(0 0 0 / 0.35); }

/* Фон как в референсе: светлый, с лёгким золотым акцентом (не тёмный коричневый). */
:root:not(.dark) body {
    background:
        radial-gradient(1200px 800px at 50% 12%, color-mix(in oklab, var(--color-primary) 18%, transparent), transparent 60%),
        radial-gradient(900px 700px at 70% 30%, color-mix(in oklab, var(--color-primary) 10%, transparent), transparent 65%),
        linear-gradient(135deg,
            color-mix(in oklab, white 96%, var(--color-primary) 4%),
            color-mix(in oklab, white 92%, var(--color-primary) 8%)
        );
}

:root.dark body {
    background:
        radial-gradient(1200px 800px at 15% 10%, color-mix(in oklab, var(--color-primary) 22%, transparent), transparent 58%),
        radial-gradient(900px 700px at 85% 25%, color-mix(in oklab, var(--color-primary) 14%, transparent), transparent 62%),
        linear-gradient(135deg,
            color-mix(in oklab, var(--color-body) 92%, black),
            color-mix(in oklab, var(--color-body) 82%, var(--color-primary) 6%)
        );
}

/* Убираем “обвязку” админки на странице логина */
body:has(form.authentication-form) .layout-navigation,
body:has(form.authentication-form) .layout-footer,
body:has(form.authentication-form) .breadcrumbs,
body:has(form.authentication-form) .profile,
body:has(form.authentication-form) .languages {
    display: none !important;
}

body:has(form.authentication-form) .layout-page,
body:has(form.authentication-form) .layout-content {
    background: transparent !important;
}

/* Центрирование страницы */
body:has(form.authentication-form) #_moonshine-content,
body:has(form.authentication-form) .layout-main,
body:has(form.authentication-form) .layout-page,
body:has(form.authentication-form) main.layout-content {
    min-height: 100vh;
}

body:has(form.authentication-form) main.layout-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4.5rem 1.25rem;
}

/* Скрываем пустой заголовок, который MoonShine вставляет как h1 */
body:has(form.authentication-form) main.layout-content > h1 {
    display: none !important;
}

/* Карточка логина (форма) */
body:has(form.authentication-form) form.authentication-form {
    position: relative;
    width: min(26rem, 100%);
    padding: 8.25rem 1.25rem 1.15rem;
    border-radius: 1rem;
    border: 1px solid color-mix(in oklab, var(--color-base-stroke) 85%, transparent);
    background-color: color-mix(in oklab, var(--color-base) 96%, white);
    box-shadow: var(--af-login-shadow);
}

/* Логотип щита над формой */
body:has(form.authentication-form) form.authentication-form::before {
    content: '';
    display: block;
    position: absolute;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 4.75rem;
    height: 4.75rem;
    background: url('/images/cc-admin-mark.svg') center / contain no-repeat;
}

/* Заголовок как в референсе */
body:has(form.authentication-form) form.authentication-form::after {
    content: 'Admin Panel';
    display: block;
    position: absolute;
    top: 6.35rem;
    left: 0;
    width: 100%;
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.1rem;
    margin: 0;
    color: var(--color-base-text);
    pointer-events: none;
}

/* Чуть компактнее ритм внутри формы */
body:has(form.authentication-form) form.authentication-form {
    --ms-auth-gap: 0.375rem;
}

/* Кнопка на всю ширину и одинаковая высота */
body:has(form.authentication-form) form.authentication-form .btn.btn-primary.btn-lg.w-full {
    width: 100% !important;
    border-radius: 0.85rem;
}

.authentication-content {
    border-radius: 1rem;
    border: 1px solid color-mix(in oklab, var(--color-base-stroke) 85%, transparent);
    background-color: color-mix(in oklab, var(--color-base) 94%, transparent);
    box-shadow: var(--af-login-shadow);
    backdrop-filter: blur(8px);
}

.authentication-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 1.1rem;
}
.authentication-logo .logo {
    display: inline-flex;
    justify-content: center;
}

.authentication-logo img {
    height: 6.1rem !important;
    max-height: min(6.4rem, 24vh) !important;
    width: auto !important;
    object-fit: contain !important;
}

@media (max-width: 48rem) {
    .authentication {
        padding-top: 2.25rem;
        padding-bottom: 2.5rem;
    }

    .authentication-logo img {
        height: 4.75rem !important;
        max-height: min(5.25rem, 20vh) !important;
    }

    .authentication-logo {
        margin-bottom: 0.85rem;
    }
}

@media (max-width: 24rem) {
    .authentication-logo img {
        height: 4.1rem !important;
        max-height: min(4.5rem, 18vh) !important;
    }
}

.authentication-header h1 {
    letter-spacing: -0.02em;
    white-space: pre-line;
}

.authentication-content .btn {
    border-radius: 0.85rem;
}

.authentication-content .form-control {
    border-radius: 0.85rem;
}

/* Autofill (Chrome/Edge/Safari) — убираем голубой фон */
.authentication-content input:-webkit-autofill,
.authentication-content input:-webkit-autofill:hover,
.authentication-content input:-webkit-autofill:focus,
.authentication-content textarea:-webkit-autofill,
.authentication-content textarea:-webkit-autofill:hover,
.authentication-content textarea:-webkit-autofill:focus,
.authentication-content select:-webkit-autofill,
.authentication-content select:-webkit-autofill:hover,
.authentication-content select:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--color-content) !important;
    caret-color: var(--color-content) !important;
    box-shadow: 0 0 0 1000px color-mix(in oklab, var(--color-base) 92%, white) inset !important;
    transition: background-color 9999s ease-in-out 0s;
}

/* Autofill (Firefox) */
.authentication-content input:-moz-autofill,
.authentication-content textarea:-moz-autofill,
.authentication-content select:-moz-autofill {
    box-shadow: 0 0 0 1000px color-mix(in oklab, var(--color-base) 92%, white) inset !important;
    -moz-text-fill-color: var(--color-content) !important;
    caret-color: var(--color-content) !important;
}
