:root {
    --primary: #f5930b;
    --primary-dark: #f59e0b36;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f59e0b63 0%, #a2574b 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* HEADER */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 24px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-icon {
    font-size: 2rem;
}

.character-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* CONTENU */
.content {
    padding: 24px 30px;
}

/* SECTIONS COMPACTES */
.section {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.95rem;
}

/* Badge clé enregistrée */
.key-badge {
    background: #d4edda;
    color: #155724;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: auto;
    border: 1px solid #c3e6cb;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* INPUTS MODERNISÉS */
.input-group {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

input[type="password"],
input[type="file"],
input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.9rem;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    transition: all 0.2s;
    background: white;
}

input[type="password"]:focus,
input[type="file"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input[type="file"] {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* BOUTONS */
button {
    padding: 10px 18px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: var(--shadow);
    position: relative;
}

button:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

.btn-success {
    background: var(--success);
}

.btn-success:hover:not(:disabled) {
    background: var(--success-dark);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:disabled {
    background: var(--gray-300);
}

.btn-warning {
    background: var(--warning);
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-info {
    background: var(--info);
}

.btn-info:hover:not(:disabled) {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-icon:hover:not(:disabled) {
    background: var(--gray-300);
    box-shadow: none;
}

/* LOADING BAR */
.loading-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.5) 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 0 0 8px 8px;
}

button.loading {
    pointer-events: none;
    opacity: 0.7;
}

button.loading .loading-bar {
    animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

/* ALERTES */
.alert {
    margin-top: 12px;
    padding: 10px 14px;
    background: #d1fae5;
    border-left: 4px solid var(--success);
    color: #065f46;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.alert-info {
    background: #dbeafe;
    border-left-color: var(--info);
    color: #1e40af;
}

.alert-warning {
    background: #fef3c7;
    border-left-color: var(--warning);
    color: #92400e;
}

.hidden {
    display: none;
}

/* ============================================ */
/* STYLES BIBLIOTHÈQUES DE VOIX - NOUVEAU      */
/* ============================================ */

.category-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.category-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 25px;
    border-radius: 12px;
    min-width: 400px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.category-modal-content h3 {
    margin: 0 0 20px 0;
    color: var(--gray-900);
    font-size: 1.4rem;
    text-align: center;
}

.voice-selector {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid var(--gray-200);
    padding: 10px;
    border-radius: 8px;
    background: var(--gray-50);
}

.voice-checkbox {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.2s;
}

.voice-checkbox:hover {
    background: #e0e7ff;
}

/* Bouton Play pour écouter les voix dans voiceSelector */
.voice-play-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.voice-play-btn:hover {
    background: var(--success-dark);
    transform: scale(1.05);
}

.voice-play-btn:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

.voice-play-btn.playing {
    background: var(--warning);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Icône du bouton */
.play-icon {
    font-size: 0.9rem;
}


.voice-checkbox input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.voice-checkbox label {
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    color: var(--gray-700);
    flex: 1;
}

.category-manager {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    padding: 18px;
    border-radius: 10px;
    border: 2px solid #c7d2fe;
}

.category-manager h4 {
    margin: 0 0 16px 0;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 700;
}

.active-category-section {
    margin-bottom: 14px;
}

.active-category-section label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.category-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.category-controls button {
    padding: 9px 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

#createCategoryBtn {
    background: var(--success);
}

#createCategoryBtn:hover:not(:disabled) {
    background: var(--success-dark);
}

#editCategoryBtn {
    background: var(--info);
}

#editCategoryBtn:hover:not(:disabled) {
    background: #2563eb;
}

#deleteCategoryBtn {
    background: #ef4444;
}

#deleteCategoryBtn:hover:not(:disabled) {
    background: #dc2626;
}

#refreshCategoriesBtn {
    background: #17a2b8;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

#refreshCategoriesBtn:hover {
    background: #138496;
    transform: rotate(90deg);
}

#categoryPreview {
    max-height: 90px;
    overflow-y: auto;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 10px;
    background: white;
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.5;
}

#categoryPreview::-webkit-scrollbar {
    width: 6px;
}

#categoryPreview::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

#categoryPreview::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

#categoryPreview::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}

#activeCategorySelect {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    background: white;
    font-weight: 500;
    transition: all 0.2s;
}

#activeCategorySelect:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ============================================ */
/* FIN STYLES BIBLIOTHÈQUES                     */
/* ============================================ */

/* CARTES PERSONNAGES */
.character-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.character-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.character-card.validated {
    border-color: var(--success);
    background: #f0fdf4;
}

