/* ========================================
   SIGNATURE GENERATOR STYLES
   ======================================== */

/* Container principal */
.signature-form-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Sections du formulaire */
.form-section {
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    background-color: var(--md-code-bg-color);
}

.form-section legend {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--md-primary-fg-color);
    padding: 0 0.5rem;
}

.section-required {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--md-default-fg-color--light);
    font-style: italic;
}

/* Champs de formulaire */
.form-field {
    display: flex;
    flex-direction: column;
    margin-top: 1rem;
    gap: 0.25rem;
}

.form-field--primary {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--md-accent-fg-color--transparent);
    border-radius: 8px;
    border: 2px solid var(--md-accent-fg-color);
}

.form-field label {
    font-weight: 600;
    color: var(--md-default-fg-color);
    font-size: 0.95rem;
}

.form-field input,
.form-field select {
    color: var(--md-default-fg-color);
    background-color: var(--md-default-bg-color);
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 4px;
    max-width: 400px;
    padding: 0.5rem;
    height: 2.5rem;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--md-primary-fg-color);
    box-shadow: 0 0 0 2px var(--md-primary-fg-color--transparent);
}

.form-field input:disabled,
.form-field select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--md-default-fg-color--lightest);
}

.form-field input:disabled::placeholder {
    color: var(--md-default-fg-color--light);
}

/* Indicateurs requis */
.required-indicator {
    color: #d32f2f;
    font-weight: 700;
}

/* Messages d'aide */
.field-help {
    font-size: 0.85rem;
    color: var(--md-default-fg-color--light);
    font-style: italic;
}

/* Messages d'erreur */
.field-error {
    font-size: 0.85rem;
    color: #d32f2f;
    font-weight: 600;
    min-height: 1.2rem;
}

/* États de validation */
.field-invalid {
    border-color: #d32f2f !important;
    background-color: rgba(211, 47, 47, 0.05);
}

.field-valid {
    border-color: #388e3c !important;
}

/* Conteneur téléphones */
.phone-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.phone-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.phone-sublabel {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--md-default-fg-color--light);
}

.phone-label-input {
    max-width: 250px !important;
}

/* Ancienne grille téléphone (conservée pour compatibilité) */
.phone-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Sélecteur de logo */
.logo-preview-container {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--md-default-bg-color);
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 4px;
    text-align: center;
    min-height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-preview {
    max-width: 300px;
    max-height: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
    border: none !important;
}

/* Aperçu de signature */
#signature {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
}

/* Zone de texte brut */
#signature-raw {
    width: 100%;
    height: 300px;
    font-size: 10pt;
    font-family: monospace;
    color: var(--md-default-fg-color);
    background-color: var(--md-code-bg-color);
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 4px;
    padding: 1rem;
    resize: vertical;
}

/* Boutons d'action */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--md-default-fg-color--lightest);
}

.export-section {
    margin: 2rem 0;
}

.export-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Labels désactivés */
.elem-disable {
    color: var(--md-default-fg-color--light);
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
    .form-section {
        padding: 1rem;
    }

    .form-field input,
    .form-field select {
        max-width: 100%;
    }

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

    .export-buttons {
        flex-direction: column;
    }

    .export-buttons button {
        width: 100%;
    }
}

/* Mode sombre - ajustements spécifiques */
[data-md-color-scheme="slate"] #signature {
    background: #2a2f46;
}

[data-md-color-scheme="slate"] .logo-preview-container {
    background-color: rgba(255, 255, 255, 0.05);
}
