/* ========================================
   VARIABLES CSS MODERNES (COHÉRENT AVEC BOUNCE)
   ======================================== */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #e67e22;
    --background-dark: #121212;
    --background-light: #1E1E1E;
    --card-background: #2A2A2A;
    --text-primary: #FFFFFF;
    --text-secondary: #A0A0A0;
    --border-color: rgba(255, 255, 255, 0.1);
    --success-color: #4CAF50;
    --error-color: #e74c3c;
    --warning-color: #f1c40f;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d1b2e 50%, #1a1a1a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* ========================================
   PARTICULES ANIMÉES EN ARRIÈRE-PLAN
   ======================================== */
.particles-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: radial-gradient(circle, var(--secondary-color) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0.15;
    animation: float 20s infinite ease-in-out;
}

.particle:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 60%;
    left: 80%;
    animation-delay: 4s;
}

.particle:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 80%;
    left: 20%;
    animation-delay: 2s;
}

.particle:nth-child(4) {
    width: 100px;
    height: 100px;
    top: 30%;
    left: 70%;
    animation-delay: 6s;
}

.particle:nth-child(5) {
    width: 90px;
    height: 90px;
    top: 50%;
    left: 40%;
    animation-delay: 8s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.15;
    }
    25% {
        transform: translate(20px, -30px) scale(1.1);
        opacity: 0.25;
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.2;
    }
    75% {
        transform: translate(30px, 10px) scale(1.05);
        opacity: 0.18;
    }
}

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */
.auth-container {
    background: rgba(42, 42, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 48px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

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

/* ========================================
   HEADER AVEC LOGO
   ======================================== */
.auth-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-bounce {
    display: inline-block;
    margin-bottom: 24px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--secondary-color), #d35400);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(230, 126, 34, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(230, 126, 34, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 30px rgba(230, 126, 34, 0.5);
    }
}

.logo-text {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ========================================
   FORMULAIRES
   ======================================== */
.auth-form {
    display: none;
    animation: fadeInForm 0.4s ease-out;
}

.auth-form.active {
    display: block;
}

@keyframes fadeInForm {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-header {
    text-align: center;
    margin-bottom: 32px;
}

.form-header h2,
.form-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========================================
   INPUTS ET LABELS
   ======================================== */
.input-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    transition: var(--transition);
}

.optional {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(30, 30, 30, 0.8);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
    outline: none;
}

input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

input:focus {
    border-color: var(--secondary-color);
    background: rgba(30, 30, 30, 1);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
    transform: translateY(-2px);
}

input:hover:not(:focus) {
    border-color: rgba(230, 126, 34, 0.3);
}

/* ========================================
   BOUTONS
   ======================================== */
.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), #d35400);
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(230, 126, 34, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(230, 126, 34, 0.4);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(230, 126, 34, 0.1);
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 20px;
    transition: var(--transition);
}

.btn-primary:hover .btn-icon {
    transform: translateX(4px);
}

/* Effet ripple au clic */
.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::before,
.btn-secondary:active::before {
    width: 300px;
    height: 300px;
}

/* ========================================
   MESSAGES (SUCCESS / ERROR / WARNING)
   ======================================== */
.message {
    margin-bottom: 20px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    animation: slideDown 0.4s ease-out;
    border-left: 4px solid;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message {
    background: rgba(76, 175, 80, 0.15);
    color: var(--success-color);
    border-color: var(--success-color);
}

.error-message {
    background: rgba(231, 76, 60, 0.15);
    color: var(--error-color);
    border-color: var(--error-color);
}

.verification-pending {
    background: rgba(241, 196, 15, 0.15);
    color: var(--warning-color);
    border-color: var(--warning-color);
}

/* ========================================
   FORMULAIRE DE VÉRIFICATION
   ======================================== */
.verification-header {
    text-align: center;
}

.verification-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.verification-input-group {
    text-align: center;
}

.verification-code-input {
    font-size: 32px !important;
    letter-spacing: 16px;
    text-align: center;
    font-weight: 700;
    padding: 20px 12px !important;
    max-width: 280px;
    margin: 0 auto;
}

.resend-code {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.resend-code p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.resend-code button {
    width: auto;
    padding: 12px 32px;
}

/* ========================================
   FORMULAIRE DE RENVOI
   ======================================== */
.resend-form {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   TOGGLE LINK (INSCRIPTION ↔ CONNEXION)
   ======================================== */
.toggle-link {
    text-align: center;
    margin-top: 32px;
    font-size: 15px;
    color: var(--text-secondary);
}

.link-primary {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

.link-primary::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: var(--transition);
}

.link-primary:hover::after {
    width: 100%;
}

.link-primary:hover {
    color: #d35400;
}

/* ========================================
   LIEN RETOUR ACCUEIL
   ======================================== */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--secondary-color);
    transform: translateX(-4px);
}

.back-arrow {
    font-size: 18px;
    transition: var(--transition);
}

.back-link:hover .back-arrow {
    transform: translateX(-4px);
}

/* ========================================
   UTILITAIRES
   ======================================== */
.hidden {
    display: none !important;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablettes (768px et moins) */
@media (max-width: 768px) {
    .auth-container {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .logo-text {
        font-size: 28px;
    }

    .auth-title {
        font-size: 24px;
    }

    .auth-subtitle {
        font-size: 14px;
    }

    .form-header h2,
    .form-header h3 {
        font-size: 20px;
    }

    .verification-code-input {
        font-size: 28px !important;
        letter-spacing: 12px;
    }
}

/* Mobiles (480px et moins) */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .auth-container {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .logo-bounce {
        padding: 12px 24px;
        border-radius: 12px;
    }

    .logo-text {
        font-size: 24px;
        letter-spacing: 1px;
    }

    .auth-title {
        font-size: 20px;
    }

    .auth-subtitle {
        font-size: 13px;
    }

    .form-header h2,
    .form-header h3 {
        font-size: 18px;
    }

    .form-header p {
        font-size: 13px;
    }

    input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 14px 20px;
        font-size: 15px;
    }

    .verification-code-input {
        font-size: 24px !important;
        letter-spacing: 8px;
        max-width: 240px;
    }

    .verification-icon {
        font-size: 48px;
    }

    .toggle-link {
        font-size: 14px;
    }

    .back-link {
        font-size: 13px;
    }
}

/* Très petits mobiles (360px et moins) */
@media (max-width: 360px) {
    .auth-container {
        padding: 20px 16px;
    }

    .verification-code-input {
        font-size: 20px !important;
        letter-spacing: 6px;
        max-width: 200px;
    }
}
