*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f5f7fb;
    color: #222;
    min-height: 100vh;
}

/* ── Navbar ── */
.navbar {
    background: #111827;
    color: white;
    padding: 14px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.nav-brand {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.15s;
}

.nav-links a:hover { color: white; }

.nav-logout-form {
    display: inline;
}

.nav-logout-button {
    background: none;
    border: 0;
    color: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    padding: 0;
    transition: color 0.15s;
}

.nav-logout-button:hover {
    color: white;
}

.nav-user {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

/* ── Page wrapper ── */
.page-content { padding: 30px; }

/* ── Flash messages ── */
.alert {
    max-width: 720px;
    margin: 0 auto 20px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.alert-error   { background: #fef0f0; color: #c0392b; border: 1px solid #e74c3c; }
.alert-success { background: #eff6ff; color: #1d4ed8; border: 1px solid #93c5fd; }
.alert-warning { background: #fffbea; color: #856404; border: 1px solid #ffc107; }

/* ── Mascot widget ── */
.mascot-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.mascot-avatar {
    width: 98px;
    height: 118px;
    background: transparent;
    border: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.28));
    overflow: visible;
    animation: mascot-bounce 2.8s ease-in-out infinite;
    transition: transform 0.2s, filter 0.2s;
    user-select: none;
}

.mascot-avatar:hover {
    animation: none;
    transform: scale(1.12);
    filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.35));
}

.mascot-image {
    display: block;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    width: 100%;
}

.mascot-bubble {
    background: #fff;
    border-radius: 16px;
    padding: 18px 18px 14px;
    box-shadow: 0 6px 28px rgba(0,0,0,0.14);
    max-width: 250px;
    position: relative;
    animation: mascot-pop 0.25s ease-out;
}

.mascot-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 22px;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #fff;
}

.mascot-bubble p {
    font-size: 13.5px;
    color: #333;
    line-height: 1.55;
    margin: 0 20px 14px 0;
}

.mascot-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: #ccc;
    font-size: 15px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}
.mascot-close:hover { color: #888; }

.mascot-cta {
    border: 0;
    cursor: pointer;
    display: block;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: background 0.15s;
    width: 100%;
}
.mascot-cta:hover { background: #1d4ed8; color: #fff; }

.mascot-container.bubble-hidden .mascot-bubble { display: none; }

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

@keyframes mascot-pop {
    from { opacity: 0; transform: scale(0.85) translateY(8px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

@media (max-width: 680px) {
    .navbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 18px;
    }

    .nav-links {
        gap: 12px 16px;
        justify-content: flex-start;
        width: 100%;
    }

    .page-content {
        padding: 18px;
    }

    .mascot-container {
        bottom: 18px;
        right: 18px;
    }

    .mascot-avatar {
        height: 94px;
        width: 78px;
    }

    .mascot-bubble {
        max-width: min(230px, calc(100vw - 36px));
    }
}
