/**
 * Wizard Installation — Styles du wizard d'installation multi-étapes
 *
 * Overlay, barre de progression, étapes de configuration
 * et mise en forme du processus d'installation guidé.
 *
 * @file        cc-installation-wizard.css
 * @package     CaisseConnect
 * @subpackage  CSS\Pages
 * @since       0.9
 * @version     0.99.6
 * @author      Microlibre <contact@microlibre.net>
 * @copyright   2026 Microlibre
 * @license     GPL-2.0+ https://www.gnu.org/licenses/gpl-2.0.html
 * @link        https://microlibre.net/caisse-connect
 */

/* ============================================
   OVERLAY ET STRUCTURE PRINCIPALE
   ============================================ */

/* Overlay du wizard */
.cc-wizard-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--cc-overlay-bg, rgba(0, 0, 0, 0.6));
    z-index: 999999;
    justify-content: center;
    align-items: center;
}

.cc-wizard-overlay.active {
    display: flex;
}

/* Fenêtre du wizard - TAILLE FIXE 90vh */
.cc-wizard {
    background: var(--cc-white, #fff);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 900px;
    height: 90vh; /* Hauteur fixe : 90% de l'écran */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Important pour que le body scrolle */
}

/* ============================================
   HEADER - HAUTEUR FIXE
   ============================================ */

.cc-wizard-header {
    flex-shrink: 0; /* Ne rétrécit jamais */
    padding: 20px 30px;
    border-bottom: 1px solid var(--cc-border-color, #ddd);
    background: linear-gradient(135deg, var(--cc-primary, #667eea) 0%, var(--cc-primary-dark, #764ba2) 100%);
    border-radius: 8px 8px 0 0;
    color: var(--cc-white, #fff);
}

.cc-wizard-header h2 {
    margin: 0 0 5px 0;
    font-size: 24px;
    color: var(--cc-white, #fff);
}

.cc-wizard-step-indicator {
    font-size: 14px;
    opacity: 0.9;
    color: var(--cc-white, #fff);
}

/* ============================================
   BODY - HAUTEUR FLEXIBLE AVEC SCROLL
   ============================================ */

.cc-wizard-body {
    flex: 1; /* Prend tout l'espace disponible */
    overflow-y: auto; /* Scroll si contenu dépasse */
    padding: 30px;
    min-height: 0; /* Important pour flex + overflow */
}

/* Conteneur d'étape */
.cc-wizard-step {
    display: none;
}

.cc-wizard-step.active {
    display: block;
}

/* Titre de l'étape */
.cc-wizard-step-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--cc-text, #333);
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--cc-primary, #667eea);
}

/* Intro de chaque étape */
.cc-wizard-step-intro {
    margin-bottom: 25px;
    padding: 15px;
    background: var(--cc-info-bg, #e7f3ff);
    border-left: 4px solid var(--cc-info-alt, #2196f3);
    border-radius: 4px;
}

.cc-wizard-step-intro p {
    margin: 0;
    line-height: 1.6;
}

/* ============================================
   MESSAGES ET SPINNER
   ============================================ */

/* Messages d'erreur/succès */
.cc-wizard-message {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
    display: none;
}

.cc-wizard-message.visible {
    display: block;
}

.cc-wizard-message.error {
    background: var(--cc-error-bg, #f8d7da);
    border-left-color: var(--cc-error, #dc3545);
    color: var(--cc-error-text, #721c24);
}

.cc-wizard-message.success {
    background: #fff;
    border-left-color: var(--cc-success, #28a745);
    color: inherit;
}

.cc-wizard-message.info {
    background: var(--cc-info-bg, #e7f3ff);
    border-left-color: var(--cc-info, #0073aa);
    color: var(--cc-info-text, #383d41);
}

/* Progress spinner pour test connexion */
.cc-wizard-spinner {
    display: none;
    text-align: center;
    padding: 20px;
}

.cc-wizard-spinner.visible {
    display: block;
}

.cc-wizard-spinner-icon {
    border: 4px solid var(--cc-gray-200, #f5f5f5);
    border-top: 4px solid var(--cc-primary, #667eea);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* @keyframes spin est dans core/cc-animations.css */

/* ============================================
   FORMULAIRES
   ============================================ */

.cc-wizard-form-group {
    margin-bottom: 25px;
}

.cc-wizard-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--cc-text, #333);
}

.cc-wizard-form-group select,
.cc-wizard-form-group input[type="text"],
.cc-wizard-form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cc-border-color, #ddd);
    border-radius: 4px;
    font-size: 14px;
}

.cc-wizard-form-group select:focus,
.cc-wizard-form-group input:focus {
    border-color: var(--cc-primary, #667eea);
    outline: none;
    box-shadow: 0 0 0 3px var(--cc-primary-focus, rgba(102, 126, 234, 0.1));
}

.cc-wizard-form-group .description {
    margin-top: 5px;
    font-size: 13px;
    color: var(--cc-gray-700, #666);
    line-height: 1.5;
}

/* Tables dans le wizard */
.cc-wizard-body table.form-table {
    width: 100%;
    border-collapse: collapse;
}

.cc-wizard-body table.form-table th {
    text-align: left;
    padding: 12px;
    font-weight: 600;
    background: var(--cc-gray-200, #f5f5f5);
    border-bottom: 2px solid var(--cc-border-color, #ddd);
}

.cc-wizard-body table.form-table td {
    padding: 12px;
    border-bottom: 1px solid var(--cc-gray-350, #eee);
}

/* ============================================
   ZONE D'IMPORT (ÉTAPE 6)
   ============================================ */

.cc-wizard-import-progress {
    margin-top: 20px;
    padding: 20px;
    background: var(--cc-gray-100, #f9f9f9);
    border: 1px solid var(--cc-border-color, #ddd);
    border-radius: 4px;
}

.cc-wizard-import-messages {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: var(--cc-white, #fff);
    border: 1px solid var(--cc-border-color, #ddd);
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
}

.cc-wizard-import-message {
    padding: 5px 0;
}

.cc-wizard-import-message.info {
    color: var(--cc-info, #0073aa);
}

.cc-wizard-import-message.success {
    color: var(--cc-success-text, #155724);
}

.cc-wizard-import-message.error {
    color: var(--cc-error-text, #721c24);
}

/* ============================================
   MESSAGE DE SUCCÈS FINAL (ÉTAPE 7)
   ============================================ */

.cc-wizard-success {
    text-align: center;
    padding: 40px 20px;
}

.cc-wizard-success-icon {
    font-size: 72px;
    color: var(--cc-success, #28a745);
    margin-bottom: 50px;
}

.cc-wizard-success h3 {
    font-size: 24px;
    color: var(--cc-text, #333);
    margin-bottom: 15px;
}

.cc-wizard-success p {
    font-size: 16px;
    color: var(--cc-gray-700, #666);
    line-height: 1.6;
}

/* ============================================
   FOOTER - HAUTEUR FIXE, TOUJOURS EN BAS
   ============================================ */

.cc-wizard-footer {
    flex-shrink: 0; /* Ne rétrécit jamais */
    padding: 20px 30px;
    border-top: 1px solid var(--cc-border-color, #ddd);
    background: var(--cc-gray-200, #f5f5f5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 8px 8px;
}

.cc-wizard-footer-left {
    flex: 1;
}

.cc-wizard-footer-right {
    display: flex;
    gap: 10px;
}

/* ============================================
   BOUTONS - TOUS AVEC MÊME STYLE GRADIENT
   ============================================ */

/* Style de base pour TOUS les boutons */
.cc-wizard-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    /* GRADIENT VIOLET POUR TOUS */
    background: linear-gradient(135deg, var(--cc-primary, #667eea) 0%, var(--cc-primary-dark, #764ba2) 100%) !important;
    color: var(--cc-white, #fff) !important;
}

.cc-wizard-btn:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--cc-primary-shadow, rgba(102, 126, 234, 0.3));
}

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

/* Les classes spécifiques n'ajoutent RIEN - juste pour la sémantique */
.cc-wizard-btn-cancel {
    /* Hérite tout de .cc-wizard-btn */
}

.cc-wizard-btn-secondary {
    /* Hérite tout de .cc-wizard-btn */
}

.cc-wizard-btn-primary {
    /* Hérite tout de .cc-wizard-btn */
}

/* ============================================
   SCROLLBAR PERSONNALISÉE
   ============================================ */

.cc-wizard-body::-webkit-scrollbar {
    width: 10px;
}

.cc-wizard-body::-webkit-scrollbar-track {
    background: var(--cc-gray-200, #f5f5f5);
}

.cc-wizard-body::-webkit-scrollbar-thumb {
    background: var(--cc-gray-600, #999);
    border-radius: 5px;
}

.cc-wizard-body::-webkit-scrollbar-thumb:hover {
    background: var(--cc-text-light, #555);
}

/* ============================================
   RESPONSIVE (MINIMAL)
   ============================================ */

@media (max-width: 782px) {
    .cc-wizard {
        width: 95%;
        max-width: none;
    }
    
    .cc-wizard-header {
        padding: 15px 20px;
    }
    
    .cc-wizard-body {
        padding: 20px;
    }
    
    .cc-wizard-footer {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }
    
    .cc-wizard-footer-right {
        width: 100%;
        flex-direction: column;
    }
    
    .cc-wizard-btn {
        width: 100%;
    }
}

/* ============================================
   MASQUAGE LIGNE CONDITIONNELLE LIVRAISON
   ============================================ */

.cc-expedition-row-hidden {
    display: none !important;
}

/* ============================================
   ÉTOILE OBLIGATOIRE
   ============================================ */

/* Étoile rouge pour champs obligatoires */
.cc-required {
    color: var(--cc-error, #dc3545);
    font-weight: bold;
}

/* ============================================
   ENCADRÉ INSTALLATION REQUISE (page Accueil)
   ============================================ */

.cc-installation-requise-wrapper {
    max-width: 800px;
    margin-top: 20px;
}

/* Encadré principal - contenu centré */
.cc-installation-requise {
    text-align: center;
    padding: 40px 30px;
}

.cc-installation-requise h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Bouton "Masquer" sous le cadre, aligné à droite */
.cc-installation-requise__masquer {
    text-align: right;
    margin-top: 8px;
}

.cc-installation-requise__masquer .cc-btn-masquer {
    font-size: 12px;
    color: var(--cc-wp-text-secondary, #646970) !important;
    text-decoration: underline !important;
}

.cc-installation-requise__masquer .cc-btn-masquer:hover {
    color: var(--cc-wp-text, #1d2327) !important;
}