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

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

.card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.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: #f8fafc;
}

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

.drop-zone {
    border: 2px dashed #475569;
    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: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
}

.drop-text strong {
    color: #818cf8;
}

#file-name {
    font-size: 0.82rem;
    color: #cbd5e1;
    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: #334155;
    color: #64748b;
    cursor: not-allowed;
}

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

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

.progress-bar-bg {
    background: #334155;
    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.1);
    border: 1px solid #10b981;
    color: #6ee7b7;
}

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

.status.pending {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid #6366f1;
    color: #c7d2fe;
}

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

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

.form-field label {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    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: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    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: #1e293b;
}

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

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

.tab:hover {
    color: #cbd5e1;
}

.tab.active {
    color: #f8fafc;
    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: #f8fafc;
    letter-spacing: 0.05em;
}

.rec-level {
    width: 100%;
    background: #334155;
    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: #cbd5e1;
}

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

/* Indicateur d'état des alertes de coupure (notifications système). */
.rec-alerts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.4;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid #475569;
    color: #cbd5e1;
}

.rec-alerts.ok {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #86efac;
}

.rec-alerts.warn {
    background: rgba(245, 158, 11, 0.12);
    border-color: #f59e0b;
    color: #fcd34d;
}

.rec-alerts-text {
    flex: 1;
}

.rec-alerts-btn {
    flex: none;
    padding: 0.4rem 0.7rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s;
}

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

.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: #fcd34d;
}

.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 #64748b;
    color: #cbd5e1;
    font-weight: 600;
}

.rec-resume.secondary:hover {
    filter: none;
    border-color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
}

/* 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.13);
    border: 1.5px solid #ea580c;
    color: #fdba74;
    font-size: 0.84rem;
    line-height: 1.5;
}

.rec-mobile-banner-icon {
    font-size: 1.5rem;
    flex: none;
    margin-top: 0.05rem;
}

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

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

.rec-tips {
    margin-top: 1.25rem;
    margin-bottom: 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.55;
}

.rec-tips li {
    margin-bottom: 0.4rem;
}
