/* === AVH Assist — Styles accessibles === */

/* Reset et base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --avh-blue: #003366;
    --avh-blue-light: #0055a5;
    --avh-yellow: #ffd700;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --border-color: #cccccc;
    --focus-color: #0055a5;
    --assistant-bg: #e8f0fe;
    --user-bg: #003366;
    --user-text: #ffffff;
    --font-size-base: 1.125rem; /* 18px — lisibilité DV */
    --line-height: 1.6;
    --spacing: 1rem;
    --shadow-light: rgba(0,0,0,0.06);
    --shadow-medium: rgba(0,0,0,0.12);
}

/* Mode sombre automatique */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a2e;
        --bg-secondary: #16213e;
        --text-primary: #e0e0e0;
        --text-secondary: #b0b0b0;
        --border-color: #444444;
        --assistant-bg: #1e3a5f;
        --user-bg: #0055a5;
        --shadow-light: rgba(255,255,255,0.04);
        --shadow-medium: rgba(255,255,255,0.08);
    }
}

/* Contraste élevé */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --bg-primary: #ffffff;
        --border-color: #000000;
        --focus-color: #000000;
    }
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

/* 1. Body et fond */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-primary);
    background: linear-gradient(180deg, #f8f9fa 0%, #eef1f5 100%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%);
        background-attachment: fixed;
    }
}

/* Skip link — navigation clavier */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--avh-blue);
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    z-index: 1000;
    font-size: 1rem;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible — essentiel pour navigation clavier */
*:focus-visible {
    outline: 3px solid var(--avh-yellow);
    outline-offset: 2px;
}

/* 2. Header */
header {
    background: linear-gradient(135deg, #003366 0%, #004488 100%);
    color: #ffffff;
    padding: 0.85rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.header-content {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.header-left,
.header-right {
    position: static;
}

.new-chat-btn {
    font-size: 1.4rem;
}

.icon-btn {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.5);
    color: #ffffff;
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    border-color: #ffffff;
    background: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.icon-btn[aria-pressed="false"] {
    opacity: 0.5;
}

.stop-btn-header {
    background: #cc0000;
    border-color: #cc0000;
    font-size: 1.2rem;
}

.stop-btn-header:hover {
    background: #ff0000;
    border-color: #ff0000;
}

/* Banniere installation iOS */
.ios-install-banner {
    background: var(--avh-yellow);
    color: #000;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-align: center;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    position: relative;
}

.ios-install-banner button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    padding: 0.25rem;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* Chat container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: var(--spacing);
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing) 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
}

/* 9. Animations — slide-in pour les messages */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    max-width: 85%;
    word-wrap: break-word;
    animation: slideIn 0.3s ease;
}

.message p {
    margin-bottom: 0.5rem;
}

.message p:last-child {
    margin-bottom: 0;
}

.message ul, .message ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
}

.message li {
    margin-bottom: 0.25rem;
}

