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

[hidden] {
    display: none !important;
}

/*** Sidebar ***/
.sidebar-btn {
    cursor: pointer;
}

/* =============================================
   LOGIN PAGE
   ============================================= */

.login-page {
    height: 100dvh;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
}

.login-split {
    display: flex;
    height: 100%;
}

/* ---- Panneau gauche : branding ---- */
.login-brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(1rem, 2vh, 2.5rem);
    padding: clamp(2rem, 4vw, 5rem);
    background-color: #2d0a0a;
    background-image:
        radial-gradient(ellipse at 30% 40%, rgba(227, 9, 20, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse at 75% 80%, rgba(0, 0, 0, 0.3) 0%, transparent 50%);
    position: relative;
    z-index: 1;
    box-shadow: 4px 0 12px rgba(227, 9, 20, 0.18);
}

.login-brand-logo {
    width: clamp(120px, 18vw, 380px);
    filter: drop-shadow(0 6px 32px rgba(227, 9, 20, 0.4));
}

.login-brand-title {
    color: #ffffff;
    font-size: clamp(1.2rem, 2.2vw, 3.2rem);
    font-weight: 800;
    text-align: center;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

/* ---- Panneau droit : formulaire ---- */
.login-form-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f2f2;
    padding: clamp(1.5rem, 3vw, 4rem);
    overflow-y: auto;
}

.login-form-inner {
    width: 100%;
    max-width: clamp(280px, 28vw, 560px);
    display: flex;
    flex-direction: column;
    gap: clamp(0.6rem, 1.2vh, 1.5rem);
    background: #ffffff;
    border-radius: clamp(12px, 1.5vw, 20px);
    padding: clamp(1.5rem, 3vw, 4rem);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.09);
}

.login-logo-mobile {
    display: none;
    width: clamp(80px, 30vw, 160px);
    margin: 0 auto clamp(0.5rem, 1vh, 1rem);
}

.login-form-title {
    font-size: clamp(1.6rem, 2.5vw, 3.5rem);
    font-weight: 800;
    color: #1c1c1e;
    line-height: 1.1;
}

.login-form-sub {
    font-size: clamp(0.85rem, 1vw, 1.5rem);
    color: #8a8a8e;
}

.lf-label {
    font-size: clamp(0.78rem, 0.9vw, 1.3rem);
    font-weight: 700;
    color: #4a4a4e;
    margin-bottom: clamp(0.2rem, 0.4vh, 0.5rem);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 1vh, 1.2rem);
    border-top: 2px solid #f0ece8;
    padding-top: clamp(0.8rem, 1.5vh, 2rem);
    margin-top: clamp(0.2rem, 0.5vh, 0.8rem);
}

/* ---- Champs de saisie ---- */
.lf-group {
    display: flex;
    align-items: center;
    background: #faf8f6;
    border: 1.5px solid #e8e2dc;
    border-radius: clamp(8px, 1vw, 14px);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lf-group:focus-within {
    border-color: #E30914;
    box-shadow: 0 0 0 3px rgba(227, 9, 20, 0.12);
    background: #fff;
}

.lf-group--error {
    border-color: #E30914;
    background: #fff8f8;
}

.lf-icon {
    padding: 0 clamp(0.7rem, 1vw, 1.4rem);
    color: #E30914;
    font-size: clamp(0.85rem, 1.1vw, 1.6rem);
    flex-shrink: 0;
}

.lf-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: clamp(0.9rem, 1.1vw, 1.6rem);
    padding: clamp(0.65rem, 1.2vh, 1.4rem) clamp(0.4rem, 0.6vw, 1rem) clamp(0.65rem, 1.2vh, 1.4rem) 0;
    color: #1c1c1e;
}

.lf-input::placeholder {
    color: #b8b2aa;
}

.lf-toggle-pw {
    background: none;
    border: none;
    padding: 0 clamp(0.7rem, 1vw, 1.4rem);
    color: #b8b2aa;
    font-size: clamp(0.85rem, 1.1vw, 1.6rem);
    cursor: pointer;
    transition: color 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.lf-toggle-pw:hover {
    color: #E30914;
}

/* ---- Boutons ---- */
.lf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: clamp(0.65rem, 1.2vh, 1.5rem);
    border: 2px solid transparent;
    border-radius: clamp(8px, 1vw, 14px);
    font-family: inherit;
    font-size: clamp(0.9rem, 1.1vw, 1.7rem);
    font-weight: 700;
    color: #fff;
    background: #E30914;
    cursor: pointer;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: background 0.25s, transform 0.15s, box-shadow 0.25s;
    box-shadow: 0 4px 16px rgba(227, 9, 20, 0.3);
    margin-top: clamp(0.2rem, 0.5vh, 0.8rem);
}

.lf-btn:hover {
    background: #c4080f;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(227, 9, 20, 0.4);
    color: #fff;
}

.lf-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(227, 9, 20, 0.25);
}

.lf-btn-outline {
    background: transparent;
    border-color: #E30914;
    color: #E30914;
    box-shadow: none;
}

.lf-btn-outline:hover {
    background: #E30914;
    color: #fff;
    box-shadow: 0 4px 16px rgba(227, 9, 20, 0.25);
}

.lf-btn-icon {
    margin-left: 0.5rem;
}

