html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/*Be Ma*/

/* Khung chứa & Bay bồng bềnh */
.ghost-wrapper {
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.ghost-container {
    position: relative;
    width: 110px;
    height: 120px;
    animation: float-ghost 3s ease-in-out infinite;
}

/* Thân hình - FIX: Ép cứng màu xanh mặc định ở chế độ sáng */
.ghost-body {
    position: relative;
    width: 100%;
    height: 100px;
    background-color: #a8d5ff;
    border-radius: 55px 55px 10px 10px;
    transition: background-color 0.4s ease;
    z-index: 2;
}

/* Vạt áo */
.ghost-skirt {
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
}

.bump {
    width: 34%;
    height: 20px;
    background-color: #a8d5ff;
    border-radius: 0 0 50px 50px;
    transition: background-color 0.4s ease;
}

/* Mặt */
.ghost-face {
    position: absolute;
    top: 35px;
    left: 0;
    width: 100%;
    height: 50px;
}

.eye {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #2b2b2b;
    border-radius: 50%;
    transform: translate(var(--eye-x, 0px), var(--eye-y, 0px));
    transition: transform 0.15s ease-out;
}

    .eye.left {
        left: 28px;
    }

    .eye.right {
        right: 28px;
    }

.cheek {
    position: absolute;
    width: 14px;
    height: 6px;
    background: #ff8a80;
    border-radius: 50%;
    top: 25px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

    .cheek.left {
        left: 16px;
    }

    .cheek.right {
        right: 16px;
    }

.mouth {
    position: absolute;
    width: 16px;
    height: 8px;
    border: 3px solid #2b2b2b;
    border-top: none;
    border-radius: 0 0 20px 20px;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.2s ease;
}

/* Tay */
.arm {
    position: absolute;
    width: 28px;
    height: 35px;
    background-color: #a8d5ff;
    border-radius: 30px;
    top: 55px;
    z-index: 3;
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), background-color 0.4s ease, width 0.4s ease, height 0.4s ease, filter 0.4s ease;
}

    .arm.left {
        left: -10px;
        transform: rotate(-35deg);
    }

    .arm.right {
        right: -10px;
        transform: rotate(35deg);
    }

/* TRẠNG THÁI SCARED (CHE MẮT NHƯNG CHỪA MIỆNG CHỮ O) */
.ghost-container.scared .arm {
    width: 38px;
    height: 28px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    filter: brightness(0.80);
}

    .ghost-container.scared .arm.left {
        transform: translate(18px, -24px) rotate(15deg);
    }

    .ghost-container.scared .arm.right {
        transform: translate(-18px, -24px) rotate(-15deg);
    }

.ghost-container.scared .mouth {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background-color: #2b2b2b;
    top: 12px;
}

/* TRẠNG THÁI SAD + SHAKE (KHI MẬT KHẨU SAI) */
.ghost-container.sad .mouth {
    border: 3px solid #2b2b2b;
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    top: 14px;
    width: 16px;
    height: 8px;
    background: transparent;
}

.ghost-container.sad .eye {
    height: 5px;
    top: 4px;
    border-radius: 10px 10px 0 0;
}

.ghost-container.sad .cheek {
    opacity: 0.2;
}

.ghost-container.shake {
    animation: head-shake 0.4s ease-in-out;
}

/* Bóng đổ */
.ghost-shadow {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 10px;
    background-color: rgba(168, 213, 255, 0.4);
    border-radius: 50%;
    animation: shadow-scale 3s ease-in-out infinite;
    transition: background-color 0.4s ease;
}

/* Các Keyframes chuyển động */
@keyframes float-ghost {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes shadow-scale {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translateX(-50%) scale(0.7);
        opacity: 0.2;
    }
}

@keyframes head-shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px) rotate(-3deg);
    }

    75% {
        transform: translateX(8px) rotate(3deg);
    }
}

/* Tinh chỉnh input-group */
.input-group:focus-within {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    border-radius: 0.375rem;
}

    .input-group:focus-within .form-control, .input-group:focus-within .btn {
        border-color: #86b7fe !important;
    }

/* ===================================================
   HIỆU ỨNG LẮC ĐẦU (KHI SAI MẬT KHẨU)
   =================================================== */

/* 1. Gắn animation lắc đầu vào class .shake */
.ghost-container.shake {
    /* Thời gian lắc 0.4s, ease-in-out cho mượt */
    animation: head-shake 0.4s ease-in-out;
}

/* 2. Định nghĩa Keyframes (Khung hình) cho việc lắc qua lắc lại */
@keyframes head-shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        /* Nghiêng sang trái */
        transform: translateX(-8px) rotate(-3deg);
    }

    75% {
        /* Nghiêng sang phải */
        transform: translateX(8px) rotate(3deg);
    }
}

/* CSS cho link mặc định */
.sidebar-link {
    color: #475569;
    transition: all 0.2s ease-in-out;
    border-left: 4px solid transparent; /* Chuẩn bị sẵn khung viền */
}

    .sidebar-link:hover {
        background-color: #f1f5f9;
        color: #0f172a;
    }

/* TRẠNG THÁI ACTIVE HIỆN TẠI */
.active-sidebar-item {
    background: linear-gradient(90deg, #eff6ff 0%, #ffffff 100%) !important; /* Nền xanh dương nhạt lan tỏa */
    color: #0d6efd !important; /* Chữ xanh đậm */
    box-shadow: inset 4px 0 0 0 #0d6efd; /* Thanh line đánh dấu cạnh trái */
}

    /* Ghi đè màu của mọi Icon (Cúp vàng, Chuông...) thành màu xanh đồng nhất khi bị Active */
    .active-sidebar-item .menu-icon {
        color: #0d6efd !important;
    }