/* Fonts are loaded via a <link> in base.html (before this file) rather than an
   @import here, so the browser discovers them without waiting on this stylesheet. */

:root {
    /* Primary Colors */
    --muted-rose: #D05A67;     /* Main brand color. ~3.8:1 on white: accepted contrast exception, see docs/frontend_audit_2026-07-05.md */
    --muted-rose-deep: #A6414D; /* Rose for small text on tint backgrounds: 5.2:1 on --tint-danger */
    --deep-slate-blue: #2A3F5F; /* Support and structure */
    --white: #ffffff;          /* Card and rail surfaces sitting on seasalt */
    --warm-amber: #FDBE3B;     /* Highlighting/attention */
    --deep-teal: #006D77;      /* Active states */
    --reseda-green: #688B58;   /* Completion and success */
    --cinnabar: #E74C3C;       /* Warnings and errors */
    --onyx: #343A40;           /* Text color */
    --seasalt-white: #F8F9FA;  /* Background */
    
    /* Secondary Colors */
    --celadon: #AFE3C0;
    --pistachio: #90C290;

    /* Neutral Greys */
    --grey-lighter: #EEEEEE;  /* Borders, dividers */
    --grey-light: #DDDDDD;    /* Inactive states, backgrounds */
    --grey: #666666;          /* Secondary text, icons */
    --grey-dark: #444444;     /* Emphasis text */

    /* Status Tints (light backgrounds) */
    --tint-info: #E0F2F4;     /* Info/current state */
    --tint-success: #E8F2E4;  /* Success/complete state */
    --tint-warning: #FEF3E0;  /* Warning/pending state */
    --tint-danger: #FDEBE9;   /* Error/danger state */

    /* Typography Scale - Golden Ratio 1:1.618 */
    --font-size-xxxl: 68px;
    --font-size-xxl: 42px;
    --font-size-xl: 26px;
    --font-size-m: 16px;
    --font-size-s: 10px;
    
    /* Spacing (based on golden ratio) */
    --spacing-xs: 6px;
    --spacing-s: 10px;
    --spacing-m: 16px;
    --spacing-l: 26px;
    --spacing-xl: 42px;
    --spacing-xxl: 68px;

    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-pill: 20px;
    --border-radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Base Typography */
body {
    font-family: 'Work Sans', sans-serif;
    font-size: var(--font-size-m);
    line-height: 1.618;
    color: var(--onyx);
    background-color: var(--seasalt-white);
    margin: 0;
    padding: 0;
}

/* Button reset for bare (non-Bulma) buttons. Deliberately excludes
   button.button: that selector outranks Bulma's .button sizing, so keeping it
   here cancels .is-small/.is-large on real <button> elements while inputs and
   selects still honour them, leaving paired controls mismatched. */
button,
input[type="button"],
input[type="submit"] {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Skip link (WCAG 2.4.1): visually hidden until keyboard focus reaches it */
.skip-link {
    position: absolute;
    left: -9999px;
    top: var(--spacing-s);
    z-index: 1000;
    padding: var(--spacing-xs) var(--spacing-m);
    background-color: var(--deep-teal);
    color: var(--white);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
}
.skip-link:focus {
    left: var(--spacing-s);
    text-decoration: none;
    color: var(--white);
}

/* Focus indicators for keyboard navigation (WCAG 2.4.7) */
:focus-visible {
    outline: 2px solid var(--deep-teal);
    outline-offset: 2px;
}
.button:focus-visible {
    outline: 2px solid var(--deep-teal);
    outline-offset: 2px;
    box-shadow: none;
}
input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--deep-teal);
    outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    margin-top: 1.618em;
    margin-bottom: 0.618em;
    line-height: 1.2;
}

/* The first element inside a card/box shouldn't inherit the golden-ratio top
   margin — it pushes the heading away from the card edge. */
.box .content > :first-child,
.box > :first-child {
    margin-top: 0;
}

h1 {
    font-size: var(--font-size-xxl);
    color: var(--muted-rose);
}

h2 {
    font-size: var(--font-size-xl);
    color: var(--muted-rose);
}

h3 {
    font-size: var(--font-size-m);
    font-weight: 600;
    color: var(--muted-rose);
}

/* Status tags (inline) */
.status-tag-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    max-width: 100%;
    line-height: 1.2;
}

.status-tag-inline .icon {
    margin-right: 0;
}

.project-file-actions .button {
    min-width: 96px;
    justify-content: center;
}
.project-file-actions .button.is-small {
    padding: 4px 10px;
    line-height: 1.2;
}