/* ---- Liens ---- */
.lf-forgot {
    text-align: center;
    font-size: clamp(0.8rem, 0.95vw, 1.4rem);
    color: #8a8a8e;
    text-decoration: none;
    transition: color 0.2s;
}

.lf-forgot:hover {
    color: #E30914;
}

/* ---- Alertes ---- */
@keyframes lf-error-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lf-error {
    font-size: clamp(0.82rem, 0.95vw, 1.4rem);
    color: #E30914;
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: clamp(0.4rem, 0.8vh, 1rem) clamp(0.6rem, 1vw, 1.2rem);
    background: #fff0f0;
    border-left: 3px solid #E30914;
    border-radius: 0 clamp(4px, 0.5vw, 8px) clamp(4px, 0.5vw, 8px) 0;
    animation: lf-error-in 0.25s ease;
}

.lf-error-icon {
    flex-shrink: 0;
}

.lf-success {
    font-size: clamp(0.82rem, 0.95vw, 1.4rem);
    color: #1a7f4b;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    padding: clamp(0.4rem, 0.8vh, 1rem) clamp(0.6rem, 1vw, 1.2rem);
    background: #f0faf4;
    border-left: 3px solid #1a7f4b;
    border-radius: 0 clamp(4px, 0.5vw, 8px) clamp(4px, 0.5vw, 8px) 0;
    animation: lf-error-in 0.25s ease;
}

.lf-success-link {
    color: #1a7f4b;
    font-weight: 700;
    text-decoration: underline;
}

.lf-success-link:hover {
    color: #E30914;
}

/* ---- Spinner bouton ---- */
.lf-btn--loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.lf-btn--loading::after {
    content: '';
    position: absolute;
    width: 1.3em;
    height: 1.3em;
    top: calc(50% - 0.65em);
    left: calc(50% - 0.65em);
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lf-spin 0.65s linear infinite;
}

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

/* =============================================
   APP LAYOUT (authenticated)
   ============================================= */

.app-body {
    display: flex;
    height: 100dvh;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    background: #f4f4f6;
}

/* ---- Sidebar ---- */
.app-sidebar {
    width: 240px;
    min-width: 240px;
    background: #1c1c1e;
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 100;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.25);
}

.app-sidebar-logo {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background-image:
        radial-gradient(ellipse at 50% 50%, rgba(227, 9, 20, 0.45) 0%, transparent 70%),
        radial-gradient(ellipse at 50% 90%, rgba(227, 9, 20, 0.2) 0%, transparent 60%);
}

.app-sidebar-logo img {
    width: 100%;
    max-width: 140px;
    display: block;
    margin: 0 auto;
}

.app-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    overflow-y: auto;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.app-nav-link:hover,
.app-nav-link--active {
    color: #fff;
    background: rgba(227, 9, 20, 0.12);
    border-left-color: #E30914;
}

.app-nav-link i {
    width: 1.2rem;
    text-align: center;
    color: #E30914;
    font-size: 0.95rem;
}

.app-sidebar-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.2);
}

.app-sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.app-sidebar-user-icon {
    color: #E30914;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.app-sidebar-user-name {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-logout-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.app-logout-btn:hover {
    color: #E30914;
    background: rgba(227, 9, 20, 0.12);
}

/* ---- Contenu principal ---- */
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-content {
    flex: 1;
    overflow-y: auto;
}

/* ---- Page d'accueil ---- */
.app-welcome {
    padding: 2.5rem;
    max-width: 1100px;
}

.app-welcome-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    gap: 1.5rem;
}

.app-welcome-logo {
    width: clamp(80px, 10vw, 150px);
    opacity: 0.9;
}

.app-welcome-title {
    font-size: clamp(1.5rem, 2.5vw, 2.5rem);
    font-weight: 800;
    color: #1c1c1e;
    margin: 0 0 0.35rem;
}

.app-welcome-sub {
    font-size: clamp(0.85rem, 1vw, 1rem);
    color: #8a8a8e;
    margin: 0;
}

.app-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8a8a8e;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.app-section-title::before {
    content: '';
    display: block;
    width: 3px;
    height: 0.85rem;
    background: #E30914;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ---- Carte événement ---- */
.app-event-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
}

.app-event-empty {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    color: #c0c0c8;
}

.app-event-empty i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.app-event-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* ---- Raccourcis ---- */
.app-shortcuts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.app-shortcut {
    background: #fff;
    border: none;
    border-radius: 14px;
    padding: 1.5rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-left: 4px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.app-shortcut:hover {
    border-left-color: #E30914;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.app-shortcut-icon {
    font-size: 1.5rem;
    color: #E30914;
    margin-bottom: 0.5rem;
}

.app-shortcut-label {
    font-size: 1rem;
    font-weight: 700;
    color: #1c1c1e;
}

.app-shortcut-desc {
    font-size: 0.8rem;
    color: #8a8a8e;
    line-height: 1.4;
}

/* ---- Responsive mobile ---- */
@media (max-width: 768px) {
    .login-brand {
        display: none;
    }

    .login-form-panel {
        flex: none;
        width: 100%;
    }

    .login-logo-mobile {
        display: block;
    }

    .login-page {
        overflow-y: auto;
    }

    .app-sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        height: 100%;
        transition: left 0.3s ease;
    }

    .app-sidebar--open {
        left: 0;
    }

    .app-main {
        width: 100%;
    }

    .app-welcome {
        padding: 1.5rem;
    }
}
