/* ===== LIGNE DE GROUPES DE CARDS (groupés par nom de 'div') ===== */
.cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 90%;
    margin: auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

.cards-row .cards-group {
    position: relative;
    display: flex;
    width: 100%;
    margin: 50px 0;
    padding: 1rem;
    box-sizing: border-box;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    background-color: #f7f9fc;
}

/* Titre du groupe : haut à gauche, posé sur la bordure */
.cards-group-title {
    position: absolute;
    top: -0.7em;
    left: 1rem;
    margin-left: -0.5rem;
    padding: 0 0.5rem;
    background-color: var(--color-background, #fff);
    color: var(--color-primary, #005068);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.cards-row .cards {
    margin: 0;
    padding: 0;
    /* Cartes à taille d'origine (220px) */
    grid-template-columns: repeat(auto-fill, 220px);
    justify-content: center;
    /* Empêche la(les) ligne(s) de s'étirer à la hauteur de la colonne */
    align-content: start;
}

/* ===== NOUVELLES CARTES ===== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    justify-content: center;
    max-width: 1200px;
    width: 100%;
    padding: 0 1rem;
    margin: auto;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    width: 100%;
    /* Prend toute la largeur de la colonne */
    max-width: 220px;
    /* Largeur maximale */
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #00c6ff);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card:hover {
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.15);
    transform: translateY(-4px);
    border-color: rgba(0, 123, 255, 0.2);
}

.card:hover::before {
    transform: scaleX(1);
}

.card i {
    font-size: 2rem;
    color: #007bff;
    margin-bottom: 0.8rem;
    background: linear-gradient(135deg, #007bff, #00c6ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #222;
}

.card-desc {
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Effet de surbrillance au survol du titre */
.card-title::after {
    content: "";
    display: block;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #007bff, #00c6ff);
    margin: 0.4rem auto 0;
    border-radius: 1px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.card:hover .card-title::after {
    opacity: 1;
}

.div-home-select {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 0px;
}

.home-species-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.home-year-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.home-program-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}