* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.header{
    margin: 2vh 0;
    text-align: center;
}
body {
    background-color: #f4f7fa;
    color: #1a1a1a;
    line-height: 1.5;
    padding: 40px 20px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #000000;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.header h1 span {
    color: #ff9320;
}

.header p {
    color: #718096;
    font-size: 1.1rem;
}

/* --- Main Card --- */
.signature-generator {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid #000000; /* Bordure noire principale */
}

.wrap {
    display: grid;
    gap: 40px;
    grid-template-columns: 1.2fr 0.8fr;
}

@media (max-width: 992px) {
    .wrap { grid-template-columns: 1fr; }
}

/* --- Panels --- */
.panel {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
}

.panel h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #000000;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- Form Elements --- */
.row {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #000000;
}

input[type=text],
input[type=email],
input[type=url],
input[type=tel] {
    padding: 12px 16px;
    border: 2px solid #e2e8f0; 
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    border-color: #ff9320; 
    box-shadow: 0 0 0 4px rgba(255, 147, 32, 0.1);
}

/* --- Color Picker Modifié --- */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    position: relative; /* Important pour superposer l'input invisible */
}

.color-circle {
    width: 35px;
    height: 35px;
    border-radius: 10px;
    border: 1px solid #000000;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 2; /* Passe au dessus */
    display: block;
}

.color-circle:hover {
    transform: scale(1.1);
}


input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 35px;
    height: 35px;
    cursor: pointer;
    border: none;
    padding: 0;
    pointer-events: none; 
}


#colorValue {
    font-family: monospace;
    font-weight: 700;
    color: #000000;
    font-size: 0.9rem;
}

/* --- Style Custom pour l'Upload de Logo --- */
input[type="file"] {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

/* On stylise le label qui remplace visuellement l'input */
.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: #ffffff;
    border: 2px dashed #e2e8f0; /* Bordure pointillée pour l'aspect "upload" */
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #718096;
    font-weight: 500;
}

.file-upload-label:hover {
    border-color: #ff9320;
    color: #000000;
    background: #fffaf5;
}

.file-upload-label i {
    font-size: 1.2rem;
}

/* Petit indicateur quand un fichier est chargé */
.file-upload-label.has-file {
    border-style: solid;
    border-color: #000000;
    background: #f0fff4;
    color: #2f855a;
}

/* --- Preview Area --- */
#previewCard {
    background: #636161; /* Fond noir pour l'espace de travail */
    border-radius: 12px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 20px;
}

#previewInner {
    background: white;
    padding: 25px;
    border-radius: 4px;
    width: 100%;
    max-width: 400px;
}

/* --- Buttons --- */
.controls {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #e2e8f0;
}

button {
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid black;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #ff9320;
    color: #000000;
    flex: 2;
}

.btn-primary:hover {
    background: #000000;
    color: #ff9320;
}

.btn-ghost {
    color: black;
    background-color: transparent;
    flex: 1;
}

.btn-ghost:hover {
    color: #fafafa;
    background: #333333;
}

/* --- Signature Content Styles --- */
.sig-name {
    color: #ff9320;
    font-size: 1.3rem;
    font-weight: 800;
}

.sig-role {
    color: #000000;
    font-weight: 600;
    margin-bottom: 10px;
}

.sig-contact {
    color: #4a5568;
    font-size: 0.9rem;
}

/* --- Style interne de la signature générée --- */
.sig-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    text-align: left;
    width: 100%;
}

.sig-info {
    flex: 1;
}

.sig-logo-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 2px solid #e2e8f0; /* Petite barre de séparation */
    padding-left: 20px;
}

.sig-logo {
    max-width: 100px;  /* Largeur max du logo */
    max-height: 100px; /* Hauteur max du logo */
    object-fit: contain;
    border-radius: 4px;
}
#removeLogo {
    margin-top: 15px;
    background: #ff4d4d;
    color: white;
    font-size: 0.7rem;
    padding: 8px 12px;
}

#removeLogo:hover {
    background: #cc0000;
}
/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #535353;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    border: 1px solid #ff9320; /* Rappel de ton orange */
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}
/* Ajustement pour mobile dans l'aperçu */
@media (max-width: 480px) {
    .sig-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: 15px;
    }
    .sig-logo-wrapper {
        border-left: none;
        border-bottom: 2px solid #e2e8f0;
        padding-left: 0;
        padding-bottom: 15px;
    }
}
/* --- Responsivité Globale --- */
@media (max-width: 992px) {
    body {
        padding: 20px 10px;
    }

    .signature-generator {
        padding: 20px;
    }

    .wrap {
        grid-template-columns: 1fr; /* On empile les colonnes */
        gap: 20px;
    }

    #previewCard {
        position: relative; /* On enlève le sticky sur mobile */
        top: 0;
        order: -1; /* Optionnel : affiche la prévisualisation AU-DESSUS du formulaire */
        padding: 20px 10px;
    }
}
@media (max-width: 600px) {
    .header h1 {
        font-size: 2rem;
    }

    .row {
        grid-template-columns: 1fr; /* Force une seule colonne pour les champs nom/prénom */
        gap: 15px;
    }

    .controls {
        flex-direction: column; /* Boutons l'un sur l'autre */
    }

    button {
        width: 100%;
    }

    .btn-ghost {
        order: 2; /* Met le bouton "Reset" ou "Ghost" en dessous du principal */
    }
}
/* Déjà présent dans ton code, mais on peut ajouter une sécurité */
@media (max-width: 480px) {
    #previewInner {
        padding: 15px;
    }

    .sig-container {
        flex-direction: column-reverse; /* Logo en haut, texte en bas */
        text-align: center;
        gap: 15px;
    }

    .sig-logo-wrapper {
        border-left: none;
        border-bottom: 2px solid #e2e8f0;
        padding-left: 0;
        padding-bottom: 15px;
        width: 100%;
    }

    .sig-name {
        font-size: 1.1rem;
    }

    .sig-contact {
        font-size: 0.8rem;
        word-break: break-all; /* Évite que les longs emails cassent le layout */
    }
}