/*
 * «Живой герой» — admin login (designs/design_handoff_login_mascot §4).
 *
 * Everything is scoped under .cilex-login so this file is inert on the rest of
 * the panel (it is registered as a panel asset, so it loads everywhere).
 * The design is light-only by intent; colours are stated literally rather than
 * inherited, so Filament's dark theme cannot repaint half of it.
 */

.cilex-login {
    --cilex-blue: #2489c5;
    --cilex-blue-hover: #1f79b0;
    --cilex-blue-press: #1a6a9a;
    --cilex-ink: #0f2136;
    --cilex-muted: #5c6b7e;
    --cilex-err: #e5484d;
    --cilex-ok: #16a34a;
    --cilex-ring: rgba(36, 137, 197, 0.28);

    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(130% 120% at 50% 0%, #eaf4fb 0%, #dcecf7 45%, #cfe3f2 100%);
}

.cilex-login__stage {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cilex-login__card {
    position: relative;
    width: 100%;
    max-width: 384px;
    margin-top: 78px; /* room for the mascot's negative offset */
    padding: 30px 30px 34px;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(19, 58, 102, 0.18);
}

.cilex-login__card--shake {
    animation: cilex-login-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* ── mascot ──────────────────────────────────────────────────────────── */

.cilex-login__mascot {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
    margin-top: -78px;
    margin-bottom: 6px;
}

.cilex-login__mascot svg {
    display: block;
}

/* The overshoot is what makes the paws feel like paws rather than shutters. */
.cilex-login__paws {
    transition: transform 0.32s cubic-bezier(0.34, 1.4, 0.5, 1);
}

.cilex-login__paw {
    transition: transform 0.3s;
}

/* ── copy ────────────────────────────────────────────────────────────── */

.cilex-login__intro,
.cilex-login__done {
    text-align: center;
}

.cilex-login__intro {
    margin-bottom: 22px;
}

.cilex-login__done {
    animation: cilex-login-pop 0.3s ease;
}

.cilex-login__title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--cilex-ink);
}

.cilex-login__subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--cilex-muted);
}

/* ── error banner ────────────────────────────────────────────────────── */

.cilex-login__banner {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
    padding: 11px 13px;
    border: 1px solid #fecdd3;
    border-radius: 10px;
    background: #fef2f2;
    color: #b42318;
    font-size: 13.5px;
    font-weight: 500;
    animation: cilex-login-pop 0.2s ease;
}

/* ── fields ──────────────────────────────────────────────────────────── */

.cilex-login__field {
    margin-bottom: 14px;
}

/* Real labels for assistive tech; the design shows placeholders only. */
.cilex-login__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cilex-login__control {
    position: relative;
}

.cilex-login__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: #8aa0b6;
    transition: color 0.15s;
    pointer-events: none;
}

.cilex-login__icon--on {
    color: var(--cilex-blue);
}

.cilex-login__input {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1.5px solid #e3edf6;
    border-radius: 14px;
    background: #f4f8fc;
    color: var(--cilex-ink);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.cilex-login__input--lead {
    padding-left: 42px;
}

.cilex-login__input--trail {
    padding-right: 48px;
}

.cilex-login__input::placeholder {
    color: #8aa0b6;
}

.cilex-login__input:focus {
    border-color: var(--cilex-blue);
    background: #fff;
    box-shadow: 0 0 0 4px var(--cilex-ring);
}

.cilex-login__input--bad {
    border-color: var(--cilex-err);
}

.cilex-login__reveal {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #7c92a8;
    cursor: pointer;
}

.cilex-login__reveal:hover {
    background: #e5eef8;
    color: var(--cilex-blue);
}

.cilex-login__error {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 6px 0 0 2px;
    color: var(--cilex-err);
    font-size: 12.5px;
}

/* ── remember ────────────────────────────────────────────────────────── */

.cilex-login__remember {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 14px 2px 20px;
    color: var(--cilex-muted);
    font-size: 13.5px;
    cursor: pointer;
}

.cilex-login__remember input {
    width: 17px;
    height: 17px;
    accent-color: var(--cilex-blue);
    cursor: pointer;
}

/* ── submit ──────────────────────────────────────────────────────────── */

.cilex-login__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    border: none;
    border-radius: 14px;
    background: var(--cilex-blue);
    box-shadow: 0 8px 20px rgba(36, 137, 197, 0.28);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.cilex-login__submit:hover:not(:disabled) {
    background: var(--cilex-blue-hover);
}

.cilex-login__submit:active:not(:disabled) {
    background: var(--cilex-blue-press);
}

.cilex-login__submit:disabled {
    cursor: default;
}

.cilex-login__submit--done {
    background: var(--cilex-ok);
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.3);
}

.cilex-login__spinner {
    width: 18px;
    height: 18px;
    border: 2.4px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cilex-login-spin 0.7s linear infinite;
}

/* ── focus visibility (kept explicit; the design removes default outlines) ── */

.cilex-login__reveal:focus-visible,
.cilex-login__submit:focus-visible,
.cilex-login__remember input:focus-visible {
    outline: 2px solid var(--cilex-blue);
    outline-offset: 2px;
}

/* ── confetti ────────────────────────────────────────────────────────── */

.cilex-login__confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 26px;
    pointer-events: none;
}

.cilex-login__confetti-bit {
    position: absolute;
    top: 38%;
    width: 9px;
    height: 9px;
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    animation-name: cilex-login-confetti;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;
}

@keyframes cilex-login-shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-6px); }
    40%, 60% { transform: translateX(6px); }
}

@keyframes cilex-login-pop {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: none; }
}

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

@keyframes cilex-login-confetti {
    to { transform: translateY(-70px) rotate(220deg); opacity: 0; }
}

/* ── reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .cilex-login__paws,
    .cilex-login__paw {
        transition: none;
    }

    .cilex-login__card--shake,
    .cilex-login__done,
    .cilex-login__banner {
        animation: none;
    }

    .cilex-login__confetti {
        display: none;
    }

    .cilex-login__spinner {
        animation-duration: 2.4s;
    }
}

/* ── narrow screens ──────────────────────────────────────────────────── */

@media (max-width: 420px) {
    .cilex-login {
        padding: 16px;
    }

    .cilex-login__card {
        padding: 26px 20px 28px;
    }
}