/* Links */
a {
    color: var(--deep-teal);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Bulma Semantic Colour Overrides
   Maps Bulma's is-primary, is-success, etc. to our design system
   ========================================================================== */

/* Primary - Deep Teal (active states, CTAs) */
.button.is-primary {
    background-color: var(--deep-teal);
    border-color: var(--deep-teal);
    color: white;
}
.button.is-primary:hover {
    background-color: #005a63;
    border-color: #005a63;
    color: white;
}
.button.is-primary.is-outlined {
    background-color: transparent;
    border-color: var(--deep-teal);
    color: var(--deep-teal);
}
.button.is-primary.is-outlined:hover {
    background-color: var(--deep-teal);
    color: white;
}
.button.is-primary.is-light {
    background-color: var(--tint-info);
    border-color: var(--tint-info);
    color: var(--deep-teal);
}
.button.is-primary.is-light:hover {
    background-color: #c4e4e7;
    border-color: #c4e4e7;
    color: var(--deep-teal);
}
.button.is-primary[disabled],
.button.is-primary[disabled]:hover {
    background-color: #8fbfc5;
    border-color: #8fbfc5;
    color: white;
    opacity: 1;
    cursor: not-allowed;
}

/* Sentiment Tags */
.tag.sentiment-support {
    background-color: var(--tint-success);
    color: var(--reseda-green);
}
.tag.sentiment-concern {
    background-color: var(--tint-danger);
    color: var(--cinnabar);
}
.tag.sentiment-conditional {
    background-color: var(--tint-warning);
    color: #9a7b1a;
}
.tag.sentiment-mixed {
    background-color: var(--tint-info);
    color: var(--deep-slate-blue);
}

/* Design considerations: quiet advisory surfaces for option quality checks */
.quality-note {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.85rem;
    color: var(--grey);
    margin-top: var(--spacing-xs);
}
.considerations-panel {
    background-color: var(--tint-warning);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-m);
    font-size: 0.95rem;
    color: var(--grey-dark);
}
.considerations-panel .considerations-title {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}
.considerations-panel ul {
    margin: 0 0 var(--spacing-xs) 1.25rem;
    list-style: disc;
}
.considerations-panel li {
    margin-bottom: var(--spacing-xs);
}
.considerations-panel .considerations-kept-group summary {
    cursor: pointer;
}
.considerations-panel .considerations-kept,
.considerations-panel .considerations-hint {
    font-size: 0.85rem;
    color: var(--grey);
    margin-top: var(--spacing-xs);
}

/* Scrollable bordered list container (token-aligned; replaces inline styles) */
.scroll-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--grey-lighter);
    padding: var(--spacing-s);
    border-radius: var(--border-radius-sm);
}
.scroll-block {
    max-height: 400px;
    overflow-y: auto;
}
.input--narrow {
    max-width: 12rem;
}

/* Curation: deliberately stopped work */
.tag.is-stopped {
    background-color: var(--tint-danger);
    color: var(--muted-rose);
}

/* Curation board: generous space between clusters, tight rhythm within */
.curation-cluster {
    margin-bottom: var(--spacing-xl);
}
.curation-cluster-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-s) var(--spacing-m);
    margin-bottom: var(--spacing-s);
}
.curation-cluster-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--spacing-s);
    min-width: 0;
}
.curation-cluster-meta {
    color: var(--grey);
    font-size: 0.875rem;
    white-space: nowrap;
}
.curation-cluster-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}
/* Per-cluster utility form: subordinate, not full-width */
.curation-add-form {
    max-width: 30rem;
    margin-top: var(--spacing-s);
}
.curation-new-cluster {
    max-width: 24rem;
    margin: var(--spacing-l) 0;
}
.curation-footer {
    position: sticky;
    bottom: 0;
    z-index: 20;
    border-top: 1px solid var(--grey-lighter);
    box-shadow: var(--shadow-lg);
}

/* Curation board: quiet rows, secondary actions revealed on hover/focus */
.curation-item {
    border-radius: 6px;
    padding: var(--spacing-xs) var(--spacing-s);
    gap: var(--spacing-s);
    transition: background-color 0.15s ease-out;
}
.curation-item__main {
    display: flex;
    align-items: center;
    gap: var(--spacing-s);
    min-width: 0;
    flex: 1;
}
.curation-item__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.curation-item .curation-item-text {
    word-break: break-word;
}
.curation-item .curation-item-secondary {
    gap: 0.35rem;
}
/* Touch devices get full-size tap targets; pointer density stays for mouse.
   Applies to every small button/delete control, not just curation rows:
   Bulma's is-small is ~30px tall, below the WCAG 2.5.8 minimum. */
