/* --- RESET & BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: #004B91;
    background: #fdfdfd;
    overflow-x: hidden;
}

/* --- HEADER GRID --- */
.grid-header {
    position: relative;
    width: 100%;
    background: #000;
    line-height: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 100vh;
    opacity: 1;
    overflow: hidden;
    z-index: 1; /* Le header reste derrière le menu */
}

.grid-header.hidden {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.bg-img {
    width: 100%;
    height: auto;
    display: block;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 34% 36% 30%;
    z-index: 1;
}

.item-p {
    grid-column: 1;
    grid-row: 3;
    display: flex;
    align-items: center;
    padding-left: 25.5%;
}

.item-p p {
    color: white;
    font-weight: bold;
    font-size: 1.2vw;
    text-align:center;
    text-transform: uppercase;
    line-height: 1.2;
}

.item-h1 {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 5%;
}

.item-h1 h1 {
    color: white;
    font-size: 2.8vw;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

.item-h1-date {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 5%;
}

.item-h1-date h1 {
    color: white;
    font-size: 2.8vw;
    font-weight: 900;
    text-align: right;
    text-transform: uppercase;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

/* --- NAVIGATION --- */
nav {
    background: #004B91;
    position: sticky;
    top: 0;
    z-index: 9999; /* Le menu passe au-dessus du header */
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: 0.3s;
    padding: 5px 10px;
}

nav a:hover {
    color: #ff6600;
}

/* --- SECTIONS (SPA) --- */
.section {
    display: none;        /* Masqué par défaut */
    min-height: 70vh;
}

.section.active {
    display: block;       /* Affiché quand actif */
    animation: slideUp 0.5s ease-out;
}

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

/* --- CONTAINER --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 20px;
}

h2 {
    color: #004B91;
    font-size: 2.2rem;
    margin-bottom: 25px;
    text-transform: uppercase;
    border-left: 5px solid #ff6600;
    padding-left: 15px;
}

/* --- GRILLE DES COURSES --- */
.grid-race {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.race-card {
    border: 3px solid #f39233;
    border-radius: 25px;
    padding: 25px 15px;
    text-align: center;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s ease;
}

.race-card:hover {
    transform: scale(1.03);
}

.race-card h3 {
    color: #007bc4;
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.race-card p {
    color: #007bc4;
    margin-bottom: 5px;
    font-weight: 500;
    text-align: center;
}

/* --- BOUTON SUNSET MARATHON --- */
#btn {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 30px;
    background-color: #ff6600;
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

#btn:hover {
    background-color: white;
    color: #ff6600;
    border: 2px solid #ff6600;
    transform: translateY(-3px);
}

/* --- FOOTER --- */
footer {
    background: #004B91;
    color: grey;
    text-align: center;
    padding: 40px;
    font-size: 1rem;
    margin-top: 40px;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .grid-race {
        grid-template-columns: 1fr;
    }

    nav ul {
        gap: 10px;
        flex-wrap: wrap;
    }

    .item-p p {
        font-size: 2vw;
    }

    .item-h1 h1 {
        font-size: 5vw;
    }
}
.alert-error {
    background: #ffdddd;
    border-left: 5px solid #ff4444;
    padding: 10px 15px;
    margin-bottom: 20px;
    color: #a00000;
    border-radius: 4px;
}

.alert-success {
    background: #ddffdd;
    border-left: 5px solid #44aa44;
    padding: 10px 15px;
    margin-bottom: 20px;
    color: #006600;
    border-radius: 4px;
}


/* --- Variables de design --- */
:root {
  --primary-color: #2563eb;    /* Bleu sport */
  --secondary-color: #1e293b;  /* Gris foncé pro */
  --accent-color: #f59e0b;     /* Orange pour le dynamisme */
  --bg-color: #f8fafc;
  --text-color: #334155;
  --border-radius: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* --- Section Container --- */
.section.container {
  max-width: 800px;
  margin: 40px auto;
  padding: 30px;
  background-color: #ffffff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

h2 {
  color: var(--secondary-color);
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 3px solid var(--primary-color);
  display: inline-block;
  padding-bottom: 5px;
}

/* --- Grid Layout --- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* --- Groupes d'entrée --- */
.input-group {
  display: flex;
  flex-direction: column;
}

.input-group label {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--secondary-color);
  font-size: 0.9rem;
}

/* --- Champs Saisie (Input & Select) --- */
.input-group input, 
.input-group select {
  padding: 12px 15px;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: #fff;
  outline: none;
}

.input-group input:focus, 
.input-group select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Style spécifique pour les select */
.input-group select {
  cursor: pointer;
  appearance: none; /* Enlève le style par défaut */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='Step19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 15px;
}

/* --- Bouton de validation --- */
.btn-submit {
  width: 100%;
  padding: 15px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  font-weight: bold;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.3s transform 0.2s;
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-submit:hover {
  background-color: #1d4ed8;
  transform: translateY(-2px);
}

.btn-submit:active {
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .section.container {
    margin: 10px;
    padding: 20px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
}