.character-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.character-icon {
    font-size: 1.2rem;
}

.character-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-900);
}

.character-length {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.replique-text {
    background: var(--gray-50);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    color: var(--gray-700);
    line-height: 1.6;
    margin-bottom: 12px;
    font-size: 0.88rem;
}

/* MODE SÉLECTION */
.mode-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px;
    background: var(--gray-100);
    border-radius: 8px;
}

.mode-btn {
    flex: 1;
    padding: 8px 12px;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.mode-btn:hover:not(.active) {
    border-color: var(--primary);
    background: var(--gray-50);
}

/* CONTRÔLES VOIX */
.voice-controls {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 8px;
    align-items: center;
}

select {
    padding: 10px 12px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    background: white;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

select:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

/* PARAMÈTRES VOIX */
.voice-params {
    background: var(--gray-50);
    padding: 14px;
    border-radius: 8px;
    border: 2px solid var(--gray-200);
    margin-top: 12px;
    display: none;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.voice-params.show {
    display: block;
}

.params-title {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 6px;
}

.param-row {
    display: grid;
    grid-template-columns: 100px 1fr 55px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.param-row:last-child {
    margin-bottom: 0;
}

.param-label {
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.8rem;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--gray-200);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

input[type="range"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.param-value {
    text-align: right;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.85rem;
    background: white;
    padding: 4px 8px;
    border-radius: 6px;
}

/* TEXTAREA PROMPT */
.prompt-area {
    margin-top: 12px;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.prompt-label {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.prompt-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
    line-height: 1.4;
}

/* VOICE DESIGN SECTION */
.voice-design-section {
    background: #eff6ff;
    padding: 14px;
    border-radius: 8px;
    border: 2px solid #3b82f6;
    margin-top: 12px;
}

.voice-design-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: #1e40af;
}

.voice-preview {
    background: white;
    padding: 10px;
    border-radius: 6px;
    margin-top: 8px;
    border: 1px solid var(--gray-200);
}

.voice-preview-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 600;
    margin-bottom: 4px;
}

.voice-preview-id {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--info);
    word-break: break-all;
}

/* ACTIONS APRÈS VALIDATION */
.validated-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

/* VOICE PREVIEWS */
.voice-previews-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
}

.voice-preview-card {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.2s;
}

.voice-preview-card:hover {
    border-color: var(--info);
    transform: translateX(2px);
}

.voice-preview-card.selected {
    border-color: var(--success);
    background: #f0fdf4;
}

.voice-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.voice-preview-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-900);
}

.voice-preview-play {
    padding: 4px 12px;
    font-size: 0.75rem;
}

/* JSON PREVIEW */
#jsonPreview {
    margin-top: 16px;
    background: var(--gray-900);
    color: #e5e7eb;
    padding: 16px;
    border-radius: 10px;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600);
}

/* HELPERS */
.help-text {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 6px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-600);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .content {
        padding: 16px 20px;
    }

    .header {
        padding: 20px;
        flex-direction: column;
        gap: 12px;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .voice-controls {
        grid-template-columns: 1fr;
    }

    .btn-small {
        width: 100%;
    }

    .validated-actions {
        grid-template-columns: 1fr;
    }

    .category-controls {
        grid-template-columns: 1fr;
    }

    .category-modal-content {
        min-width: 90vw;
        padding: 20px;
    }
}



/* Footer simplifié */
.contact-footer {
    background: linear-gradient(135deg, #f59e0b 0%, #764ba2 100%);
    padding: 50px 20px;
    margin-top: 60px;
    text-align: center;
    color: white;
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
}

.contact-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }
}

.contact-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: white;
}

.contact-description {
    font-size: 1rem;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

/* Bouton principal */
.contact-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: white;
    color: #667eea;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.contact-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
}

.btn-arrow {
    transition: transform 0.3s ease;
}

.contact-btn-primary:hover .btn-arrow {
    transform: translateX(5px);
}

/* Modale */
.contact-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.contact-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.4s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bouton fermer */
.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--gray-200);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--gray-700);
}

.close-modal:hover {
    background: var(--gray-300);
    transform: rotate(90deg);
}

/* Titres formulaire */
.form-title {
    font-size: 1.6rem;
    color: var(--gray-900);
    margin-bottom: 6px;
    font-weight: 700;
}

.form-subtitle {
    font-size: 0.95rem;
    color: var(--gray-600);
    margin-bottom: 24px;
}