@media (pointer: coarse) {
    .button.is-small,
    .delete,
    .curation-item .select.is-small select {
        min-height: 44px;
        min-width: 44px;
    }
}
.curation-item:hover,
.curation-item:focus-within {
    background-color: var(--seasalt-white);
}
.curation-item .curation-item-secondary {
    opacity: 0;
    transition: opacity 0.15s ease-out;
}
.curation-item:hover .curation-item-secondary,
.curation-item:focus-within .curation-item-secondary {
    opacity: 1;
}
@media (hover: none) {
    .curation-item .curation-item-secondary {
        opacity: 1;
    }
}
@media (prefers-reduced-motion: reduce) {
    .curation-item,
    .curation-item .curation-item-secondary,
    .curation-cluster .curation-chevron {
        transition: none;
    }
}
/* Stopped work stays fully readable (AA); the strike and tag carry the state */
.curation-item-stopped {
    text-decoration: line-through;
    text-decoration-color: var(--muted-rose);
}

/* Curation accordion: whole summary row is the toggle, controls live in the body */
.curation-cluster > .curation-cluster-summary {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--spacing-s);
    cursor: pointer;
    list-style: none;
}
.curation-cluster > .curation-cluster-summary::-webkit-details-marker {
    display: none;
}
.curation-cluster > .curation-cluster-summary:focus-visible {
    outline: 2px solid var(--deep-teal);
    outline-offset: 2px;
}
.curation-cluster .curation-chevron {
    align-self: center;
    color: var(--grey);
    transition: transform 0.15s ease-out;
}
.curation-cluster[open] > .curation-cluster-summary .curation-chevron {
    transform: rotate(90deg);
}
.curation-cluster[open] > .curation-cluster-summary {
    margin-bottom: var(--spacing-s);
}

/* Show-more cap: rows past 10 hide until expanded; an active filter bypasses
   the cap. !important because item rows use Bulma's .is-flex helper */
.curation-items.is-capped:not(.is-filtering) > .curation-item:nth-child(n+11) {
    display: none !important;
}

/* Client-side filter (curation-board.js) */
.is-hidden-by-filter {
    display: none !important;
}
.curation-filter-bar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--spacing-s) var(--spacing-m);
    margin-bottom: var(--spacing-l);
}
.curation-filter-bar .field {
    flex: 1 1 18rem;
    max-width: 30rem;
}
.filter-button.is-compact {
    padding: 0.35rem 0.9rem;
    min-width: 0;
    font-size: 0.875rem;
}

/* Pagination - Deep Teal theme */
.pagination-link,
.pagination-previous,
.pagination-next {
    border-color: var(--deep-teal);
    color: var(--deep-teal);
}
.pagination-link:hover,
.pagination-previous:hover,
.pagination-next:hover {
    border-color: var(--deep-teal);
    background-color: var(--tint-info);
}
.pagination-link.is-current {
    background-color: var(--deep-teal);
    border-color: var(--deep-teal);
    color: white;
}

/* Success - Reseda Green (completion) */
.button.is-success {
    background-color: var(--reseda-green);
    border-color: var(--reseda-green);
    color: white;
}
.button.is-success:hover {
    background-color: #5a7a4c;
    border-color: #5a7a4c;
    color: white;
}
.button.is-success.is-light {
    background-color: var(--tint-success);
    border-color: var(--tint-success);
    color: var(--reseda-green);
}
.button.is-success.is-light:hover {
    background-color: #d4ecd8;
    border-color: #d4ecd8;
    color: var(--reseda-green);
}
.tag.is-success {
    background-color: var(--reseda-green);
    color: white;
}
.notification.is-success {
    background-color: var(--tint-success);
    color: var(--onyx);
}

/* Warning - Warm Amber (attention) */
.button.is-warning {
    background-color: var(--warm-amber);
    border-color: var(--warm-amber);
    color: var(--onyx);
}
.button.is-warning:hover {
    background-color: #e5a82e;
    border-color: #e5a82e;
    color: var(--onyx);
}
.button.is-warning.is-light {
    background-color: var(--tint-warning);
    border-color: var(--tint-warning);
    color: #8a6d00;
}
.button.is-warning.is-light:hover {
    background-color: #fce9c4;
    border-color: #fce9c4;
    color: #8a6d00;
}
.tag.is-warning {
    background-color: var(--warm-amber);
    color: var(--onyx);
}
.notification.is-warning {
    background-color: var(--tint-warning);
    color: var(--onyx);
}

/* Danger - Cinnabar (errors) */
.button.is-danger {
    background-color: var(--cinnabar);
    border-color: var(--cinnabar);
    color: white;
}
.button.is-danger:hover {
    background-color: #c0392b;
    border-color: #c0392b;
    color: white;
}
.button.is-danger.is-light {
    background-color: var(--tint-danger);
    border-color: var(--tint-danger);
    color: var(--cinnabar);
}
.button.is-danger.is-light:hover {
    background-color: #fbd5d1;
    border-color: #fbd5d1;
    color: var(--cinnabar);
}
.tag.is-danger {
    background-color: var(--cinnabar);
    color: white;
}
.notification.is-danger {
    background-color: var(--tint-danger);
    color: var(--onyx);
}