.message a {
    color: var(--avh-blue-light);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* 3. Messages chat — Assistant */
.assistant-message {
    background: linear-gradient(135deg, #e8f4fd 0%, #dbeafe 100%);
    align-self: flex-start;
    border-left: 4px solid var(--avh-blue-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-radius: 1rem 1rem 1rem 0.25rem;
    max-width: 88%;
    position: relative;
    padding-left: 2.5rem;
}

.assistant-message::before {
    content: "\1F916";
    position: absolute;
    left: 0.65rem;
    top: 0.85rem;
    font-size: 1rem;
    opacity: 0.35;
    line-height: 1;
}

@media (prefers-color-scheme: dark) {
    .assistant-message {
        background: linear-gradient(135deg, #1e3a5f 0%, #1a2d4a 100%);
        border-left-color: #3b82f6;
        box-shadow: 0 2px 8px rgba(255,255,255,0.04);
    }
}

/* 3. Messages chat — User */
.user-message {
    background: linear-gradient(135deg, #003366 0%, #004488 100%);
    color: var(--user-text);
    align-self: flex-end;
    box-shadow: 0 2px 8px rgba(0,51,102,0.2);
    border-radius: 1rem 1rem 0.25rem 1rem;
    max-width: 80%;
}

@media (prefers-color-scheme: dark) {
    .user-message {
        background: linear-gradient(135deg, #0055a5 0%, #003d7a 100%);
        box-shadow: 0 2px 8px rgba(255,255,255,0.06);
    }
}

.user-message a {
    color: var(--avh-yellow);
}

/* 3. Messages chat — Loading */
@keyframes loadingPulse {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes ellipsis {
    0% { content: ""; }
    25% { content: "."; }
    50% { content: ".."; }
    75% { content: "..."; }
}

.loading-message {
    background: linear-gradient(135deg, #e8f4fd, #dbeafe, #e8f4fd);
    background-size: 200% 200%;
    animation: loadingPulse 2s ease infinite;
    align-self: flex-start;
    font-style: italic;
    border-left: 4px solid var(--avh-blue-light);
    border-radius: 1rem 1rem 1rem 0.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    max-width: 88%;
    position: relative;
    padding-left: 2.5rem;
}

.loading-message::before {
    content: "\1F916";
    position: absolute;
    left: 0.65rem;
    top: 0.85rem;
    font-size: 1rem;
    opacity: 0.35;
    line-height: 1;
}

.loading-message::after {
    content: "...";
    animation: ellipsis 1.5s steps(4, end) infinite;
}

@media (prefers-color-scheme: dark) {
    .loading-message {
        background: linear-gradient(135deg, #1e3a5f, #1a2d4a, #1e3a5f);
        background-size: 200% 200%;
        border-left-color: #3b82f6;
        box-shadow: 0 2px 8px rgba(255,255,255,0.04);
    }
}

/* Bouton micro */
.mic-btn {
    background-color: #cc0000;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.mic-btn:hover {
    transform: scale(1.1);
}

.mic-btn.listening {
    background-color: #ff0000;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(255, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

/* 4. Formulaire de chat */
/* Bandeau "Passer en mode guide" au-dessus du formulaire */
.switch-mode-bar {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

.switch-mode-btn {
    background: transparent;
    border: 2px solid var(--avh-blue-light);
    color: var(--avh-blue-light);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 40px;
}

.switch-mode-btn:hover,
.switch-mode-btn:focus {
    background: var(--avh-blue);
    color: #ffffff;
    border-color: var(--avh-blue);
}

.switch-mode-btn:focus-visible {
    outline: 3px solid var(--avh-yellow);
    outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
    .switch-mode-btn {
        border-color: var(--avh-yellow);
        color: var(--avh-yellow);
    }
    .switch-mode-btn:hover,
    .switch-mode-btn:focus {
        background: var(--avh-yellow);
        color: #000;
    }
}

.chat-form {
    display: flex;
    gap: 0.75rem;
    padding-top: var(--spacing);
    border-top: 2px solid var(--border-color);
    align-items: flex-end;
}

.chat-form textarea {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: var(--font-size-base);
    font-family: inherit;
    line-height: var(--line-height);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    resize: vertical;
    min-height: 3rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-form textarea:focus {
    border-color: var(--avh-blue-light);
    box-shadow: 0 0 0 3px rgba(0,85,165,0.2);
    outline: none;
}

.chat-form button {
    padding: 0.875rem 1.5rem;
    font-size: var(--font-size-base);
    font-weight: 600;
    background-color: var(--avh-blue);
    color: #ffffff;
    border: 2px solid var(--avh-blue);
    border-radius: 1rem;
    cursor: pointer;
    white-space: nowrap;
    min-height: 48px;
    transition: all 0.2s ease;
}

.chat-form button:hover {
    background-color: var(--avh-blue-light);
    border-color: var(--avh-blue-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,51,102,0.25);
}

.chat-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Texte visuellement caché mais accessible aux lecteurs d'écran */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Footer */
footer {
    background-color: var(--bg-secondary);
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--avh-blue-light);
}

/* === Modals === */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
}

.modal h2 {
    margin-bottom: 1.5rem;
    color: var(--avh-blue);
}

/* Auth form */
.modal form > div {
    margin-bottom: 1rem;
}

.modal label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.modal input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal input:focus {
    border-color: var(--focus-color);
    outline: none;
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--avh-blue);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: var(--avh-blue-light);
}

.btn-secondary {
    padding: 0.625rem 1rem;
    font-size: 0.95rem;
    background: var(--avh-blue);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}

.btn-danger {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    background: #cc0000;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
}

.auth-error {
    background: #ffe0e0;
    color: #cc0000;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.auth-switch a {
    color: var(--avh-blue-light);
    font-weight: 600;
}

/* OAuth (Google, Apple) */
.oauth-separator {
    text-align: center;
    margin: 1.25rem 0;
    position: relative;
}

.oauth-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.oauth-separator span {
    background: var(--bg-primary);
    padding: 0 1rem;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: stretch;
}

.oauth-btn-container {
    display: flex;
    justify-content: center;
    min-height: 40px;
}

.apple-btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.apple-btn:hover {
    background: #333;
}

.apple-btn:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
}

/* Settings */
.settings-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-section h3 {
    margin-bottom: 0.5rem;
    color: var(--avh-blue);
}

.link-account-card {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.link-account-card h4 {
    margin-bottom: 0.25rem;
}

.link-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.link-status.linked {
    color: #006600;
    font-weight: 600;
}

.link-status.error {
    color: #cc0000;
}

.btn-unlink {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: #fff;
    color: #cc0000;
    border: 2px solid #cc0000;
    border-radius: 0.5rem;
    cursor: pointer;
    margin-top: 0.25rem;
}

.btn-unlink:hover {
    background: #cc0000;
    color: #fff;
}

.settings-logout {
    border-bottom: none;
}

.settings-logout p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.link-form input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-size: 0.95rem;
}

.conv-item {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

/* Statut vocal */
.voice-status {
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    min-height: 1.5rem;
    padding: 0.25rem;
}

/* 8. Responsive mobile */
@media (max-width: 600px) {
    header {
        padding: 0.5rem;
    }

    header h1 {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .chat-container {
        padding: 0.5rem;
    }

    .message {
        max-width: 95%;
        padding: 0.75rem;
        font-size: 1rem;
    }

    .assistant-message,
    .loading-message {
        max-width: 95%;
        padding-left: 2rem;
    }

    .assistant-message::before,
    .loading-message::before {
        left: 0.45rem;
        font-size: 0.85rem;
    }

    .user-message {
        max-width: 90%;
    }

    /* Cacher le micro sur mobile — le clavier natif a deja un micro */
    .mic-btn {
        display: none !important;
    }

    .chat-form {
        flex-direction: row;
        gap: 0.5rem;
    }

    .chat-form textarea {
        font-size: 1rem;
        min-height: 2.5rem;
        padding: 0.5rem 0.75rem;
        border-radius: 1rem;
    }

    .chat-form .send-btn {
        width: 48px;
        height: 48px;
        min-height: 48px;
        padding: 0;
        font-size: 0;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--avh-blue);
        border-color: var(--avh-blue);
        flex-shrink: 0;
    }

    .chat-form .send-btn::after {
        content: "\2192";
        font-size: 1.4rem;
        color: #fff;
    }

    .chat-form .send-btn:hover {
        background-color: var(--avh-blue-light);
        border-color: var(--avh-blue-light);
    }

    .stop-btn-header {
        width: 3.5rem;
        height: 3.5rem;
        font-size: 1.5rem;
    }

    footer {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

/* Très petit écran (iPhone SE, etc.) */
@media (max-width: 380px) {
    .mic-btn {
        width: 4.5rem;
        height: 4.5rem;
        font-size: 2rem;
    }

    .message {
        font-size: 0.95rem;
    }
}

/* Mode paysage mobile */
@media (max-height: 500px) {
    header {
        padding: 0.25rem;
    }

    .subtitle {
        display: none;
    }

    .chat-messages {
        max-height: 50vh;
    }
}

/* Réduction des animations pour utilisateurs sensibles */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* PWA standalone : masquer le footer pour gagner de l'espace */
@media (display-mode: standalone) {
    footer {
        display: none;
    }

    .chat-container {
        padding-bottom: env(safe-area-inset-bottom, 0.5rem);
    }
}

/* Safe area iOS (encoche) */
@supports (padding-top: env(safe-area-inset-top)) {
    header {
        padding-top: calc(0.5rem + env(safe-area-inset-top));
    }

    .chat-form {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* === Lecteur Eole inline === */
.eole-player {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: #f0f4f8;
    border: 2px solid #003366;
    border-radius: 8px;
}

.eole-player p {
    margin: 0 0 0.5rem 0;
}

.eole-player .load-eole-btn {
    background: #003366;
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    min-height: 44px;
    width: 100%;
}

.eole-player .load-eole-btn:hover,
.eole-player .load-eole-btn:focus {
    background: #00509e;
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

.eole-player .load-eole-btn:disabled {
    background: #888;
    cursor: wait;
}

.eole-audio-container {
    margin-top: 0.5rem;
}

.eole-audio-container audio {
    width: 100%;
    margin-top: 0.5rem;
}

.eole-audio-container .error {
    color: #c00;
    font-weight: bold;
}

/* === Barre de progression telechargement === */
.eole-progress {
    position: relative;
    height: 2.2rem;
    background: #e0e6ed;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #003366;
}

.eole-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #003366, #00509e);
    transition: width 0.2s ease;
}

.eole-progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
    font-size: 0.95rem;
}

/* === Lecteur audio Eole — controles accessibles === */
.eole-audio-container audio {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
}

.eole-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.6rem 0 0.4rem 0;
}

.eole-ctrl {
    flex: 1 1 auto;
    min-height: 48px;
    min-width: 80px;
    padding: 0.5rem 0.8rem;
    background: #fff;
    color: #003366;
    border: 2px solid #003366;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.eole-ctrl:hover,
.eole-ctrl:focus {
    background: #003366;
    color: #fff;
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

.eole-ctrl-main {
    flex: 2 1 auto;
    background: #003366;
    color: #fff;
}

.eole-ctrl-main:hover,
.eole-ctrl-main:focus {
    background: #00509e;
}

.eole-ctrl-stop {
    background: #fff;
    color: #c00;
    border-color: #c00;
}

.eole-ctrl-stop:hover,
.eole-ctrl-stop:focus {
    background: #c00;
    color: #fff;
    outline-color: #ffcc00;
}

.eole-time {
    text-align: center;
    font-family: monospace;
    font-size: 1.1rem;
    color: #003366;
    margin: 0.3rem 0;
}

.eole-seek {
    display: block;
    width: 100%;
    height: 1.5rem;
    margin: 0.3rem 0;
    cursor: pointer;
}

.eole-hint {
    margin: 0.4rem 0 0 0;
    font-size: 0.85rem;
    color: #555;
    font-style: italic;
}

/* === Lecteur multi-pistes === */
.eole-loading {
    text-align: center;
    padding: 1rem;
    color: #003366;
    font-style: italic;
}

.eole-player-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.05rem;
}

.eole-track-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.eole-track-info label {
    font-weight: bold;
    color: #003366;
}

.eole-track-select {
    flex: 1 1 auto;
    min-height: 44px;
    padding: 0.4rem 0.6rem;
    border: 2px solid #003366;
    border-radius: 4px;
    background: #fff;
    color: #003366;
    font-size: 1rem;
    cursor: pointer;
}

.eole-track-select:focus {
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

.eole-track-count {
    color: #555;
    font-size: 0.9rem;
}

.eole-controls-secondary {
    margin-top: 0.4rem;
    align-items: center;
}

.eole-speed-label {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #003366;
    font-weight: bold;
    font-size: 0.95rem;
}

.eole-speed {
    min-height: 44px;
    padding: 0.3rem 0.5rem;
    border: 2px solid #003366;
    border-radius: 4px;
    background: #fff;
    color: #003366;
    font-size: 1rem;
    cursor: pointer;
}

.eole-speed:focus {
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

.eole-audio {
    /* On garde l'audio en DOM mais cache, on utilise nos contrôles */
    width: 100%;
    display: none;
}

.eole-error-msg {
    margin-top: 0.5rem;
}

.eole-track-search-wrap {
    margin: 0.4rem 0;
}

.eole-track-search {
    width: 100%;
    min-height: 44px;
    padding: 0.5rem 0.8rem;
    border: 2px solid #003366;
    border-radius: 5px;
    background: #fff;
    color: #003366;
    font-size: 1rem;
}

.eole-track-search:focus {
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

/* === Modale Ma bibliothèque === */
#library-modal .modal-content {
    max-width: 720px;
}

.library-intro {
    margin: 0 0 1rem 0;
    color: #555;
    font-style: italic;
}

.library-loading,
.library-empty {
    text-align: center;
    padding: 1.5rem;
    color: #555;
}

.library-book {
    margin: 0.8rem 0;
    padding: 0.9rem 1rem;
    background: #fafafa;
    border-left: 5px solid #003366;
    border-radius: 6px;
}

.library-book h3 {
    margin: 0 0 0.3rem 0;
    color: #003366;
    font-size: 1.05rem;
}

.library-position {
    margin: 0.2rem 0;
    font-weight: 600;
    color: #003366;
}

.library-meta {
    margin: 0.2rem 0 0.6rem 0;
    font-size: 0.85rem;
    color: #666;
}

.library-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 0.4rem;
}

.library-badge.cached {
    background: #2e7d32;
    color: #fff;
}

.library-badge.not-cached {
    background: #757575;
    color: #fff;
}

.library-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.library-actions button {
    flex: 1 1 auto;
    min-height: 44px;
    min-width: 110px;
    padding: 0.5rem 0.8rem;
    border-radius: 5px;
    border: 2px solid;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

.library-actions .btn-primary {
    background: #003366;
    color: #fff;
    border-color: #003366;
}

.library-actions .btn-primary:hover,
.library-actions .btn-primary:focus {
    background: #00509e;
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

.library-actions .btn-secondary {
    background: #fff;
    color: #003366;
    border-color: #003366;
}

.library-actions .btn-secondary:hover,
.library-actions .btn-secondary:focus {
    background: #e8f5e9;
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

.library-actions .btn-danger {
    background: #fff;
    color: #c00;
    border-color: #c00;
}

.library-actions .btn-danger:hover,
.library-actions .btn-danger:focus {
    background: #c00;
    color: #fff;
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

/* === Modale Mon panier === */
#cart-modal .modal-content {
    max-width: 720px;
}

.cart-summary {
    margin-top: 1.2rem;
    padding: 1rem;
    background: #f0f4f8;
    border: 2px solid #003366;
    border-radius: 8px;
}

.cart-total {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #003366;
}

.cart-total strong {
    font-size: 1.4rem;
}

.cart-hint {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin: 0 0 0.8rem 0;
}

.cart-summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cart-summary-actions button {
    flex: 1 1 auto;
    min-height: 50px;
    min-width: 140px;
    padding: 0.7rem 1rem;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid;
}

.cart-summary-actions .btn-secondary {
    background: #fff;
    color: #003366;
    border-color: #003366;
}

.cart-summary-actions .btn-secondary:hover,
.cart-summary-actions .btn-secondary:focus {
    background: #e8f0fe;
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

.cart-summary-actions .btn-primary {
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
    flex: 2 1 auto;
}

.cart-summary-actions .btn-primary:hover,
.cart-summary-actions .btn-primary:focus {
    background: #1b5e20;
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

/* 6. Bouton de paiement PayPlug dans le chat */
.payment-link-card {
    margin: 0.8rem 0;
    padding: 1.2rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: none;
    border-left: 4px solid #10b981;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

@media (prefers-color-scheme: dark) {
    .payment-link-card {
        background: linear-gradient(135deg, rgba(16,185,129,0.1) 0%, rgba(16,185,129,0.05) 100%);
        border-left-color: #34d399;
        box-shadow: 0 4px 12px rgba(255,255,255,0.05);
    }
}

.payment-info {
    margin-bottom: 1rem;
}

.payment-amount {
    font-size: 1.15rem;
    margin: 0.2rem 0;
    color: #1b5e20;
}

.payment-amount strong {
    font-size: 1.5rem;
}

.payment-ref {
    margin: 0.2rem 0;
    color: #003366;
    font-size: 0.95rem;
}

.payment-btn {
    display: block;
    width: 100%;
    padding: 1rem 1.2rem;
    background: #2e7d32;
    color: #fff !important;
    text-align: center;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    margin: 0.5rem 0;
    min-height: 56px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.payment-btn:hover,
.payment-btn:focus {
    background: #1b5e20;
    outline: 4px solid #ffcc00;
    outline-offset: 2px;
}

.payment-secure {
    margin: 0.6rem 0 0 0;
    font-size: 0.85rem;
    color: #555;
    font-style: italic;
    text-align: center;
}

/* 5. Carte de confirmation d'action engageante */
.confirm-action-card {
    margin: 0.8rem 0;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: none;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.12);
}

@media (prefers-color-scheme: dark) {
    .confirm-action-card {
        background: linear-gradient(135deg, rgba(245,158,11,0.1) 0%, rgba(245,158,11,0.05) 100%);
        border-left-color: #fbbf24;
        box-shadow: 0 3px 10px rgba(255,255,255,0.05);
    }
}

.confirm-label {
    margin: 0 0 0.8rem 0;
    font-size: 1.05rem;
    color: #5d4037;
}

.confirm-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.confirm-btn {
    flex: 1 1 auto;
    min-height: 48px;
    min-width: 140px;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid;
    transition: all 0.2s ease;
}

.confirm-yes {
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
    flex: 2 1 auto;
}

.confirm-yes:hover,
.confirm-yes:focus {
    background: #1b5e20;
    outline: 4px solid #ffcc00;
    outline-offset: 2px;
    transform: translateY(-1px);
}

.confirm-yes:disabled {
    background: #888;
    border-color: #888;
    cursor: wait;
    transform: none;
}

.confirm-no {
    background: #fff;
    color: #c62828;
    border-color: #c62828;
}

.confirm-no:hover,
.confirm-no:focus {
    background: #c62828;
    color: #fff;
    outline: 4px solid #ffcc00;
    outline-offset: 2px;
    transform: translateY(-1px);
}

.confirm-no:disabled {
    opacity: 0.5;
    cursor: wait;
    transform: none;
}

.confirm-hint {
    margin: 0.6rem 0 0 0;
    font-size: 0.9rem;
    color: #6d4c41;
    font-style: italic;
}

.confirm-success {
    margin: 0;
    padding: 0.8rem;
    background: #e8f5e9;
    color: #1b5e20;
    border-radius: 6px;
    font-weight: 700;
    text-align: center;
}

.confirm-cancelled {
    margin: 0;
    padding: 0.8rem;
    background: #f5f5f5;
    color: #666;
    border-radius: 6px;
    text-align: center;
}

.confirm-error {
    margin: 0;
    padding: 0.8rem;
    background: #ffebee;
    color: #c62828;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
}

/* 7. Carte de suivi de commande */
.order-tracking-card {
    margin: 0.8rem 0;
    padding: 0;
    background: #fff;
    border: 2px solid #003366;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 51, 102, 0.1);
}

@media (prefers-color-scheme: dark) {
    .order-tracking-card {
        background: var(--bg-secondary);
        box-shadow: 0 3px 10px rgba(255,255,255,0.05);
    }
}

.ot-loading {
    margin: 0;
    padding: 1rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

.ot-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
    color: #fff;
    border-radius: 10px 10px 0 0;
}

.ot-header.ot-green   { background: linear-gradient(135deg, #2e7d32, #66bb6a); }
.ot-header.ot-blue    { background: linear-gradient(135deg, #003366, #0055a5); }
.ot-header.ot-orange  { background: linear-gradient(135deg, #ef6c00, #ff9800); }
.ot-header.ot-red     { background: linear-gradient(135deg, #c62828, #ef5350); }
.ot-header.ot-gray    { background: linear-gradient(135deg, #616161, #9e9e9e); }

.ot-emoji {
    font-size: 2rem;
    flex: 0 0 auto;
}

.ot-header p {
    margin: 0.1rem 0;
}

.ot-ref {
    font-size: 0.95rem;
    opacity: 0.95;
}

.ot-state {
    font-size: 1.15rem;
    font-weight: 700;
}

.ot-date {
    font-size: 0.85rem;
    opacity: 0.85;
}

.ot-section {
    padding: 0.8rem 1.2rem;
    border-top: 1px solid #e0e0e0;
}

.ot-section h4 {
    margin: 0 0 0.5rem 0;
    color: #003366;
    font-size: 1rem;
}

.ot-items ul {
    margin: 0;
    padding-left: 1.2rem;
}

.ot-items li {
    margin: 0.2rem 0;
}

.ot-total p {
    margin: 0.2rem 0;
    font-size: 1.05rem;
}

.ot-total .ot-meta {
    font-size: 0.85rem;
    color: #666;
}

.ot-tn code {
    background: #f0f4f8;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.95rem;
    color: #003366;
}

.ot-track-btn {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.7rem 1.2rem;
    background: #003366;
    color: #fff !important;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    min-height: 48px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.ot-track-btn:hover,
.ot-track-btn:focus {
    background: #0055a5;
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

.ot-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ot-timeline li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px dotted #e0e0e0;
}

.ot-timeline li:last-child {
    border-bottom: none;
}

.ot-h-emoji {
    font-size: 1.1rem;
    flex: 0 0 1.4rem;
}

.ot-h-date {
    font-family: monospace;
    font-size: 0.85rem;
    color: #666;
    flex: 0 0 auto;
}

.ot-h-label {
    flex: 1 1 auto;
    color: #003366;
}

/* === Menu deroulant principal accessible === */
.menu-btn {
    position: relative;
    font-size: 1.6rem;
    line-height: 1;
}

.main-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    list-style: none;
    margin: 0;
    padding: 0.4rem;
    background: #fff;
    border: 2px solid #003366;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    min-width: 280px;
}

.main-menu[hidden] {
    display: none;
}

.main-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-separator {
    height: 1px;
    background: #ddd;
    margin: 0.3rem 0.4rem;
}

.main-menu [role="menuitem"] {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 5px;
    color: #003366;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    min-height: 44px;
    transition: all 0.2s ease;
}

.main-menu [role="menuitem"]:hover,
.main-menu [role="menuitem"]:focus {
    background: #e8f0fe;
    border-color: #003366;
    outline: none;
}

.main-menu .menu-icon {
    font-size: 1.25rem;
    width: 1.6rem;
    flex: 0 0 auto;
    text-align: center;
}

.main-menu .menu-label {
    flex: 1 1 auto;
}

.main-menu .menu-shortcut {
    flex: 0 0 auto;
    font-family: monospace;
    background: #003366;
    color: #fff;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: bold;
}

/* === Modale Raccourcis clavier === */
#shortcuts-modal .modal-content {
    max-width: 640px;
}

.shortcuts-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0 1rem 0;
}

.shortcuts-table th,
.shortcuts-table td {
    text-align: left;
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid #e0e0e0;
}

.shortcuts-table th {
    background: #f0f4f8;
    color: #003366;
    font-weight: bold;
}

.shortcuts-table td:first-child {
    width: 35%;
}

.shortcuts-table kbd {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    background: #fff;
    border: 1.5px solid #003366;
    border-bottom-width: 3px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    color: #003366;
    font-weight: bold;
}

#shortcuts-modal h3 {
    margin-top: 1.2rem;
    color: #003366;
    font-size: 1.1rem;
}

#shortcuts-modal h3:first-of-type {
    margin-top: 0.5rem;
}

.shortcut-tip {
    margin: 0.6rem 0 1rem 0;
    padding: 0.7rem 0.9rem;
    background: #fff8e1;
    border-left: 4px solid #f57f17;
    border-radius: 0 4px 4px 0;
    font-size: 0.95rem;
}

.shortcut-tip kbd {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    background: #fff;
    border: 1.5px solid #003366;
    border-bottom-width: 2px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #003366;
    font-weight: bold;
}

/* === Champ de recherche library === */
.library-search-wrap {
    margin: 0.5rem 0 0.8rem 0;
}

.library-search {
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.9rem;
    border: 2px solid #003366;
    border-radius: 6px;
    font-size: 1rem;
    color: #003366;
    background: #fff;
}

.library-search:focus {
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
}

/* === Mobile : compactage du header === */
@media (max-width: 600px) {
    header {
        padding: 0.7rem 0.6rem;
        gap: 0.4rem;
    }
    header h1 {
        font-size: 1.3rem;
    }
    .icon-btn {
        width: 2.6rem;
        height: 2.6rem;
        font-size: 1.3rem;
    }
    .main-menu {
        min-width: 260px;
        max-width: calc(100vw - 1.5rem);
    }
}

/* === Modale Feuille de route === */
#roadmap-modal .modal-content {
    max-width: 720px;
}

.roadmap-intro {
    margin: 0 0 1rem 0;
    color: #555;
    font-style: italic;
}

.roadmap-section {
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border-left: 5px solid #ccc;
    background: #fafafa;
}

.roadmap-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.roadmap-section ul {
    margin: 0.25rem 0 0 1.2rem;
    padding: 0;
}

.roadmap-section li {
    margin: 0.25rem 0;
    line-height: 1.4;
}

.roadmap-done {
    background: #e8f5e9;
    border-left-color: #2e7d32;
}

.roadmap-progress {
    background: #fff8e1;
    border-left-color: #f57f17;
}

.roadmap-todo {
    background: #f5f5f5;
    border-left-color: #757575;
}

.roadmap-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.roadmap-badge.done {
    background: #2e7d32;
}

.roadmap-badge.progress {
    background: #f57f17;
}

.roadmap-badge.todo {
    background: #616161;
}

.roadmap-tip {
    margin: 0.6rem 0 0 0;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 51, 102, 0.08);
    border-radius: 4px;
    font-size: 0.95rem;
}

.roadmap-tip em {
    color: #003366;
    font-weight: 600;
    font-style: normal;
}

.roadmap-footer {
    margin-top: 1.2rem;
    padding-top: 0.8rem;
    border-top: 1px solid #e0e0e0;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

.roadmap-footer code {
    background: #eee;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}


/* =====================================================================
   Mode Guide — Toggle + Container + Boutons accessibles
   ===================================================================== */

/* Toggle IA / Guide dans le header — style pill */
.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: 0.35rem;
}

.mode-toggle-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 0.35rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    min-height: 36px;
    min-width: 54px;
}

.mode-toggle-btn:first-child {
    border-radius: 20px 0 0 20px;
}

.mode-toggle-btn:last-child {
    border-radius: 0 20px 20px 0;
    border-left: none;
}

.mode-toggle-btn.active,
.mode-toggle-btn[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.9);
}

.mode-toggle-btn:focus-visible {
    outline: 3px solid var(--avh-yellow);
    outline-offset: 2px;
    z-index: 1;
}

.mode-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* ===================================================================
   Mode Guide — Layout & Container
   =================================================================== */

.guided-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: var(--spacing);
    overflow-y: auto;
}

.guided-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 1rem;
}

/* ===================================================================
   Breadcrumb
   =================================================================== */

.guided-breadcrumb {
    margin-bottom: 0.5rem;
}

.guided-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.guided-breadcrumb li:not(:last-child)::after {
    content: ">";
    margin-left: 0.35rem;
    color: var(--text-secondary);
}

.guided-breadcrumb li[aria-current="page"] {
    font-weight: 600;
    color: var(--text-primary);
}

.guided-breadcrumb-link {
    background: none;
    border: none;
    color: var(--avh-blue-light);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0.15rem 0.25rem;
    border-radius: 3px;
}

.guided-breadcrumb-link:hover,
.guided-breadcrumb-link:focus {
    color: var(--avh-blue);
}

.guided-breadcrumb-link:focus-visible {
    outline: 3px solid var(--avh-yellow);
    outline-offset: 2px;
}

/* ===================================================================
   Heading & Text
   =================================================================== */

.guided-heading {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--avh-blue);
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border-color);
}

@media (prefers-color-scheme: dark) {
    .guided-heading {
        color: var(--avh-yellow);
    }
    .guided-breadcrumb-link {
        color: var(--avh-yellow);
    }
}

.guided-text {
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-primary);
    margin: 0.15rem 0;
}

/* ===================================================================
   Success Banner
   =================================================================== */

.guided-success-banner {
    background: #e8f5e9;
    border-left: 5px solid #2e7d32;
    color: #1b5e20;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: var(--line-height);
}

@media (prefers-color-scheme: dark) {
    .guided-success-banner {
        background: rgba(46, 125, 50, 0.15);
        color: #81c784;
        border-left-color: #66bb6a;
    }
}

/* ===================================================================
   Menu Grid — Cartes d'action
   =================================================================== */

.guided-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}

.guided-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 120px;
    padding: 1.25rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
    text-decoration: none;
    gap: 0.5rem;
}

.guided-card:hover,
.guided-card:focus {
    background: var(--avh-blue);
    color: #ffffff;
    border-color: var(--avh-blue);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.25);
    transform: translateY(-2px);
}

.guided-card:hover .guided-card-title,
.guided-card:focus .guided-card-title,
.guided-card:hover .guided-card-subtitle,
.guided-card:focus .guided-card-subtitle {
    color: #ffffff;
}

.guided-card:focus-visible {
    outline: 3px solid var(--avh-yellow);
    outline-offset: 2px;
}

.guided-card:active {
    transform: scale(0.97);
}

.guided-card-icon {
    font-size: 2rem;
    line-height: 1;
}

.guided-card-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.guided-card-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.guided-card-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

@media (prefers-color-scheme: dark) {
    .guided-card {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
    .guided-card:hover,
    .guided-card:focus {
        background: var(--avh-blue-light);
        border-color: var(--avh-blue-light);
    }
}

/* ===================================================================
   Buttons — Primary, Secondary, Danger
   =================================================================== */

.guided-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    font-size: var(--font-size-base);
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    text-decoration: none;
    line-height: 1.4;
    word-wrap: break-word;
    text-align: center;
}

.guided-btn:focus-visible {
    outline: 3px solid var(--avh-yellow);
    outline-offset: 2px;
}

.guided-btn:active {
    transform: scale(0.98);
}

/* Primary — green, prominent */
.guided-btn-primary {
    min-height: 56px;
    background: #2e7d32;
    color: #ffffff;
    border: 2px solid #2e7d32;
    font-weight: 600;
    width: 100%;
}

.guided-btn-primary:hover,
.guided-btn-primary:focus {
    background: #1b5e20;
    border-color: #1b5e20;
}

/* Secondary — outline */
.guided-btn-secondary {
    background: transparent;
    color: var(--avh-blue);
    border: 2px solid var(--avh-blue);
    width: 100%;
}

.guided-btn-secondary:hover,
.guided-btn-secondary:focus {
    background: var(--avh-blue);
    color: #ffffff;
}

/* Danger — red, for destructive actions */
.guided-btn-danger {
    background: transparent;
    color: #c62828;
    border: 2px solid #c62828;
    font-size: 0.95rem;
    width: 100%;
}

.guided-btn-danger:hover,
.guided-btn-danger:focus {
    background: #c62828;
    color: #ffffff;
    border-color: #c62828;
}

/* Add to cart — blue accent */
.guided-btn-add {
    background: var(--avh-blue);
    color: #ffffff;
    border: 2px solid var(--avh-blue);
    min-height: 48px;
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}

.guided-btn-add:hover,
.guided-btn-add:focus {
    background: var(--avh-blue-light);
    border-color: var(--avh-blue-light);
}

/* Checkout — extra prominent */
.guided-btn-checkout {
    font-size: 1.15rem;
    min-height: 60px;
}

/* Listen link styled as button */
.guided-btn-listen {
    width: auto;
    min-height: 48px;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}

@media (prefers-color-scheme: dark) {
    .guided-btn-secondary {
        color: var(--avh-yellow);
        border-color: var(--avh-yellow);
    }
    .guided-btn-secondary:hover,
    .guided-btn-secondary:focus {
        background: var(--avh-yellow);
        color: #1a1a2e;
    }
    .guided-btn-primary {
        background: #388e3c;
        border-color: #388e3c;
    }
    .guided-btn-primary:hover,
    .guided-btn-primary:focus {
        background: #2e7d32;
        border-color: #2e7d32;
    }
    .guided-btn-danger {
        color: #ef5350;
        border-color: #ef5350;
    }
    .guided-btn-danger:hover,
    .guided-btn-danger:focus {
        background: #ef5350;
        color: #ffffff;
    }
    .guided-btn-add {
        background: var(--avh-blue-light);
        border-color: var(--avh-blue-light);
    }
}

/* Button group */
.guided-btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Raccourcis clavier — affiche discret en bas de chaque ecran */
.guided-kbd-hint {
    font-size: 0.8rem;
    color: var(--text-secondary, #888);
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

/* ===================================================================
   Product Cards — Search Results
   =================================================================== */

.guided-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.guided-product-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--avh-blue);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.guided-product-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.guided-product-manufacturer {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.guided-product-price-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.guided-product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Stock badges */
.guided-stock {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.guided-stock::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.guided-stock-ok {
    background: #e8f5e9;
    color: #2e7d32;
}

.guided-stock-ok::before {
    background: #2e7d32;
}

.guided-stock-low {
    background: #fff3e0;
    color: #e65100;
}

.guided-stock-low::before {
    background: #e65100;
}

.guided-stock-out {
    background: #ffebee;
    color: #c62828;
}

.guided-stock-out::before {
    background: #c62828;
}

.guided-stock-unknown {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.guided-stock-unknown::before {
    background: var(--text-secondary);
}

@media (prefers-color-scheme: dark) {
    .guided-stock-ok {
        background: rgba(46, 125, 50, 0.15);
        color: #81c784;
    }
    .guided-stock-low {
        background: rgba(230, 81, 0, 0.15);
        color: #ffb74d;
    }
    .guided-stock-out {
        background: rgba(198, 40, 40, 0.15);
        color: #ef5350;
    }
}

/* Confirm card */
.guided-confirm-card {
    border-left-color: #2e7d32;
}

.guided-confirm-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

.guided-confirm-details strong {
    color: var(--text-primary);
}

/* ===================================================================
   Cart Cards
   =================================================================== */

.guided-cart-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.guided-cart-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--avh-blue);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.guided-cart-info {
    flex: 1;
    min-width: 0;
}

.guided-cart-name {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    line-height: 1.3;
}

.guided-cart-price {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.guided-cart-remove {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid #c62828;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    color: #c62828;
    transition: background 0.15s, color 0.15s;
}

.guided-cart-remove:hover,
.guided-cart-remove:focus {
    background: #c62828;
    color: #ffffff;
}

.guided-cart-remove:focus-visible {
    outline: 3px solid var(--avh-yellow);
    outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
    .guided-cart-remove {
        border-color: #ef5350;
        color: #ef5350;
    }
    .guided-cart-remove:hover,
    .guided-cart-remove:focus {
        background: #ef5350;
        color: #ffffff;
    }
}

.guided-cart-total {
    font-size: 1.2rem;
    color: var(--text-primary);
    padding: 0.75rem 0;
    border-top: 2px solid var(--border-color);
    margin-top: 0.5rem;
    text-align: right;
}

.guided-cart-total strong {
    font-size: 1.35rem;
}

/* ===================================================================
   Order Cards
   =================================================================== */

.guided-order-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--avh-blue);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.guided-order-ref {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

.guided-order-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.25rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.guided-order-amount {
    font-weight: 600;
    color: var(--text-primary);
}

/* ===================================================================
   Book Cards
   =================================================================== */

.guided-book-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 5px solid #6a1b9a;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.guided-book-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.guided-book-author {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.guided-book-duration {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@media (prefers-color-scheme: dark) {
    .guided-book-card {
        border-left-color: #ce93d8;
    }
}

/* ===================================================================
   Input area du mode guide
   =================================================================== */

.guided-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.guided-input {
    flex: 1;
    min-height: 48px;
    padding: 0.6rem 1rem;
    font-size: var(--font-size-base);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.guided-input:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
    border-color: var(--focus-color);
}

.guided-send-btn {
    min-height: 48px;
    min-width: 60px;
    padding: 0.6rem 1.2rem;
    font-size: var(--font-size-base);
    font-weight: 600;
    background: var(--avh-blue);
    color: #ffffff;
    border: 2px solid var(--avh-blue);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.guided-send-btn:hover,
.guided-send-btn:focus {
    background: var(--avh-blue-light);
    border-color: var(--avh-blue-light);
}

.guided-send-btn:focus-visible {
    outline: 3px solid var(--avh-yellow);
    outline-offset: 2px;
}

/* --- MDPH Wizard --- */

.mdph-progress-wrap {
    margin-bottom: 1.2rem;
}

.mdph-progress-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--avh-blue, #003366);
}

.mdph-progress-bar {
    background: #e0e0e0;
    border-radius: 8px;
    height: 10px;
    overflow: hidden;
}

.mdph-progress-fill {
    background: var(--avh-blue, #003366);
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
}

.mdph-question {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1rem 0 0.8rem;
    line-height: 1.5;
}

.mdph-input {
    width: 100%;
    max-width: 500px;
    padding: 0.9rem 1rem;
    font-size: 1.1rem;
    border: 2px solid #999;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.mdph-input:focus {
    border-color: var(--avh-blue, #003366);
    outline: 3px solid var(--avh-yellow, #FFC107);
    outline-offset: 2px;
}

.mdph-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mdph-radio-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    font-size: 1.1rem;
    border: 2px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    max-width: 500px;
    transition: border-color 0.2s;
}

.mdph-radio-label:hover,
.mdph-radio-label:focus-within {
    border-color: var(--avh-blue, #003366);
    background: #f0f4f8;
}

.mdph-radio {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    accent-color: var(--avh-blue, #003366);
}

.mdph-btn-group {
    display: flex;
    gap: 0.8rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

@media (prefers-color-scheme: dark) {
    .mdph-progress-bar {
        background: #444;
    }
    .mdph-progress-fill {
        background: #6ba3d6;
    }
    .mdph-progress-label {
        color: #a3c4e8;
    }
    .mdph-input {
        background: #1a1a2e;
        color: #eee;
        border-color: #555;
    }
    .mdph-radio-label {
        border-color: #555;
        color: #eee;
    }
    .mdph-radio-label:hover,
    .mdph-radio-label:focus-within {
        border-color: #6ba3d6;
        background: #1a1a2e;
    }
}

/* ===================================================================
   Mobile responsive
   =================================================================== */

@media (max-width: 600px) {
    .guided-grid {
        grid-template-columns: 1fr;
    }

    .guided-card {
        min-height: 80px;
        flex-direction: row;
        text-align: left;
        padding: 1rem;
    }

    .guided-card-icon {
        font-size: 1.6rem;
    }

    .guided-btn {
        width: 100%;
    }

    .guided-btn-add,
    .guided-btn-listen {
        width: 100%;
    }

    .guided-product-card {
        padding: 0.75rem 1rem;
    }
}

/* ===================================================================
   Contraste eleve
   =================================================================== */

@media (prefers-contrast: high) {
    .guided-card {
        border-width: 3px;
        border-color: #000000;
    }
    .guided-card:hover,
    .guided-card:focus {
        background: #000000;
        color: #ffffff;
    }
    .guided-btn {
        border-width: 3px;
    }
    .guided-product-card,
    .guided-cart-card,
    .guided-order-card,
    .guided-book-card {
        border-width: 2px;
        border-left-width: 5px;
        border-color: #000000;
    }
    .mode-toggle-btn {
        border-width: 3px;
    }
}
