/* CSS pour les pages d'authentification des visiteurs */

/* Hero section */
.auth-hero {
    background: 
        linear-gradient(135deg, rgba(146, 221, 58, 0.6) 0%, rgba(0, 102, 51, 0.6) 100%),
        url('/images/pre-inscription-hero-background.jpg') center/cover no-repeat;
    color: var(--color-white);
    padding: 6rem 0 4rem;
    text-align: center;
    margin-top: 5.35rem;
    position: relative;
}

.auth-hero h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* Section principale */
.auth-form-section {
    padding: 4rem 0;
    background: var(--color-light-gray);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

/* Conteneur principal d'authentification */
.auth-container {
    background: var(--color-white);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Styles pour la modale de messages */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--color-white);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease-out;
    overflow: hidden;
}

.modal-content.success {
    border-top: 5px solid var(--color-primary);
}

.modal-content.error {
    border-top: 5px solid #dc3545;
}

.modal-content.info {
    border-top: 5px solid #17a2b8;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #666;
}

.modal-body {
    padding: 1rem 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.modal-body #modalIcon {
    font-size: 2rem;
    flex-shrink: 0;
}

.modal-body #modalMessage {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--color-dark);
}

.modal-body #modalMessage p {
    margin: 0 0 0.5rem 0;
}

.modal-body #modalMessage p:last-child {
    margin-bottom: 0;
}

.modal-footer {
    padding: 1rem 2rem 2rem;
    text-align: right;
}

.modal-footer .btn-primary {
    min-width: 100px;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Onglets de navigation */
.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e5e5e5;
    gap: 0;
}

.tab-button {
    flex: 1;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    color: var(--color-primary);
    background-color: #f8f9fa;
}

.tab-button.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background-color: rgba(146, 221, 58, 0.05);
}

/* Sections d'authentification */
.auth-section {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

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

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

/* Boîtes d'information */
.auth-info {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8ff 100%);
    border: 1px solid var(--color-primary);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.auth-info h3 {
    font-family: var(--font-accent);
    color: var(--color-secondary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.auth-info p {
    color: var(--color-dark-gray);
    margin: 0;
    line-height: 1.5;
}

/* Formulaires */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--color-dark-gray);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    color: var(--color-dark-gray);
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(146, 221, 58, 0.1);
}

.form-group small {
    color: var(--color-medium-gray);
    font-size: 0.85rem;
}

/* Checkboxes */
.checkbox-group {
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.checkbox-group label {
    flex: 1;
    font-weight: 500;
    line-height: 1.5;
}

.checkbox-group a {
    color: var(--color-primary);
    text-decoration: none;
}

.checkbox-group a:hover {
    text-decoration: underline;
}

.checkbox-group label em {
    color: var(--color-primary);
    font-style: italic;
    font-weight: 500;
}

/* Boutons de soumission */
.form-submit {
    text-align: center;
    padding-top: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 8px 20px rgba(146, 221, 58, 0.3);
    min-width: 200px;
    justify-content: center;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(146, 221, 58, 0.4);
}

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

.submit-info {
    margin-top: 1rem;
    color: var(--color-medium-gray);
    font-size: 0.9rem;
}

/* Sidebar */
.auth-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-section {
    background: var(--color-white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.sidebar-section h3 {
    font-family: var(--font-accent);
    color: var(--color-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 900;
    font-style: italic;
}

.sidebar-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-section li {
    padding: 0.5rem 0;
    color: var(--color-dark-gray);
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding-left: 1.5rem;
}

.sidebar-section li:before {
    content: "✓";
    color: var(--color-primary);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.sidebar-section li:last-child {
    border-bottom: none;
}

.sidebar-section p {
    color: var(--color-medium-gray);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.sidebar-section a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.sidebar-section a:hover {
    text-decoration: underline;
}

/* États de validation */
.form-group input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group input:valid:not(:focus):not(:placeholder-shown) {
    border-color: #27ae60;
}

/* Messages d'erreur/succès */
.auth-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.auth-message.error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.auth-message.success {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #059669;
}

/* Champs de communauté pour l'inscription */
.community-fields {
    background: rgba(146, 221, 58, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1rem;
    border: 1px solid rgba(146, 221, 58, 0.2);
}

.community-fields .form-group textarea {
    min-height: 60px;
    resize: vertical;
}

/* Styles pour l'upload de photos dans l'inscription */
.photo-upload-container {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.3s ease;
    background: #f9fafb;
}

.photo-upload-container:hover {
    border-color: var(--color-primary);
}

.photo-upload-container input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
}

.photo-upload-container input[type="file"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(146, 221, 58, 0.1);
}

.photo-upload-info {
    margin-top: 0.75rem;
}

.photo-upload-info small {
    color: #6b7280;
    font-size: 0.85rem;
    line-height: 1.4;
}

.photo-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    position: relative;
}

.photo-preview img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-remove-preview {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-remove-preview:hover {
    background: #dc2626;
}

/* Animation pour l'apparition des champs */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
        max-height: 0;
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
        max-height: 500px;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .auth-sidebar {
        order: -1;
    }
}

@media (max-width: 864px) {
    .auth-hero {
        padding: 4rem 0 3rem;
        margin-top: 2.8rem;
    }
    
    .auth-hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .auth-container {
        padding: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .auth-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-bottom: none;
        border-left: 3px solid transparent;
        text-align: left;
    }
    
    .tab-button.active {
        border-left-color: var(--color-primary);
        border-bottom-color: transparent;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-hero h1 {
        font-size: 2rem;
    }
    
    .auth-container {
        padding: 1.5rem;
    }
    
    .btn-primary {
        padding: 1rem 2rem;
        font-size: 1rem;
        min-width: 180px;
    }
    
    .auth-info {
        padding: 1.5rem;
    }
}