/* Info - Deep Teal (same as primary for consistency) */
.button.is-info {
    background-color: var(--deep-teal);
    border-color: var(--deep-teal);
    color: white;
}
.button.is-info:hover {
    background-color: #005a63;
    border-color: #005a63;
    color: white;
}
.button.is-info.is-light {
    background-color: var(--tint-info);
    border-color: var(--tint-info);
    color: var(--deep-teal);
}
.button.is-info.is-light:hover {
    background-color: #c4e4e7;
    border-color: #c4e4e7;
    color: var(--deep-teal);
}
.tag.is-info {
    background-color: var(--deep-teal);
    color: white;
}
.notification.is-info {
    background-color: var(--tint-info);
    color: var(--onyx);
}

/* Link - Deep Teal */
.button.is-link {
    background-color: var(--deep-teal);
    border-color: var(--deep-teal);
    color: white;
}
.button.is-link:hover {
    background-color: #005a63;
    border-color: #005a63;
    color: white;
}
.button.is-link.is-light {
    background-color: var(--tint-info);
    border-color: var(--tint-info);
    color: var(--deep-teal);
}
.button.is-link.is-light:hover {
    background-color: #c4e4e7;
    border-color: #c4e4e7;
    color: var(--deep-teal);
}

/* Tabs - themed to match buttons */
.tabs-scroll {
    overflow-x: auto;
    padding-bottom: 0.25rem;
}
.tabs-scroll ul {
    flex-wrap: nowrap;
    gap: 0.5rem;
}
.tabs a.tab-link {
    border: 1px solid var(--deep-teal);
    border-radius: 8px;
    color: var(--deep-teal);
    background: white;
    padding: 0.5rem 0.9rem;
    font-weight: 600;
    min-height: 2.5rem;
    line-height: 1.2;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.tabs a.tab-link:hover {
    background-color: var(--tint-info);
}
.tabs a.tab-link:focus-visible {
    outline: 3px solid rgba(0, 109, 119, 0.25);
    outline-offset: 2px;
}
.tabs.is-toggle li.is-active a.tab-link {
    background-color: var(--deep-teal);
    border-color: var(--deep-teal);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Tags */
.tag.is-light {
    background-color: var(--tint-info);
    border-color: var(--tint-info);
    color: var(--deep-teal);
}

/* Light tag combos: without these, Bulma's default light palette (cyan,
   mint) leaks through wherever templates use `tag is-X is-light`. */
.tag.is-primary.is-light,
.tag.is-link.is-light,
.tag.is-info.is-light {
    background-color: var(--tint-info);
    color: var(--deep-teal);
}
.tag.is-success.is-light {
    background-color: var(--tint-success);
    color: var(--reseda-green);
}
.tag.is-warning.is-light {
    background-color: var(--tint-warning);
    color: #8a6d00;
}
.tag.is-danger.is-light {
    background-color: var(--tint-danger);
    color: var(--muted-rose-deep);
}

/* Bulma background/text helpers used in templates; Bulma sets these with
   !important, so the overrides must too. */
.has-background-info-light,
.has-background-primary-light,
.has-background-link-light {
    background-color: var(--tint-info) !important;
}
.has-background-success-light {
    background-color: var(--tint-success) !important;
}
.has-background-warning-light {
    background-color: var(--tint-warning) !important;
}
.has-background-danger-light {
    background-color: var(--tint-danger) !important;
}
.has-background-primary {
    background-color: var(--deep-teal) !important;
}
.has-text-dark {
    color: var(--onyx) !important;
}

/* Messages: map Bulma's message component to the tint palette (it was
   previously unstyled here, so is-info rendered Bulma cyan). */
.message.is-info,
.message.is-primary,
.message.is-link {
    background-color: var(--tint-info);
}
.message.is-info .message-body,
.message.is-primary .message-body,
.message.is-link .message-body {
    border-color: var(--deep-teal);
    color: var(--onyx);
}
.message.is-info .message-header,
.message.is-primary .message-header,
.message.is-link .message-header {
    background-color: var(--deep-teal);
    color: var(--white);
}
.message.is-success {
    background-color: var(--tint-success);
}
.message.is-success .message-body {
    border-color: var(--reseda-green);
    color: var(--onyx);
}
.message.is-success .message-header {
    background-color: var(--reseda-green);
    color: var(--white);
}
.message.is-warning {
    background-color: var(--tint-warning);
}
.message.is-warning .message-body {
    border-color: var(--warm-amber);
    color: var(--onyx);
}
.message.is-warning .message-header {
    background-color: var(--warm-amber);
    color: var(--onyx);
}
.message.is-danger {
    background-color: var(--tint-danger);
}
.message.is-danger .message-body {
    border-color: var(--cinnabar);
    color: var(--onyx);
}
.message.is-danger .message-header {
    background-color: var(--cinnabar);
    color: var(--white);
}
.message.is-dark {
    background-color: var(--grey-lighter);
}
.message.is-dark .message-body {
    border-color: var(--deep-slate-blue);
    color: var(--onyx);
}
.message.is-dark .message-header {
    background-color: var(--deep-slate-blue);
    color: var(--white);
}

/* Chip add controls alignment */
.chip-addons .input.is-small,
.chip-addons .button.is-small {
    height: 2.5rem;
}

/* Light variants with tints */
.notification.is-success.is-light {
    background-color: var(--tint-success);
    color: var(--reseda-green);
}
.notification.is-warning.is-light {
    background-color: var(--tint-warning);
    color: #8a6d00;
}
.notification.is-danger.is-light {
    background-color: var(--tint-danger);
    color: var(--cinnabar);
}
.notification.is-info.is-light {
    background-color: var(--tint-info);
    color: var(--deep-teal);
}

/* Progress bars */
.progress.is-primary::-webkit-progress-value {
    background-color: var(--deep-teal);
}
.progress.is-primary::-moz-progress-bar {
    background-color: var(--deep-teal);
}
.progress.is-success::-webkit-progress-value {
    background-color: var(--reseda-green);
}
.progress.is-success::-moz-progress-bar {
    background-color: var(--reseda-green);
}
.progress.is-info::-webkit-progress-value {
    background-color: var(--deep-teal);
}
.progress.is-info::-moz-progress-bar {
    background-color: var(--deep-teal);
}
.progress.is-warning::-webkit-progress-value {
    background-color: var(--warm-amber);
}
.progress.is-warning::-moz-progress-bar {
    background-color: var(--warm-amber);
}
.progress.is-danger::-webkit-progress-value {
    background-color: var(--cinnabar);
}
.progress.is-danger::-moz-progress-bar {
    background-color: var(--cinnabar);
}

/* Indeterminate progress bars (animated loading bars) */
.progress.is-primary:indeterminate {
    background-image: linear-gradient(to right, var(--deep-teal) 30%, var(--grey-lighter) 30%);
}
.progress.is-success:indeterminate {
    background-image: linear-gradient(to right, var(--reseda-green) 30%, var(--grey-lighter) 30%);
}
.progress.is-info:indeterminate {
    background-image: linear-gradient(to right, var(--deep-teal) 30%, var(--grey-lighter) 30%);
}
.progress.is-warning:indeterminate {
    background-image: linear-gradient(to right, var(--warm-amber) 30%, var(--grey-lighter) 30%);
}
.progress.is-danger:indeterminate {
    background-image: linear-gradient(to right, var(--cinnabar) 30%, var(--grey-lighter) 30%);
}

/* File upload component */
.file-cta {
    background-color: var(--seasalt-white);
    border-color: var(--grey-light);
    color: var(--onyx);
}
.file-cta:hover {
    background-color: var(--grey-lighter);
    border-color: var(--grey);
}
.file-name {
    border-color: var(--grey-light);
}

/* Text colour helpers - greys */
.has-text-grey {
    color: var(--grey) !important;
}
.has-text-grey-light {
    /* Text must stay readable: --grey-light (#DDD) is 1.35:1 on white, so the
       "light" text helper renders as standard secondary grey (WCAG 1.4.3).
       --grey-light remains available for borders and inactive backgrounds. */
    color: var(--grey) !important;
}
.has-text-grey-dark {
    color: var(--grey-dark) !important;
}

/* Text colour helpers - semantic */
.has-text-primary {
    color: var(--deep-teal) !important;
}
.has-text-info {
    color: var(--deep-teal) !important;
}
.has-text-success {
    color: var(--reseda-green) !important;
}
.has-text-warning {
    color: var(--warm-amber) !important;
}
.has-text-danger {
    color: var(--cinnabar) !important;
}
.has-text-link {
    color: var(--deep-teal) !important;
}

/* Utility classes */
.is-inline {
    display: inline !important;
}
.is-inline-block {
    display: inline-block !important;
}

/* Consistent icon sizing in small buttons */
.button.is-small .icon.is-small i {
    font-size: 0.75rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    /* padding: 0 var(--spacing-m); */ /* Commented out - Bulma provides container padding */
}

/* Forms */
input, textarea, select {
    font-family: 'Work Sans', sans-serif;
    font-size: var(--font-size-m);
    padding: var(--spacing-s);
    border: 1px solid #ddd;
    border-radius: 4px;
    /* Removed width: 100% to allow inline elements like checkboxes to size naturally */
}

/* Specific override for textareas and selects if they should remain full width */
textarea, select {
    width: 100%;
}

/* Ensure text inputs are block or inline-block if needed */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="file"] {
    width: 100%;
    display: block; /* Or inline-block if preferred */
}


label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-s) var(--spacing-m);
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: var(--font-size-m);
    text-align: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--muted-rose);
    color: var(--seasalt-white);
}

