/* === STYLE.CSS — design triple AAA, header indépendant, animations === */

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

body {
    font-family: 'Inter', sans-serif;
    background: #f0f4fa;
    /* fond doux */
    color: #1e293b;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* ----- HEADER indépendant ----- */

.main-header {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(0, 0, 0, 0.05);
    padding: 0.8rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(145deg, #1e2b4f, #4338ca);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}


/* ----- MENU UTILISATEUR (dropdown) ----- */

.user-menu {
    position: relative;
}

.user-button {
    background: none;
    border: none;
    font-size: 2.2rem;
    color: #2c3e5c;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.1s;
}

.user-button:hover {
    color: #4338ca;
    background: rgba(67, 56, 202, 0.08);
}

.user-button:focus-visible {
    outline: 3px solid #4338ca;
    outline-offset: 4px;
}

.user-button:active {
    transform: scale(0.95);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 15px 30px -12px rgba(0, 0, 0, 0.25);
    min-width: 200px;
    padding: 0.8rem 0;
    border: 1px solid #e9eef4;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 200;
}

.dropdown-menu[hidden] {
    display: none;
}

.dropdown-menu:not([hidden]) {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}


/* Éléments du menu */

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.7rem 1.8rem;
    text-align: left;
    background: none;
    border: none;
    font-size: 1rem;
    color: #1e293b;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: #f0f4fe;
    color: #4338ca;
}

.dropdown-item:focus-visible {
    outline: 3px solid #4338ca;
    outline-offset: -3px;
    background: #f0f4fe;
}

.dropdown-item.username {
    font-weight: 600;
    color: #0f172a;
    background: #f8fafd;
    cursor: default;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0.3rem;
}

.dropdown-item.username:hover {
    background: #f8fafd;
    color: #0f172a;
}


/* ----- MAIN CONTENT (container blanc) ----- */

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.container {
    max-width: 1300px;
    width: 100%;
    background: #ffffff;
    border-radius: 3rem;
    box-shadow: 0 30px 50px -20px rgba(0, 0, 0, 0.2), 0 10px 20px -10px rgba(0, 0, 0, 0.05);
    padding: 2.5rem;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ----- GRILLE DES CARTES ----- */

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin: 0;
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2.2rem 1.5rem 1.8rem;
    background: #ffffff;
    border: 2px solid #e6edf5;
    border-radius: 2.5rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.3s, border-color 0.2s;
    box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.08);
    animation: cardFadeIn 0.5s ease-out backwards;
}

.option-card:nth-child(1) {
    animation-delay: 0.1s;
}

.option-card:nth-child(2) {
    animation-delay: 0.2s;
}

.option-card:nth-child(3) {
    animation-delay: 0.3s;
}

.option-card:nth-child(4) {
    animation-delay: 0.4s;
}

.option-card:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option-card:hover {
    transform: translateY(-8px);
    border-color: #b1c3d8;
    box-shadow: 0 25px 30px -12px rgba(67, 56, 202, 0.15);
}

.option-card:focus-visible {
    outline: 4px solid #4338ca;
    outline-offset: 4px;
    border-color: transparent;
}

.option-card:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

.option-card i {
    font-size: 3rem;
    background: linear-gradient(135deg, #4338ca, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.2rem;
    transition: transform 0.2s;
}

.option-card:hover i {
    transform: scale(1.05);
}

.card-text h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.card-text p {
    font-size: 0.9rem;
    color: #3a4b5c;
    /* contraste > 7:1 sur blanc */
    max-width: 24ch;
    margin: 0 auto;
}


/* ----- RESPONSIVE ----- */

@media (max-width: 800px) {
    .main-header {
        padding: 0.8rem 1.5rem;
    }
    .logo {
        font-size: 2rem;
    }
    .user-button {
        font-size: 2rem;
    }
    .container {
        padding: 2rem;
    }
}

@media (max-width: 600px) {
    .options-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    .option-card {
        flex-direction: row;
        text-align: left;
        padding: 1.5rem 1.8rem;
        gap: 1.2rem;
    }
    .option-card i {
        font-size: 2.4rem;
        margin-bottom: 0;
    }
    .card-text p {
        max-width: none;
    }
}

@media (max-width: 450px) {
    .container {
        padding: 1.2rem;
        border-radius: 2rem;
    }
    .logo {
        font-size: 1.8rem;
    }
    .user-button {
        font-size: 1.8rem;
    }
    .option-card {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
}