* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 15px;
    color: #333;
}

/* Largeur harmonisée à 1400px pour toutes les pages */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.8em;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1em;
    opacity: 0.9;
}

/* Navigation des étapes */
.steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    color: rgba(255, 255, 255, 0.5);
}

.step::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    z-index: -1;
}

.step:last-child::after {
    display: none;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.step.active {
    color: white;
}

.step.active .step-number {
    background: white;
    color: #667eea;
    transform: scale(1.1);
}

.step.completed .step-number {
    background: #4caf50;
    color: white;
}

.step-label {
    font-size: 0.85em;
    font-weight: 500;
    text-align: center;
    max-width: 100px;
    word-wrap: break-word;
    line-height: 1.2;
}

/* Cartes */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    padding-top: 80px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
}

.card h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.4em;
    position: absolute;
    top: 25px;
    left: 30px;
    margin-top: 0;
}

.card h3 {
    color: #333;
    margin: 15px 0 10px 0;
    font-size: 1.1em;
}

.card p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* Zone d'upload */
.upload-zone {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    margin: 15px 0;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-zone:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-zone.drag-over {
    border-color: #667eea;
    background: #f0f3ff;
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.file-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
}

/* Boutons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #666;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1em;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.actions {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    gap: 12px;
    z-index: 100;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 1em;
}

.badge-info {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-success {
    background: #e8f5e9;
    color: #388e3c;
}

.badge-warning {
    background: #fff3e0;
    color: #f57c00;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin: 15px 0;
}

.stat-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border-left: 3px solid #667eea;
}

.stat-card.success {
    border-left-color: #4caf50;
}

.stat-card.error {
    border-left-color: #f44336;
}

.stat-number {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.85em;
}

/* Alertes */
.alert {
    padding: 10px 12px;
    border-radius: 6px;
    margin: 10px 0;
}

.alert-success {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

.alert-warning {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    color: #e65100;
}

.alert-info {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    color: #1565c0;
}

.alert-error {
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #c62828;
}

/* Formulaires */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.form-group input[type="text"],
.form-group input[type="datetime-local"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Message Template */
#message-template {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
    line-height: 1.5;
    transition: border 0.3s;
    resize: vertical;
    min-height: 120px;
}

#message-template:focus {
    outline: none;
    border-color: #667eea;
}

/* Code inline pour les variables */
code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #667eea;
    font-weight: 600;
}

/* Preview */
.template-preview {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
}

.message-preview {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    font-family: monospace;
    white-space: pre-wrap;
    line-height: 1.5;
    min-height: 80px;
    font-size: 0.9em;
}

/* Estimation */
.cost-estimate {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin: 12px 0;
}

.estimate-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.estimate-row:last-child {
    border-bottom: none;
}

.estimate-row.total {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
    padding-top: 20px;
    margin-top: 10px;
    border-top: 2px solid #667eea;
}

.estimate-info {
    margin-top: 8px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8ff 100%);
    border-left: 3px solid #2196F3;
    border-radius: 6px;
    white-space: nowrap;
}