.btn-primary:hover {
    background-color: #bb4e59;
}

.btn-secondary {
    background-color: var(--deep-slate-blue);
    color: var(--seasalt-white);
}

.btn-secondary:hover {
    background-color: #1f3050;
}

.btn-highlight {
    background-color: var(--warm-amber);
    color: var(--onyx);
}

.btn-highlight:hover {
    background-color: #eaad32;
}

/* Card */
/* Commented out - Relying on Bulma's card styles now
.card {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: var(--spacing-m);
    margin-bottom: var(--spacing-m);
}
*/

.card-header {
    margin-top: 0;
    margin-bottom: var(--spacing-m);
    border-bottom: 1px solid #eee;
    padding-bottom: var(--spacing-s);
}

/* Data elements */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: 'Inter', sans-serif;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.data-table th {
    font-weight: 500;
    text-align: left;
    padding: var(--spacing-m) var(--spacing-l);
    background-color: var(--seasalt-white);
    color: var(--onyx);
    font-size: var(--font-size-m);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #E9ECEF;
}

.data-table td {
    padding: var(--spacing-m) var(--spacing-l);
    border-bottom: 1px solid #E9ECEF;
    font-size: var(--font-size-m);
    color: var(--onyx);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background-color: var(--seasalt-white);
    transition: background-color 0.2s ease;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-s);
    font-weight: 600;
    line-height: 1;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge-draft {
    background-color: var(--warm-amber);
    color: var(--onyx);
}

