/* ========================================
   STYLES CSS POUR LES COMPOSANTS SÉCURISÉS
   Morgan Digital Landing Page
   ======================================== */

/* Messages de formulaire sécurisés */
.form-messages {
    margin-top: 1rem;
    min-height: 0;
    transition: all 0.3s ease;
}

.form-message {
    margin: 0.5rem 0;
    padding: 1rem;
    border-radius: var(--radius-md, 8px);
    text-align: center;
    font-weight: 500;
    animation: messageSlideIn 0.5s ease;
    border: 1px solid transparent;
    position: relative;
}

.form-message.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: #10b981;
}

.form-message.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

.form-message.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: #f59e0b;
}

.form-message.info {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: #3b82f6;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 100px;
    }
}

/* Validation des champs de formulaire */
.form-group input:invalid,
.form-group textarea:invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

.form-group input:valid,
.form-group textarea:valid {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

/* Messages d'aide pour validation */
.form-group input:invalid + .validation-message,
.form-group textarea:invalid + .validation-message {
    display: block;
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.validation-message {
    display: none;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Indicateur de soumission sécurisée */
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}

.btn.submitting::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Protection visuelle contre le clickjacking */
.security-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    font-family: 'Arial', sans-serif;
}

.security-overlay.active {
    display: flex;
}

.security-message {
    text-align: center;
    padding: 2rem;
    background: #1f2937;
    border-radius: 8px;
    max-width: 500px;
    margin: 0 1rem;
}

/* Styles pour les offres sécurisées (sans fausse urgence) */
.offer-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: center;
    border-radius: var(--radius-lg, 12px);
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

.offer-banner.legitimate-urgency {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: none; /* Pas d'animation trompeuse */
}

.offer-banner .timer {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.2em;
    margin: 0.5rem 0;
}

/* Badges de sécurité */
.security-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid #10b981;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.25rem;
}

.security-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: #f59e0b;
}

.security-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

.security-badge::before {
    content: '🔒';
    margin-right: 0.25rem;
}

/* Animations sécurisées (non trompeuses) */
@keyframes gentlePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.secure-element {
    animation: fadeIn 0.5s ease-in-out;
}

/* Rate limiting visuel */
.rate-limit-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 1rem;
    border-radius: var(--radius-md, 8px);
    margin: 1rem 0;
    text-align: center;
}

.rate-limit-warning strong {
    display: block;
    margin-bottom: 0.5rem;
}

/* Indicateurs de chargement sécurisé */
.loading-indicator {
    display: none;
    text-align: center;
    padding: 1rem;
    color: #6b7280;
}

.loading-indicator.active {
    display: block;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 0.5rem;
}

/* Protection contre les attaques de social engineering */
.trust-indicator {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 4px;
    margin: 1rem 0;
    font-size: 0.875rem;
    color: #065f46;
}

.trust-indicator::before {
    content: '✓';
    color: #10b981;
    font-weight: bold;
    margin-right: 0.5rem;
    font-size: 1em;
}

/* Styles pour les compteurs authentiques */
.authentic-countdown {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #1e293b;
    text-align: center;
}

.authentic-countdown.expiring {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
    animation: gentlePulse 2s infinite;
}

/* Contrôles de confidentialité */
.privacy-controls {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md, 8px);
    padding: 1rem;
    margin: 1rem 0;
}

.privacy-controls h4 {
    margin: 0 0 0.5rem 0;
    color: #374151;
    font-size: 0.925rem;
    font-weight: 600;
}

.privacy-checkbox {
    display: flex;
    align-items: flex-start;
    margin: 0.5rem 0;
}

.privacy-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.privacy-checkbox label {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.4;
    cursor: pointer;
}

/* Responsive pour la sécurité mobile */
@media (max-width: 768px) {
    .form-message {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .security-message {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }
    
    .trust-indicator {
        font-size: 0.8125rem;
        padding: 0.375rem;
    }
    
    .authentic-countdown {
        font-size: 1rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Mode sombre sécurisé */
@media (prefers-color-scheme: dark) {
    .form-message.success {
        background-color: rgba(16, 185, 129, 0.2);
        color: #34d399;
    }
    
    .form-message.error {
        background-color: rgba(239, 68, 68, 0.2);
        color: #f87171;
    }
    
    .security-message {
        background: #111827;
        color: #f3f4f6;
    }
    
    .authentic-countdown {
        background: #1f2937;
        border-color: #374151;
        color: #e5e7eb;
    }
    
    .privacy-controls {
        background: #1f2937;
        border-color: #374151;
    }
    
    .privacy-controls h4 {
        color: #e5e7eb;
    }
    
    .privacy-checkbox label {
        color: #d1d5db;
    }
}

/* Accessibilité renforcée pour la sécurité */
@media (prefers-reduced-motion: reduce) {
    .form-message,
    .loading-spinner,
    .authentic-countdown.expiring,
    .secure-element {
        animation: none;
    }
    
    .btn.submitting::after {
        animation: none;
        content: '...';
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        border: none;
    }
}

/* Focus visible pour la navigation au clavier */
.form-group input:focus,
.form-group textarea:focus,
.btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}