@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    font-family: 'Press Start 2P', cursive, Arial, sans-serif;
    background: radial-gradient(circle at center, #ffcb05 0%, #d32f2f 70%);
    margin: 0; padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
}

/* Container du formulaire avec style Pokéball + animations */
main {
    background: linear-gradient(145deg, #fff 0%, #ffecec 100%);
    border: 6px solid #d32f2f;
    border-radius: 20px;
    width: 380px;
    padding: 3rem 2.5rem 2.5rem;
    box-shadow:
        0 0 10px 3px #ffcb05,
        0 10px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1; /* contenu au-dessus de la Pokéball */
    animation: pokeballOpen 1.2s ease forwards;
}

/* Demi-haut de la Pokéball */
main::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 75px;
    background: #d32f2f;
    border-radius: 80px 80px 0 0;
    border: 5px solid #000;
    box-shadow:
        inset 0 8px 15px rgba(255, 255, 255, 0.4),
        0 3px 5px rgba(0, 0, 0, 0.3);
    animation: pokeballBounce 1.5s infinite ease-in-out;
    z-index: 0; /* pokéball derrière */
    pointer-events: none; /* clics passent à travers */
}

/* Demi-bas de la Pokéball */
main::after {
    content: '';
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 75px;
    background: #fff;
    border-radius: 0 0 80px 80px;
    border: 5px solid #000;
    box-shadow: inset 0 -8px 15px rgba(0, 0, 0, 0.1);
    animation: pokeballBounce 1.5s infinite ease-in-out;
    z-index: 0; /* pokéball derrière */
    pointer-events: none; /* clics passent à travers */
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.6rem;
    color: #d32f2f;
    text-shadow: 1px 1px 2px #000;
}

/* Boite d'erreurs avec effet de scintillement */
.errors {
    background: #ffd4d4;
    border: 2px solid #d32f2f;
    color: #7b0000;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 700;
    animation: flicker 1.5s infinite alternate ease-in-out;
}

label {
    display: block;
    margin-top: 1.2rem;
    font-weight: 900;
    color: #333;
    text-shadow: 0 0 4px #fff;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    margin-top: 0.3rem;
    border: 3px solid #d32f2f;
    border-radius: 14px;
    box-sizing: border-box;
    font-size: 1rem;
    font-weight: 700;
    color: #2c2c2c;
    transition: border-color 0.3s ease;
    box-shadow: inset 0 2px 5px #fff9;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    border-color: #ffcb05;
    outline: none;
    box-shadow: 0 0 12px #ffcb05;
}

button {
    margin-top: 2.2rem;
    width: 100%;
    background-color: #d32f2f;
    color: white;
    border: none;
    padding: 1rem 0;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow:
        0 6px 0 #7b0000,
        0 0 8px #ffcb05;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

button:hover {
    background-color: #ff3d3d;
    box-shadow:
        0 4px 0 #7b0000,
        0 0 15px #ffcb05;
}

button:active {
    box-shadow: none;
    transform: translateY(3px);
}

p {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #7b0000;
    font-weight: 700;
    text-shadow: 0 0 5px #fff;
}

p a {
    color: #d32f2f;
    text-decoration: none;
    font-weight: 900;
    text-shadow: 0 0 6px #fff;
}

p a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes pokeballOpen {
    0% {
        transform: scale(0) rotate(720deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.1) rotate(-15deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes pokeballBounce {
    0%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    50% {
        transform: translateY(-12px) translateX(-50%);
    }
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.title-pokeball {
  position: relative;
  font-family: 'Press Start 2P', cursive;
  color: #d32f2f;
  font-weight: bold;
  text-align: center;
  z-index: 10; /* texte au dessus */
}

.title-pokeball .pokeball {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  background: url('/chemin/vers/pokeball.png') no-repeat center/contain;
  opacity: 0.3;
  transform: translate(-50%, -50%);
  z-index: 1; /* sous le texte */
  pointer-events: none; /* pour ne pas gêner les clics */
}
