@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:wght@400;600;700&family=Source+Serif+4:opsz,wght@8..60,400;600;700&display=swap');

:root {
    --color-primary: #0A1F6C;
    --color-action: #C62828;
    --color-focus: #F39811;
    --color-bg: #FFFFFF;
    --color-bg-alt: #F8F9FF;
    --color-text: #0d1c2f;
    --color-text-inverse: #FFFFFF;
}

body {
    font-family: 'Atkinson Hyperlegible Next', sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    font-size: 1rem;
    transition: filter 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Source Serif 4', serif;
    color: var(--color-primary);
    line-height: 1.2;
}

a, button, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
}

main a {
    text-decoration: underline;
    color: var(--color-primary);
    font-weight: 600;
}

/* Strict Accessibility (WCAG 2.1 AA) */
*:focus-visible {
    outline: 4px solid var(--color-focus) !important;
    outline-offset: 2px !important;
}

body.monochrome-mode::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    backdrop-filter: grayscale(100%);
    -webkit-backdrop-filter: grayscale(100%);
    pointer-events: none;
    z-index: 99999;
}

body.monochrome-mode .btn-action,
body.monochrome-mode .voice-hub-fab {
    border: 2px solid #FFFFFF;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-focus);
    color: #000;
    padding: 8px;
    z-index: 100;
    transition: top 0.2s ease;
}

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

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    font-weight: 700;
    border-radius: 4px;
    padding: 12px 24px;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.btn-action {
    background-color: var(--color-action);
    color: var(--color-text-inverse);
    font-weight: 700;
    border-radius: 4px;
    padding: 12px 24px;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

/* Assistive Voice Hub Styles */
.voice-hub-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    background-color: var(--color-action);
    color: var(--color-text-inverse);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.voice-hub-fab:hover {
    transform: scale(1.05);
    background-color: #b71c1c;
}

.voice-hub-modal {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 380px;
    max-width: calc(100vw - 4rem);
    background-color: var(--color-bg);
    color: var(--color-text);
    border: 2px solid var(--color-primary);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.voice-hub-modal[hidden] {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.voice-hub-header {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voice-hub-header h2 {
    color: var(--color-text-inverse);
    margin: 0;
    font-size: 1.25rem;
}

.voice-hub-header button {
    background: transparent;
    border: none;
    color: var(--color-text-inverse);
    cursor: pointer;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-hub-log {
    padding: 1.5rem;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: var(--color-bg-alt);
    font-size: 1.125rem;
}

.voice-hub-log p {
    margin: 0;
    padding: 1rem;
    border-radius: 8px;
    line-height: 1.5;
}

.bot-msg {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    align-self: flex-start;
    max-width: 85%;
}

.user-msg {
    background-color: var(--color-action);
    color: var(--color-text-inverse);
    align-self: flex-end;
    max-width: 85%;
}

.voice-hub-controls {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--color-bg);
    border-top: 1px solid #ccc;
}

.voice-hub-controls button {
    background-color: var(--color-focus);
    color: #000;
    border: none;
    border-radius: 50%;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.voice-hub-controls button:hover {
    transform: scale(1.1);
}

.voice-hub-controls button.recording {
    background-color: #d32f2f;
    color: #fff;
    animation: pulse 1.5s infinite;
}

#voice-hub-status {
    margin-top: 1rem;
    font-weight: 600;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(211, 47, 47, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
}

html.dark .voice-hub-modal {
    border-color: #1e293b;
}
html.dark .voice-hub-header {
    background-color: #0f172a;
}
html.dark .voice-hub-log {
    background-color: #1e293b;
    color: #f1f5f9;
}
html.dark .voice-hub-controls {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}
html.dark .bot-msg {
    background-color: #334155;
    color: #f1f5f9;
}