/* Groupes de champs */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Section RGPD */
.rgpd-section {
    background: #f0f9ff;
    padding: 18px;
    border-radius: 10px;
    border: 2px solid #bae6fd;
    margin: 24px 0;
}

.rgpd-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0c4a6e;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0f2fe;
}

.checkbox-group:last-child {
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

.checkbox-group label {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--gray-700);
    cursor: pointer;
    margin: 0;
    font-weight: 400;
}

.checkbox-group label strong {
    color: var(--gray-900);
    font-weight: 600;
}

/* Boutons d'action */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-secondary {
    flex: 1;
    padding: 12px 20px;
    background: var(--gray-200);
    color: var(--gray-700);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-primary {
    flex: 2;
    padding: 12px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: #5558e3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Message de confirmation */
.confirmation-message {
    text-align: center;
    padding: 40px 20px;
}

.confirmation-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.confirmation-message h3 {
    font-size: 1.4rem;
    color: var(--success);
    margin-bottom: 10px;
}

.confirmation-message p {
    color: var(--gray-600);
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .contact-modal {
        padding: 10px;
    }

    .contact-modal-content {
        padding: 24px 20px;
    }

    .form-title {
        font-size: 1.3rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .checkbox-group {
        padding: 10px;
    }

    .checkbox-group label {
        font-size: 0.8rem;
    }
}

/* Tooltips pour les paramètres vocaux */
.param-label-with-tooltip {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tooltip-icon {
    cursor: help;
    font-size: 0.85rem;
    background: #e0e7ff;
    color: #4f46e5;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.2s;
}

.tooltip-icon:hover {
    background: #4f46e5;
    color: white;
    transform: scale(1.1);
}

.tooltip-content {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.6;
    z-index: 1000;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-content.hidden {
    display: none;
}

.param-row {
    position: relative;
}

/* === CONTENEUR DU BOUTON D'UPLOAD === */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    margin: 16px 0;
}

/* === MASQUER L'INPUT NATIF === */
.file-input-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* === BOUTON STYLISÉ === */
.file-upload-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 32px;
    width: 100%;

    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px dashed transparent;
    border-radius: 12px;

    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.25);

    position: relative;
    overflow: hidden;
}

/* === EFFET DE BRILLANCE === */
.file-upload-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(255, 255, 255, 0.1),
            transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
}

.file-upload-btn:hover::before {
    left: 100%;
}

/* === ICÔNE === */
.upload-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

/* === TEXTE PRINCIPAL === */
.upload-text {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* === TEXTE HINT === */
.upload-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

/* === HOVER === */
.file-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
    border-color: rgba(255, 255, 255, 0.3);
}

.file-upload-btn:hover .upload-icon {
    transform: scale(1.1) rotate(5deg);
}

/* === ACTIVE (CLIC) === */
.file-upload-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* === FOCUS (ACCESSIBILITÉ) === */
.file-input-hidden:focus+.file-upload-btn {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

/* === AFFICHAGE DU NOM DE FICHIER === */
.file-name-display {
    margin-top: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8edf3 100%);
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-size: 0.9rem;
    color: #2d3748;
    font-weight: 600;
    text-align: left;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: none;
}

.file-name-display.show {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.file-name-display::before {
    content: '✅ ';
    margin-right: 8px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .file-upload-btn {
        padding: 20px 24px;
    }

    .upload-icon {
        font-size: 2rem;
    }

    .upload-text {
        font-size: 0.95rem;
    }

    .upload-hint {
        font-size: 0.75rem;
    }
}

/* === VOICE PREVIEWS COMPACTS === */
.voice-preview-card-compact {
    padding: 14px 16px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
}

.voice-preview-card-compact:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #6366f1;
}

.voice-preview-card-compact:active {
    transform: scale(0.98);
}

.voice-previews-grid {
    margin-top: 12px;
}

/* Badge "Clé enregistrée" */
.key-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: auto;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.hidden {
    display: none !important;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-small {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}



.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: help;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    margin-left: 6px;
}

.info-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.5);
}

.tooltip-content {
    position: absolute;
    left: 140px;
    top: -10px;
    z-index: 1000;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.6;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    max-width: 320px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tooltip-content:not(.hidden) {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.tooltip-content strong {
    color: #60a5fa;
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(96, 165, 250, 0.3);
    padding-bottom: 6px;
}

.tooltip-content em {
    color: #fbbf24;
    font-style: normal;
    display: block;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(251, 191, 36, 0.3);
    font-size: 0.8rem;
}