/* VoxNote - charte HPO LAB : Karla 400/700, noir/blanc, container 680px, nav 56px
   Version ergonomie tournée : barre d'enregistrement fixe en bas (zone du pouce),
   mode enregistrement plein écran, cibles tactiles 48px+, boutons Copier */

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

:root {
    --noir: #000;
    --blanc: #fff;
    --gris: #f4f4f4;
    --gris-texte: #666;
    --rouge: #c0392b;
    --vert: #1e7d4f;
}

html { overscroll-behavior-y: contain; }

body {
    font-family: 'Karla', Arial, sans-serif;
    font-weight: 400;
    background: var(--blanc);
    color: var(--noir);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 17px;
}

button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.container { max-width: 680px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* Navigation */
.topnav {
    height: 56px;
    background: var(--noir);
    color: var(--blanc);
    display: flex;
    align-items: center;
    padding-top: env(safe-area-inset-top);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { font-weight: 700; letter-spacing: 0.18em; font-size: 15px; }
.nav-link {
    background: none; border: none; color: var(--blanc);
    font-family: inherit; font-size: 15px; cursor: pointer; opacity: 0.85;
    padding: 12px 0;
}
.nav-link:hover { opacity: 1; text-decoration: underline; }

/* Le padding bas laisse la place à la barre d'enregistrement fixe */
main { flex: 1; padding: 24px 0 190px; }

/* Hero login */
.hero { text-align: center; padding: 40px 0 28px; }
.hero h1 { font-size: 32px; font-weight: 700; }
.hero .sub { color: var(--gris-texte); margin-top: 8px; font-size: 17px; }

/* Cartes */
.card {
    background: var(--gris);
    border-radius: 10px;
    padding: 28px;
    margin: 0 auto 32px;
}

/* Login */
#login-form { display: flex; flex-direction: column; gap: 16px; max-width: 380px; margin: 0 auto; }
#login-form label { font-weight: 700; font-size: 16px; }
#login-form input[type="password"] {
    padding: 16px; border: 1px solid #ccc; border-radius: 8px;
    font-family: inherit; font-size: 18px;
}
#login-form input[type="password"]:focus { outline: 2px solid var(--noir); border-color: var(--noir); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400 !important; font-size: 15px !important; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--noir); }

/* Boutons */
.btn {
    padding: 14px 22px; border-radius: 8px; border: none;
    font-family: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
    min-height: 48px;
}
.btn-big { font-size: 18px; min-height: 56px; }
.btn-dark { background: var(--noir); color: var(--blanc); }
.btn-dark:hover { background: #222; }
.btn-light { background: var(--blanc); color: var(--noir); border: 2px solid var(--noir); }
.btn-light:hover { background: var(--gris); }
.btn[disabled] { opacity: 0.5; cursor: wait; }

.error { color: var(--rouge); font-size: 15px; }

/* Barre d'enregistrement fixe en bas : le coeur de l'appli, sous le pouce */
.record-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--blanc);
    border-top: 1px solid #e2e2e2;
    box-shadow: 0 -4px 18px rgba(0,0,0,0.10);
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
    z-index: 50;
}
.record-status {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; max-width: 680px; margin: 0 auto 10px;
}
#rec-label { font-weight: 700; font-size: 16px; line-height: 1.35; }
#rec-timer { font-size: 22px; font-variant-numeric: tabular-nums; }
.record-rect {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    width: 100%; max-width: 680px; margin: 0 auto;
    min-height: 76px;
    background: var(--noir); color: var(--blanc);
    border: none; border-radius: 14px; cursor: pointer;
    font-family: inherit; font-weight: 700; font-size: 21px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    transition: transform 0.12s ease;
}
.record-rect:active { transform: scale(0.97); }
.record-dot {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--rouge); flex-shrink: 0;
}

/* Mode enregistrement plein écran : impossible de se tromper */
.rec-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: var(--noir); color: var(--blanc);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 28px;
    padding: 24px 24px calc(28px + env(safe-area-inset-bottom));
    text-align: center;
}
.rec-overlay[hidden] { display: none; }
.rec-overlay-label { font-size: 22px; font-weight: 700; opacity: 0.85; }
.rec-overlay-timer {
    font-size: 76px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    animation: pulse 1.4s ease-in-out infinite;
}
.rec-stop-btn {
    width: 100%; max-width: 420px;
    min-height: 96px;
    background: var(--rouge); color: var(--blanc);
    border: none; border-radius: 16px; cursor: pointer;
    font-family: inherit; font-weight: 700; font-size: 24px;
}
.rec-stop-btn:active { transform: scale(0.97); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* Notes */
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 21px; font-weight: 700; }
.badge {
    background: var(--noir); color: var(--blanc);
    border-radius: 999px; padding: 2px 12px; font-size: 14px; font-weight: 700;
}
.btn-copy-all {
    margin-left: auto;
    background: var(--blanc); border: 2px solid var(--noir); border-radius: 8px;
    font-family: inherit; font-weight: 700; font-size: 15px;
    padding: 10px 16px; min-height: 44px; cursor: pointer;
}
.btn-copy-all.copied, .note-tools button.copied { background: var(--vert); color: var(--blanc); border-color: var(--vert); }
.notes-list { list-style: none; margin-bottom: 40px; }
.note {
    border-bottom: 1px solid #e2e2e2;
    padding: 16px 0;
}
.note-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.note-time { font-weight: 700; font-size: 14px; }
.note-pending { color: var(--rouge); font-size: 14px; }
.note-tools { margin-left: auto; display: flex; gap: 8px; }
.note-tools button {
    background: none; border: 1px solid #ccc; border-radius: 6px;
    font-family: inherit; font-size: 15px; padding: 10px 14px; cursor: pointer;
    min-height: 44px;
}
.note-tools button:hover { border-color: var(--noir); }
.note-text { font-size: 17px; line-height: 1.6; white-space: pre-wrap; }
.note-edit {
    width: 100%; min-height: 110px; font-family: inherit; font-size: 17px;
    padding: 12px; border: 1px solid var(--noir); border-radius: 8px;
}
.empty { color: var(--gris-texte); margin-bottom: 40px; font-size: 16px; }

/* Compte rendu */
.bilan-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.bilan-result {
    background: var(--gris); border-radius: 10px; padding: 24px;
    line-height: 1.65; margin-bottom: 12px; font-size: 16px;
}
.bilan-result h3 { margin: 18px 0 8px; font-size: 17px; }
.bilan-result h3:first-child { margin-top: 0; }
.bilan-result ul { padding-left: 22px; }
.bilan-result li { margin-bottom: 5px; }
.hint { color: var(--gris-texte); font-size: 14px; line-height: 1.5; }

.install-section { margin-top: 8px; }
.install-section .btn { width: 100%; }

/* Pied de page */
.footer {
    background: var(--noir); color: var(--blanc);
    padding: 18px 0 calc(18px + env(safe-area-inset-bottom)); font-size: 13px; letter-spacing: 0.08em;
}

@media (max-width: 480px) {
    .bilan-actions { flex-direction: column; }
    .bilan-actions .btn { width: 100%; }
    .note-tools { margin-left: 0; width: 100%; }
    .note-tools button { flex: 1; }
    .record-rect { min-height: 84px; font-size: 22px; }
}