.estimate-info small {
    color: #1976D2;
    font-size: 0.75em;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.estimate-info small::before {
    content: "ℹ️";
    margin-right: 4px;
    font-size: 1em;
}

/* Barre de progression */
.progress-container {
    margin: 20px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}

.progress-bar {
    height: 25px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

/* Listes */
.warnings-list,
.errors-list {
    list-style: none;
    padding: 0;
}

.warnings-list li,
.errors-list li {
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 8px;
    background: #fff3e0;
}

.errors-list li {
    background: #ffebee;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader p {
    color: white;
    margin-top: 20px;
    font-size: 1.2em;
}

/* Utilitaires */
.small {
    font-size: 0.85em;
}

.gray {
    color: #999;
}

.detection-result {
    margin: 15px 0;
    text-align: center;
}

.launch-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.launch-summary ul {
    list-style: none;
    padding: 0;
}

.launch-summary li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.launch-summary li:last-child {
    border-bottom: none;
}

.status-badge {
    text-align: center;
    margin: 15px 0;
}

.time-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.time-info p {
    margin: 8px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .steps {
        flex-wrap: wrap;
    }

    .step {
        flex-basis: 33.33%;
        margin-bottom: 20px;
    }

    .step::after {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .card {
        padding: 25px;
        padding-top: 100px;
    }

    .card h2 {
        font-size: 1.2em;
        left: 20px;
        right: 150px;
    }

    .actions {
        top: 20px;
        right: 20px;
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        font-size: 0.85em;
        padding: 8px 16px;
    }
}

/* ========================================
   PRÉVISUALISATION SMS - INTERFACE MOBILE
   ======================================== */

.preview-info {
    margin-bottom: 30px;
}

.phone-preview-container {
    padding: 20px;
}

.preview-layout {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
}

/* Panneau d'informations client à gauche */
.client-info-panel {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    min-width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.client-info-panel h3 {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 20px;
    margin-top: 0;
}

.client-info-panel hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 20px 0;
}

.info-group {
    margin-bottom: 15px;
}

.client-info-panel .info-label {
    font-size: 12px;
    color: #757575;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.client-info-panel .info-value {
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 500;
}

/* Conteneur téléphone avec flèches */
.phone-with-arrows {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Mockup du téléphone */
.phone-mockup {
    width: 340px;
    height: 680px;
    background: #1a1a1a;
    border-radius: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 12px #2d2d2d,
                0 0 0 14px #1a1a1a;
    position: relative;
    overflow: hidden;
}

/* En-tête du téléphone (notch + barre de statut) */
.phone-header {
    background: #000;
    padding: 12px 20px 8px;
    position: relative;
    z-index: 10;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 25px;
    background: #1a1a1a;
    border-radius: 0 0 20px 20px;
}

.phone-time {
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    position: relative;
    z-index: 11;
}

.phone-icons {
    position: absolute;
    right: 20px;
    top: 12px;
    display: flex;
    gap: 5px;
    font-size: 12px;
    z-index: 11;
}

/* Écran du téléphone */
.phone-screen {
    background: linear-gradient(180deg, #e8eaf6 0%, #f5f5f5 100%);
    height: calc(100% - 80px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* En-tête de la conversation SMS */
.sms-header {
    background: white;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.back-button {
    font-size: 24px;
    color: #667eea;
    cursor: pointer;
    font-weight: bold;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-weight: 600;
    font-size: 16px;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.contact-number {
    font-size: 13px;
    color: #757575;
}

/* Zone de conversation */
.sms-conversation {
    flex: 1;
    padding: 20px 15px;
    overflow-y: auto;
}

/* Bulle de message SMS */
.sms-bubble {
    max-width: 75%;
    margin-bottom: 15px;
    animation: slideIn 0.3s ease;
}

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

.sms-bubble.received {
    background: white;
    padding: 12px 15px;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-right: auto;
}

.sms-text {
    color: #1a1a1a;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.sms-time {
    font-size: 11px;
    color: #9e9e9e;
    margin-top: 5px;
    text-align: right;
}

/* Bouton home du téléphone */
.phone-footer {
    background: #000;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-home-button {
    width: 140px;
    height: 5px;
    background: #555;
    border-radius: 3px;
}

/* Boutons de navigation sur les côtés */
.btn-carousel-side {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #667eea;
    background: white;
    color: #667eea;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.btn-carousel-side:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-carousel-side:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    box-shadow: none;
}

.carousel-arrow {
    font-weight: bold;
}

/* Conteneur moderne pour les erreurs */
.errors-modern-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.error-card-modern {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #ff6b6b;
    transition: all 0.3s ease;
    cursor: pointer;
}

.error-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.error-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.error-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.error-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.error-count-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    min-width: 60px;
    text-align: center;
}

.error-card-description {
    margin-top: 12px;
    padding-left: 52px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.error-percentage {
    margin-top: 8px;
    padding-left: 52px;
}

.percentage-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

.percentage-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #ff5252 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.percentage-text {
    font-size: 12px;
    color: #999;
    font-weight: 600;
    margin-top: 4px;
}

/* Sélecteur de type de campagne moderne */
.campaign-type-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px;
}

@media (max-width: 1024px) {
    .campaign-type-selector {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .campaign-type-selector {
        grid-template-columns: 1fr;
    }
}

.campaign-type-card {
    position: relative;
    display: block;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.campaign-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.campaign-type-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.campaign-type-card input[type="radio"]:checked + .card-content {
    color: #667eea;
}

.campaign-type-card input[type="radio"]:checked ~ .card-check {
    opacity: 1;
    transform: scale(1);
}

.campaign-type-card input[type="radio"]:checked ~ * {
    border-color: #667eea;
}

.campaign-type-card input[type="radio"]:checked {
    & ~ * {
        border-color: #667eea;
    }
}

.campaign-type-card:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.card-content {
    position: relative;
    z-index: 1;
}

.card-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
    display: block;
}

.card-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.card-description {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

.card-check {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

/* Responsive pour la prévisualisation mobile */
@media (max-width: 1200px) {
    .preview-layout {
        flex-direction: column;
        align-items: center;
    }

    .client-info-panel {
        width: 100%;
        max-width: 500px;
    }

    .phone-with-arrows {
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .phone-mockup {
        width: 300px;
        height: 600px;
        border-radius: 35px;
    }

    .btn-carousel-side {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }

    .phone-with-arrows {
        gap: 10px;
    }
}
