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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0f172a;
}

.subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 2rem;
    padding-left: 0.1rem;
}

.drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 1.25rem;
    position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    pointer-events: none;
}

.drop-text {
    color: #64748b;
    font-size: 0.9rem;
    pointer-events: none;
}

.drop-text strong {
    color: #6366f1;
}

#file-name {
    font-size: 0.82rem;
    color: #475569;
    margin-top: 0.6rem;
    min-height: 1.2em;
    pointer-events: none;
}

button[type="submit"] {
    width: 100%;
    padding: 0.8rem;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

button[type="submit"]:hover:not(:disabled) {
    background: #4f46e5;
}

button[type="submit"]:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

.progress-wrap {
    margin-top: 1.25rem;
    display: none;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 0.4rem;
}

.progress-bar-bg {
    background: #e2e8f0;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 999px;
    width: 0%;
    transition: width 0.15s linear;
}

.status {
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    display: none;
    line-height: 1.5;
}

.status.success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid #10b981;
    color: #065f46;
}

.status.error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid #ef4444;
    color: #991b1b;
}

.status.pending {
    background: #CDE2FB;
    border: 1px solid #B8D4F0;
    color: #186ABB;
}

.status.pending i {
    vertical-align: middle;
    margin-right: 0.35rem;
    font-size: 1rem;
}

.limit-note {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
}

.form-field {
    margin-bottom: 1rem;
}

.form-field label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.form-field input[type="email"],
.form-field input[type="text"],
.form-field select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #1e293b;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-field input[type="email"]:focus,
.form-field input[type="text"]:focus,
.form-field select:focus {
    border-color: #6366f1;
}

.form-field select option {
    background: #ffffff;
}

/* --- Onglets --- */
.tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.tab {
    flex: 1;
    padding: 1rem 0.75rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    color: #64748b;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.tab:hover {
    color: #475569;
}

.tab.active {
    color: #0f172a;
    border-bottom-color: #6366f1;
}

@media (max-width: 420px) {
    .tab { font-size: 0.95rem; padding: 0.85rem 0.4rem; }
}

[role="tabpanel"][hidden] {
    display: none;
}

/* --- Mode enregistrement --- */
.recorder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 0 0.5rem;
}

.record-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.5rem;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.record-btn:hover:not(:disabled) {
    background: #4f46e5;
}

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

.record-btn .record-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
}

.record-btn.recording {
    background: #ef4444;
}

.record-btn.recording:hover:not(:disabled) {
    background: #dc2626;
}

.record-btn.recording .record-dot {
    background: #fff;
    animation: rec-pulse 1.2s ease-in-out infinite;
}

@keyframes rec-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

.rec-timer {
    font-family: "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
    font-size: 2rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: 0.05em;
}

.rec-level {
    width: 100%;
    background: #e2e8f0;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.rec-level-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 999px;
    transition: width 0.08s linear;
}

.rec-counters {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.82rem;
    color: #475569;
}

.rec-counters span {
    font-weight: 600;
    color: #1e293b;
}

.rec-warning {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.84rem;
    line-height: 1.5;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid #f59e0b;
    color: #92400e;
}

.rec-resume {
    width: 100%;
    margin-top: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s;
}

.rec-resume:hover {
    filter: brightness(1.1);
}

.rec-resume:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: none;
}

/* « Terminer et envoyer » : action secondaire, visuellement neutre. */
.rec-resume.secondary {
    margin-top: 0.5rem;
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-weight: 600;
}

.rec-resume.secondary:hover {
    filter: none;
    border-color: #64748b;
    background: rgba(148, 163, 184, 0.12);
}

/* Bandeau recommandation app mobile — visible uniquement sur Android/iOS mobile */
.rec-mobile-banner[hidden] {
    display: none;
}

.rec-mobile-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: rgba(234, 88, 12, 0.08);
    border: 1.5px solid #ea580c;
    color: #9a3412;
    font-size: 0.84rem;
    line-height: 1.5;
}

.rec-mobile-banner-icon {
    width: 1.4rem;
    height: 1.4rem;
    flex: none;
    margin-top: 0.05rem;
    color: #ea580c;
}

.rec-mobile-banner-body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.rec-mobile-banner-body strong {
    font-size: 0.9rem;
    color: #ea580c;
}

/* Badges App Store / Google Play dans le bandeau mobile */
.rec-store-links {
    margin-top: 0.6rem;
}

.rec-store-badge[hidden] {
    display: none;
}

.rec-store-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.15s;
    line-height: 1.3;
}

.rec-store-badge:hover {
    opacity: 0.88;
}

.rec-store-logo {
    font-size: 1.2rem;
    flex: none;
    line-height: 1;
}

.rec-store-ios {
    background: #1d1d1f;
}

.rec-store-android {
    background: none;
    padding: 0;
    border-radius: 0;
}

.rec-store-android img {
    display: block;
    height: 2.5rem;
    width: auto;
}

/* Accordéon de conseils (mode enregistrement). */
.rec-tips-accordion {
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    background: #f8fafc;
}

.rec-tips-accordion summary {
    cursor: pointer;
    font-weight: 600;
    color: #475569;
    font-size: 0.82rem;
    padding: 0.15rem 0;
    list-style: none;
}

.rec-tips-accordion summary::-webkit-details-marker {
    display: none;
}

.rec-tips-accordion summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 0.4rem;
    font-size: 0.7rem;
    transition: transform 0.15s;
}

.rec-tips-accordion[open] summary::before {
    transform: rotate(90deg);
}

.rec-tips-item {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin-top: 0.55rem;
    line-height: 1.5;
    color: #1b1f25;
}

.rec-tips-icon {
    flex: none;
    margin-top: 0.35rem;
}

/* Version mobile : titre + tour de table uniquement (pas d'accordéon). */
.rec-tips-mobile {
    display: none;
    margin-top: 1.25rem;
    font-size: 0.82rem;
    color: #1b1f25;
    line-height: 1.5;
}

.rec-tips-mobile strong {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: #475569;
}

@media (max-width: 768px) {
    .rec-tips-desktop {
        display: none;
    }
    .rec-tips-mobile {
        display: block;
    }

    /* Forcer l'affichage du bandeau mobile sur petits écrans,
       indépendamment de la détection JS (plus robuste).
       Les badges store sont gérés par JS (showMobileBanner). */
    .rec-mobile-banner[hidden] {
        display: flex;
    }
}

