/**
 * Styles CSS pour le système de géolocalisation
 * Version 3.1 - Corrections finales production
 */

/* === CONTENEUR PRINCIPAL === */
#geolocation-offer-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* === MESSAGES === */
#geolocation-messages {
    margin-bottom: 20px;
}

.success-message {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

.success-message::before {
    content: "✓";
    font-size: 18px;
    margin-right: 10px;
    font-weight: bold;
}

.error-message {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

.error-message::before {
    content: "⚠";
    font-size: 18px;
    margin-right: 10px;
    font-weight: bold;
}

/* === ERREURS DE CHAMP === */
.field-error {
    background: #ffebee;
    color: #d32f2f;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 5px;
    font-size: 14px;
    border-left: 3px solid #f44336;
}

/* === BARRE DE PROGRESSION === */
.form-progress {
    margin-bottom: 40px;
    padding: 20px 0;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e0e0e0;
    z-index: 1;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    transform: scale(1.1);
}

.progress-step:not(.active):hover {
    background: #d0d0d0;
}

/* === FORMULAIRE === */
#geolocation-offer-form {
    background: white;
    padding: 0;
}

.form-step {
    padding: 30px 0;
    animation: fadeIn 0.4s ease-out;
    display: none; /* Toutes les étapes cachées par défaut */
}

.form-step#step-1 {
    display: block; /* Étape 1 visible pour non-connectés */
}

.form-step#step-3 {
    display: none; /* Étape 3 cachée par défaut, sera affichée pour connectés via JS */
}

/* Utilisateur connecté : masquer la barre de progression */
[data-user-logged-in="1"] .form-progress {
    display: none;
}

/* Utilisateur connecté : étape 3 visible par défaut */
[data-user-logged-in="1"] #step-3 {
    display: block !important;
}

.form-step h3 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.form-step > p {
    color: #666;
    font-size: 16px;
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* === ÉTAPE 1 - CHOIX COMPTE === */
.account-choice {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

.choice-option {
    position: relative;
}

.choice-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-option label {
    display: block;
    cursor: pointer;
}

.choice-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.choice-card:hover {
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.15);
}

.choice-option input:checked + label .choice-card {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.2);
}

.choice-card .icon-user,
.choice-card .icon-user-plus {
    font-size: 32px;
    color: #2196f3;
    margin-bottom: 15px;
    display: block;
}

.choice-card strong {
    font-size: 18px;
    color: #2c3e50;
    display: block;
    margin-bottom: 8px;
}

.choice-card p {
    color: #666;
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

/* === ÉTAPE 2 - CONNEXION/INSCRIPTION === */
.login-form-container,
.registration-form-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.password-help {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.forgot-password {
    color: #2196f3;
    text-decoration: none;
    font-size: 14px;
    margin-top: 5px;
    display: inline-block;
}

.forgot-password:hover {
    text-decoration: underline;
}

.um-integration-note {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* CORRECTION Problème 5 : Section user-welcome supprimée/masquée */
.user-welcome {
    display: none !important;
}

/* Si jamais elle apparaît, la masquer complètement */
.welcome-message {
    display: none !important;
}

/* === CONFIRMATION SECTION === */
.confirmation-section {
    padding: 30px 0;
}

.confirmation-card {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border: 2px solid #4caf50;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
}

.confirmation-card .icon-check-circle {
    font-size: 48px;
    color: #4caf50;
    margin-bottom: 20px;
    display: block;
}

.confirmation-card h4 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 15px;
}

.confirmation-card p {
    color: #555;
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

/* === ÉTAPE 3 - CERTIFICATION === */
.conditions-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.conditions-section h4 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 20px;
}

.conditions-content ul {
    padding-left: 20px;
    margin-bottom: 25px;
}

.conditions-content li {
    margin-bottom: 8px;
    color: #555;
    line-height: 1.5;
}

.important-notice {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #f39c12;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.important-notice h5 {
    color: #e67e22;
    margin: 0 0 10px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.important-notice .icon-warning {
    margin-right: 8px;
    font-size: 18px;
}

.certification-checkbox {
    margin: 25px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.certification-checkbox input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.certification-checkbox label {
    color: #2c3e50;
    line-height: 1.5;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
}

.location-info {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.location-info h5 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.location-details {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
}

.location-item {
    margin-bottom: 8px;
    font-size: 14px;
}

.location-item:last-child {
    margin-bottom: 0;
}

.location-item.success {
    color: #4caf50;
    font-weight: 600;
}

.location-loader {
    color: #666;
    font-style: italic;
}

.location-note {
    color: #2196f3;
    font-style: italic;
}

.location-error {
    color: #f44336;
    font-weight: 600;
}

/* === BOUTONS === */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
}

.btn.enabled {
    animation: pulse 0.6s ease-out;
}

/* === NAVIGATION === */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.form-navigation .btn + .btn {
    margin-left: 15px;
}

/* === RÉSULTAT FINAL === */
.final-result {
    text-align: center;
    padding: 40px 20px;
}

.final-result-content {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.result-success {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border: 2px solid #4caf50;
}

.result-error {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border: 2px solid #f44336;
}

.result-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.result-success .result-icon {
    color: #4caf50;
}

.result-error .result-icon {
    color: #f44336;
}

.result-message h4 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 15px;
}

.result-message p {
    color: #555;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.next-steps {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-style: italic;
    color: #2e7d32;
}

.retry-info {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid #f44336;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-style: italic;
    color: #c62828;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #geolocation-offer-container {
        margin: 20px;
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .progress-bar {
        max-width: 300px;
    }
    
    .progress-step {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .form-step h3 {
        font-size: 24px;
    }
    
    .choice-card {
        padding: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .form-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-navigation .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-form-container,
    .registration-form-container,
    .conditions-section {
        padding: 20px;
    }
    
    .final-result-content {
        padding: 30px 20px;
    }
    
    .result-icon {
        font-size: 48px;
    }
    
    .result-message h4 {
        font-size: 20px;
    }
}