.status-badge-active {
    background-color: var(--reseda-green);
    color: var(--seasalt-white);
}

.status-badge-archived {
    background-color: var(--deep-slate-blue);
    color: var(--seasalt-white);
}

/* Filter buttons */
.filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    min-width: 120px;
    font-size: var(--font-size-m);
    font-weight: 500;
    border-radius: 0.75rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    font-family: 'Work Sans', sans-serif;
    border: 1px solid transparent;
    white-space: nowrap;
}

.filter-button-active {
    background-color: var(--muted-rose);
    color: var(--seasalt-white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-button-active:hover {
    background-color: #bb4e59;
    text-decoration: none;
}

.filter-button-inactive {
    background-color: var(--seasalt-white);
    color: var(--onyx);
    border-color: #E9ECEF;
}

.filter-button-inactive:hover {
    background-color: #E9ECEF;
    text-decoration: none;
    border-color: #DEE2E6;
}

/* Action links */
.action-link {
    color: var(--deep-teal);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.action-link:hover {
    color: #005a63;
    text-decoration: none;
}

.action-link-primary {
    color: var(--muted-rose);
}

.action-link-primary:hover {
    color: #bb4e59;
}

/* Alert messages */
.alert {
    padding: var(--spacing-m);
    border-radius: 4px;
    margin-bottom: var(--spacing-m);
}

.alert-error {
    background-color: rgba(231, 76, 60, 0.1);
    border-left: 4px solid var(--cinnabar);
    color: var(--cinnabar);
}

.alert-success {
    background-color: rgba(104, 139, 88, 0.1);
    border-left: 4px solid var(--reseda-green);
    color: var(--reseda-green);
}

.alert-info {
    background-color: rgba(0, 109, 119, 0.1);
    border-left: 4px solid var(--deep-teal);
    color: var(--deep-teal);
}

/* Fallback styles in case components don't load */
textarea {
    width: 100%;
    min-height: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Work Sans', sans-serif;
    font-size: var(--font-size-m);
    margin-bottom: var(--spacing-m);
}

/* :not(.button) keeps this off Bulma buttons: the attribute selector outranks
   Bulma's variable-driven colour and padding, which turned every styled submit
   button rose with fixed padding regardless of its classes */
button[type="submit"]:not(.button) {
    background-color: var(--muted-rose);
    color: var(--seasalt-white);
    padding: var(--spacing-s) var(--spacing-m);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
}

button[type="submit"]:not(.button):hover {
    background-color: #bb4e59;
}

/* Key activities list styling */
.key-activities {
    list-style-type: none;
    padding-left: 0;
}

.key-activities li {
    margin: 5px 0;
    padding-left: 20px;
    position: relative;
}

.key-activities li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--onyx);
}

.alignment-score {
    font-weight: bold;
    color: var(--deep-teal);
}

/* Feedback form styling */
.feedback-form {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ccc;
}

.rating-container {
    display: flex;
    flex-wrap: wrap;
    margin: 10px 0;
    gap: var(--spacing-s);
}

.feedback-textarea {
    height: 80px;
    width: 100%;
}

.model-info {
    font-size: 0.8em;
    color: #666;
    margin-top: 10px;
}

.feedback-submitted {
    background-color: rgba(104, 139, 88, 0.1);
    border-left: 4px solid var(--reseda-green);
    color: var(--reseda-green);
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    display: none;
}

/* Header and Navigation */
.site-header {
    background-color: var(--muted-rose) !important;
    padding: var(--spacing-m) 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: var(--seasalt-white);
    font-weight: 600;
    font-size: var(--font-size-xl);
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: var(--spacing-m);
}

.main-nav a {
    color: var(--seasalt-white);
    text-decoration: none;
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-s);
    border-radius: 4px;
    transition: background-color 0.2s;
}

.main-nav a:hover {
    background-color: rgba(255,255,255,0.1);
    text-decoration: none;
}

/* Footer styling */
.site-footer {
    background-color: var(--onyx);
    color: var(--seasalt-white);
    padding: var(--spacing-m) 0;
    margin-top: var(--spacing-xxl);
    text-align: center;
}

/* HTMX Indicator */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}
/* Hide elements during HTMX request */
.htmx-request .htmx-indicator-hide,
.htmx-request.htmx-indicator-hide {
    display: none !important;
}

/* Automatic busy state: htmx puts .htmx-request on the element that fired
   the request, so any button-triggered action shows a spinner and blocks
   double-clicks with no per-template wiring. Templates can still opt into
   richer feedback with hx-indicator. */
.button.htmx-request {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}
.button.htmx-request::after {
    content: "";
    position: absolute;
    left: calc(50% - 8px);
    top: calc(50% - 8px);
    width: 16px;
    height: 16px;
    border: 2px solid var(--grey-light);
    border-top-color: var(--deep-teal);
    border-radius: var(--border-radius-full);
    animation: htmx-busy-spin 0.6s linear infinite;
}
@keyframes htmx-busy-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    /* Keep the affordance but slow it right down */
    .button.htmx-request::after { animation-duration: 1.8s; }
}

/* Checkbox List Item Alignment */
.checkbox-list-item {
    margin-bottom: var(--spacing-s); /* Keep existing margin */
}

.checkbox-list-item > div { /* Target the wrapper div */
    display: flex;
    align-items: flex-start; /* Align items to the top */
}

.checkbox-list-item input[type="checkbox"] {
    margin-right: var(--spacing-s); /* Space between checkbox and label */
    flex-shrink: 0; /* Prevent checkbox from shrinking */
    margin-top: 0.2em; /* Small adjustment to align checkbox visually with text */
    /* Reset width if it was globally set */
    width: auto; 
}

.checkbox-list-item label {
    margin-bottom: 0; /* Override default label margin */
    /* Ensure label takes remaining space if needed, though not strictly necessary with flex-start */
}

/* Survey Detail Info List Styling */
.survey-info dl {
    margin-top: var(--spacing-s); /* Add some space above the list */
    padding: var(--spacing-m);
    background-color: #fff; /* White background */
    border-radius: 4px; /* Match card radius */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Match card shadow */
}

.survey-info dt {
    font-weight: 600; /* Bold terms */
    color: var(--deep-slate-blue); /* Use a supporting colour */
    margin-top: var(--spacing-s); /* Space above each term */
}

.survey-info dt:first-of-type {
    margin-top: 0; /* No margin above the first term */
}

.survey-info dd {
    margin-left: 0; /* Remove default indentation */
    margin-bottom: var(--spacing-s); /* Space below each definition */
    color: var(--onyx); /* Standard text colour */
}

/* Bulma Overrides - Phase 1 (Navbar) */

/* Override the background color of the main navbar */
.navbar.navbar-main {
    --bulma-navbar-background-color: var(--muted-rose); /* Tell Bulma's variable system to use our color */
    background-color: var(--muted-rose); /* Also set it directly */
    /* Additional overrides for text color, hover states, etc. will be kept */
}

/* Override the text color for links within the main navbar */
.navbar.navbar-main .navbar-item,
.navbar.navbar-main .navbar-link {
    color: var(--seasalt-white); /* White text for contrast */
}

/* Override hover/focus states for links within the main navbar */
.navbar.navbar-main .navbar-item:hover,
.navbar.navbar-main .navbar-item:focus,
.navbar.navbar-main .navbar-link:hover,
.navbar.navbar-main .navbar-link:focus {
    background-color: rgba(255, 255, 255, 0.1); /* Slight white highlight on hover */
    color: var(--seasalt-white); /* Ensure text remains white */
}

/* Override the active state background color for links within the main navbar */
.navbar.navbar-main .navbar-item.is-active,
.navbar.navbar-main .navbar-link.is-active {
    background-color: rgba(255, 255, 255, 0.2); /* Slightly stronger highlight for active */
    color: var(--seasalt-white);
}

/* Override the color of the navbar burger icon */
.navbar.navbar-main .navbar-burger {
    color: var(--seasalt-white);
}

/* Ensure the brand text (if styled separately) also uses the correct color */
.navbar.navbar-main .navbar-brand .navbar-item .has-text-white {
    color: var(--seasalt-white) !important; /* Use !important if necessary to override Bulma utility */
}

/* Bulma Overrides - Dashboard Cards */

/* Style links within card titles to use the design system link color */
.card .card-content .title a {
    color: var(--deep-teal);
}

/* Optional: Define hover state if needed */
.card .card-content .title a:hover {
    /* color: var(--some-hover-color); */ /* Uncomment and set if a specific hover color is desired */
    text-decoration: underline; /* Keep Bulma's default underline on hover for links */
}

/* Ensure cards within columns stretch to the same height - only for card grids */
.columns.is-card-grid .column .card {
    height: 100%;
    /* Optional: If content needs aligning, make card a flex container too */
    /* display: flex; */
    /* flex-direction: column; */
}

/* Optional: If card-content needs to grow */
/* .column .card .card-content {
    flex-grow: 1;
} */

/* Add custom styles at the end or in appropriate sections */

/* Increase Navbar Height */
.navbar-item {
    padding-top: 1rem; 
    padding-bottom: 1rem;
}

/* Increase Logo Max Height within Navbar */
.navbar-brand .navbar-item img {
    max-height: 2.5rem; /* Adjust as needed */
}

/* Bulma Overrides - Breadcrumb */
.breadcrumb a {
    color: var(--deep-teal);
}
.breadcrumb a:hover {
    color: var(--deep-teal);
}
.breadcrumb li.is-active a {
    color: var(--onyx);
}

/* Bulma Overrides - Tabs */
.tabs a {
    color: var(--deep-teal);
    border-bottom-color: var(--grey-light);
}
.tabs a:hover {
    color: var(--deep-teal);
    border-bottom-color: var(--deep-teal);
}
.tabs li.is-active a {
    color: var(--deep-teal);
    border-bottom-color: var(--deep-teal);
}
.tabs.is-boxed li.is-active a {
    background-color: var(--seasalt-white);
    border-color: var(--grey-light);
    border-bottom-color: transparent;
}

/* Bulma Overrides - Dropdown button items */
/* Native <button> elements inside dropdown menus need explicit styling
   since Bulma's .dropdown-item rules mainly target <a> elements */
.dropdown-content button.dropdown-item {
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0.375rem 1rem;
    color: var(--onyx);
}
.dropdown-content button.dropdown-item:hover {
    background-color: var(--bulma-background);
    color: var(--onyx);
}

/* Step Indicator - Reusable workflow stepper */
.steps-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
    padding: 0 1rem;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 1rem;
    left: 60%;
    right: -40%;
    height: 2px;
    background-color: var(--grey-light);
    z-index: 1;
}

.step-item.is-completed:not(:last-child)::after {
    background-color: var(--reseda-green);
}

.step-item.is-active:not(:last-child)::after {
    background-color: var(--deep-teal);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--grey-light);
    color: var(--grey);
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 2;
    position: relative;
    margin-bottom: 0.5rem;
}

.step-item.is-active .step-number {
    background-color: var(--deep-teal);
    color: white;
}

.step-item.is-completed .step-number {
    background-color: var(--reseda-green);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    color: var(--grey);
}

.step-item.is-active .step-label {
    color: var(--deep-teal);
    font-weight: 600;
}

.step-item.is-completed .step-label {
    color: var(--reseda-green);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.has-text-rose {
    color: var(--muted-rose);
}

/* ==========================================================================
   Notification Overrides (brand colours)
   ========================================================================== */

.notification.is-success.is-light {
    background-color: var(--tint-success);
    color: var(--reseda-green);
}
.notification.is-danger.is-light {
    background-color: var(--tint-danger);
    color: var(--cinnabar);
}
.notification.is-warning.is-light {
    background-color: var(--tint-warning);
    color: #9a7b1a;
}
.notification.is-info.is-light {
    background-color: var(--tint-info);
    color: var(--deep-teal);
}

/* ==========================================================================
   Reduced motion: disable decorative transitions for users who ask for it
   (WCAG 2.3.3). Covers every transition defined in this file.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .tabs a.tab-link,
    .btn,
    .data-table tr:hover,
    .filter-button,
    .action-link,
    .main-nav a,
    .htmx-indicator {
        transition: none;
    }
    /* Bulma's indeterminate progress bar animates regardless of preference;
       show it static (Font Awesome spinners already respect this query) */
    .progress:indeterminate {
        animation: none;
    }
}
