/* ============================================
   NHRC COMPLAINTS MANAGEMENT SYSTEM
   Shared Stylesheet
   ============================================ */

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    /* Colors - Refined Institutional */
    --color-primary-dark: #1e3a5f;
    --color-primary: #2563eb;
    --color-primary-light: #dbeafe;
    --color-accent: #0891b2;
    --color-accent-light: #cffafe;

    --color-success: #15803d;
    --color-success-light: #dcfce7;
    --color-warning: #b45309;
    --color-warning-light: #fef3c7;
    --color-danger: #dc2626;
    --color-danger-light: #fee2e2;

    --color-bg: #f8fafc;
    --color-bg-alt: #f1f5f9;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;

    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-primary: 0 4px 12px rgba(37,99,235,0.3);
    --shadow-nav: 0 4px 12px rgba(30,58,95,0.2);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lexend', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-primary-dark);
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

.text-muted { color: var(--color-text-muted); }
.text-light { color: var(--color-text-light); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

/* ============================================
   PUBLIC HEADER & NAVIGATION
   ============================================ */
.public-nav {
    background: var(--color-primary-dark);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-nav);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.public-nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
}

.public-nav-logo {
    height: 40px;
    width: auto;
    background: white;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.public-nav-title {
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.public-nav-links {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
    flex-wrap: wrap;
}

.public-nav-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    padding: var(--space-sm) 0;
}

.public-nav-link:hover,
.public-nav-link.active {
    color: white;
    text-decoration: none;
}

.public-nav-link.active {
    font-weight: 600;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: rgba(255,255,255,0.1);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
}

.lang-switcher a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.85rem;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.lang-switcher a:hover {
    color: white;
}

.lang-switcher a.active {
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 500;
}

/* ============================================
   PUBLIC HEADER (HERO STYLE)
   ============================================ */
.public-header {
    background: var(--color-primary-dark);
    color: white;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
}

.public-header-logo {
    height: 80px;
    width: auto;
    margin-bottom: var(--space-md);
    border-radius: var(--radius-md);
    background: white;
    padding: 8px;
}

.public-header h1 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
}

.public-header p {
    color: rgba(255,255,255,0.8);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   PUBLIC CONTENT AREA
   ============================================ */
.public-content {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

.public-content-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

/* ============================================
   PUBLIC FOOTER
   ============================================ */
.public-footer {
    background: var(--color-primary-dark);
    color: rgba(255,255,255,0.7);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    font-size: 0.85rem;
    margin-top: var(--space-2xl);
}

.public-footer a {
    color: white;
}

.public-footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.public-footer-links a {
    color: rgba(255,255,255,0.8);
}

.public-footer-links a:hover {
    color: white;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--color-bg);
}

.btn-ghost {
    background: transparent;
    color: var(--color-primary);
}

.btn-ghost:hover {
    background: var(--color-primary-light);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-weight: 600;
    color: var(--color-primary-dark);
}

.card-body {
    padding: var(--space-lg);
}

.card-accent {
    border-top: 3px solid var(--color-accent);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-new { background: var(--color-primary-light); color: var(--color-primary-dark); }
.badge-progress { background: var(--color-accent-light); color: var(--color-accent); }
.badge-success { background: var(--color-success-light); color: var(--color-success); }
.badge-warning { background: var(--color-warning-light); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-light); color: var(--color-danger); }
.badge-muted { background: var(--color-bg-alt); color: var(--color-text-muted); }

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.form-label .required {
    color: var(--color-danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-help {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
}

.form-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-lg);
    flex-wrap: wrap;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--color-primary);
}

/* ============================================
   PROGRESS STEPS
   ============================================ */
.progress-steps {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.step {
    display: flex;
    align-items: center;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    background: var(--color-border);
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.step.active .step-number {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.step.completed .step-number {
    background: var(--color-success);
    color: white;
}

.step-label {
    margin-left: var(--space-sm);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.step.active .step-label {
    color: var(--color-text);
    font-weight: 500;
}

.step.completed .step-label {
    color: var(--color-success);
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--color-border);
    margin: 0 var(--space-sm);
}

.step.completed + .step-connector,
.step-connector.completed {
    background: var(--color-success);
}

@media (max-width: 600px) {
    .step-label {
        display: none;
    }
    .step-connector {
        width: 24px;
    }
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.alert-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.alert-info {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
}
.alert-info .alert-icon { background: var(--color-primary); color: white; }

.alert-success {
    background: var(--color-success-light);
    color: #166534;
}
.alert-success .alert-icon { background: var(--color-success); color: white; }

.alert-warning {
    background: var(--color-warning-light);
    color: #92400e;
}
.alert-warning .alert-icon { background: #f59e0b; color: white; }

.alert-danger {
    background: var(--color-danger-light);
    color: #991b1b;
}
.alert-danger .alert-icon { background: var(--color-danger); color: white; }

/* ============================================
   TABLES
   ============================================ */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: var(--space-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.table tr:hover {
    background: var(--color-bg);
}

.table-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.table-link:hover {
    text-decoration: underline;
}

/* ============================================
   STATS CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.stat-card.accent {
    border-top: 3px solid var(--color-accent);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: var(--space-sm);
}

.stat-change {
    font-size: 0.8rem;
    margin-top: var(--space-sm);
}

.stat-change.positive { color: var(--color-success); }
.stat-change.negative { color: var(--color-danger); }

/* ============================================
   STAFF LAYOUT
   ============================================ */
.staff-nav {
    background: var(--color-primary-dark);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-nav);
}

.staff-nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
}

.staff-nav-logo {
    height: 36px;
    width: auto;
    background: white;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.staff-nav-text {
    display: flex;
    flex-direction: column;
}

.staff-nav-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    line-height: 1.2;
}

.staff-nav-subtitle {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
}

.staff-nav-links {
    display: flex;
    gap: var(--space-lg);
}

.staff-nav-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.staff-nav-link:hover,
.staff-nav-link.active {
    color: white;
}

.staff-nav-link.active {
    font-weight: 600;
}

.staff-nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: white;
    font-size: 0.85rem;
}

.staff-nav-avatar {
    width: 32px;
    height: 32px;
    background: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Staff Dashboard Layout */
.staff-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 64px);
}

@media (max-width: 900px) {
    .staff-layout {
        grid-template-columns: 1fr;
    }
    .staff-sidebar {
        display: none;
    }
}

.staff-sidebar {
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: var(--space-lg);
}

.sidebar-section {
    margin-bottom: var(--space-xl);
}

.sidebar-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
    margin-bottom: var(--space-md);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 500;
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.staff-main {
    padding: var(--space-lg);
    background: var(--color-bg);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    margin-bottom: var(--space-lg);
}

.content-section {
    margin-bottom: var(--space-xl);
}

/* ============================================
   CASE LIST ITEM
   ============================================ */
.case-item {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
    gap: var(--space-md);
    text-decoration: none;
    color: inherit;
}

.case-item:last-child {
    border-bottom: none;
}

.case-item:hover {
    background: var(--color-bg);
}

.case-priority {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    flex-shrink: 0;
}

.case-priority.high { background: var(--color-danger); }
.case-priority.medium { background: var(--color-warning); }
.case-priority.low { background: var(--color-success); }
.case-priority.normal { background: var(--color-accent); }

.case-info {
    flex: 1;
    min-width: 0;
}

.case-id {
    font-weight: 600;
    color: var(--color-primary);
}

.case-type {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.case-meta {
    text-align: right;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s;
}

.quick-action:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    text-decoration: none;
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-icon.blue { background: var(--color-primary-light); color: var(--color-primary-dark); }
.quick-action-icon.teal { background: var(--color-accent-light); color: var(--color-accent); }
.quick-action-icon.green { background: var(--color-success-light); color: var(--color-success); }

.quick-action-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
    position: relative;
    padding-left: var(--space-xl);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-lg);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -25px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.timeline-marker.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.timeline-marker.completed {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

.timeline-content {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.timeline-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: var(--space-xs);
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.timeline-description {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: var(--space-sm);
}

/* ============================================
   DASHBOARD CHARTS (PLACEHOLDER)
   ============================================ */
.chart-placeholder {
    background: var(--color-bg-alt);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-2xl);
    text-align: center;
    color: var(--color-text-muted);
}

.chart-bar {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    height: 200px;
    padding: var(--space-md);
}

.chart-bar-item {
    flex: 1;
    background: var(--color-primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    min-height: 20px;
    position: relative;
}

.chart-bar-item.accent { background: var(--color-accent); }
.chart-bar-item.success { background: var(--color-success); }
.chart-bar-item.warning { background: var(--color-warning); }

.chart-bar-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

@media (max-width: 900px) {
    .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   LANDING PAGE HERO CARDS
   ============================================ */
.hero-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.hero-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.hero-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    text-decoration: none;
}

.hero-card-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
}

.hero-card-icon.blue { background: var(--color-primary-light); color: var(--color-primary); }
.hero-card-icon.teal { background: var(--color-accent-light); color: var(--color-accent); }
.hero-card-icon.green { background: var(--color-success-light); color: var(--color-success); }

.hero-card-icon svg {
    width: 32px;
    height: 32px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.hero-card h3 {
    margin-bottom: var(--space-sm);
}

.hero-card p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .form-input,
.filter-bar .form-select {
    width: auto;
    min-width: 150px;
}

.search-input {
    position: relative;
}

.search-input input {
    padding-left: 40px;
}

.search-input svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: var(--color-text-muted);
    stroke-width: 2;
    fill: none;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    gap: var(--space-xs);
    justify-content: center;
    margin-top: var(--space-lg);
}

.pagination a,
.pagination span {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.pagination a:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.pagination .active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ============================================
   MAP PLACEHOLDER
   ============================================ */
.map-placeholder {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-accent-light) 100%);
    border-radius: var(--radius-lg);
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary-dark);
    font-weight: 500;
}

/* ============================================
   DONUT CHART PLACEHOLDER
   ============================================ */
.donut-chart {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(
        var(--color-success) 0deg 120deg,
        var(--color-warning) 120deg 200deg,
        var(--color-primary) 200deg 280deg,
        var(--color-accent) 280deg 360deg
    );
    position: relative;
    margin: 0 auto;
}

.donut-chart::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: var(--color-surface);
    border-radius: 50%;
}

.donut-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
    margin-top: var(--space-lg);
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
}

.donut-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.p-0 { padding: 0; }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }

.text-center { text-align: center; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.hidden { display: none; }

@media (max-width: 600px) {
    .hide-mobile { display: none; }
}

/* ============================================
   ACCESSIBILITY CONTROLS
   ============================================ */
.accessibility-bar {
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-xs) var(--space-lg);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.8rem;
}

.a11y-control {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-text-muted);
}

.a11y-control button {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-family: inherit;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.a11y-control button:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
}

.a11y-control button.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.a11y-control svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* High contrast mode */
body.high-contrast {
    --color-bg: #000000;
    --color-bg-alt: #1a1a1a;
    --color-surface: #0a0a0a;
    --color-border: #444444;
    --color-text: #ffffff;
    --color-text-muted: #cccccc;
    --color-primary: #6ea8fe;
    --color-primary-light: #1a2a40;
    --color-primary-dark: #ffffff;
}

body.high-contrast .public-nav,
body.high-contrast .public-header,
body.high-contrast .public-footer {
    background: #000000;
    border: 2px solid #ffffff;
}

body.high-contrast a {
    color: #6ea8fe;
    text-decoration: underline;
}

/* Large text mode */
body.large-text {
    font-size: 1.15rem;
}

body.large-text h1 { font-size: 2.5rem; }
body.large-text h2 { font-size: 2rem; }
body.large-text h3 { font-size: 1.5rem; }
body.large-text .form-input,
body.large-text .form-select,
body.large-text .form-textarea,
body.large-text .btn {
    font-size: 1.1rem;
    padding: 14px 20px;
}

/* Dyslexia-friendly font */
body.dyslexia-font {
    font-family: 'OpenDyslexic', 'Comic Sans MS', 'Lexend', sans-serif;
    letter-spacing: 0.05em;
    word-spacing: 0.1em;
    line-height: 1.8;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
    animation: none !important;
    transition: none !important;
}

@media (max-width: 600px) {
    .accessibility-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-xs);
    }
    .a11y-control span {
        display: none;
    }
}

/* ============================================
   SKIP NAVIGATION LINK (Accessibility)
   ============================================ */
.skip-link {
    position: absolute;
    top: -50px;
    left: var(--space-md);
    background: var(--color-primary);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    z-index: 10000;
    font-weight: 600;
    font-size: 0.9rem;
    transition: top 0.3s ease;
    text-decoration: none;
}

.skip-link:focus {
    top: var(--space-md);
    outline: 2px solid white;
    outline-offset: 2px;
}

/* ============================================
   FOCUS RING CONSISTENCY
   ============================================ */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline-offset: 3px;
    box-shadow: var(--shadow-primary);
}

.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */
.public-content,
.public-content-wide {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   BUTTON LOADING STATES
   ============================================ */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-secondary.btn-loading::after {
    border-top-color: var(--color-primary);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   FORM VALIDATION STATES
   ============================================ */
.form-input.is-valid,
.form-select.is-valid,
.form-textarea.is-valid {
    border-color: var(--color-success);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
    border-color: var(--color-danger);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-error {
    color: var(--color-danger);
    font-size: 0.8rem;
    margin-top: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ============================================
   CHARACTER COUNTER
   ============================================ */
.form-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: var(--space-xs);
    gap: var(--space-md);
}

.char-counter {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.char-counter.warning {
    color: var(--color-warning);
}

.char-counter.danger {
    color: var(--color-danger);
}

/* ============================================
   SUCCESS MODAL
   ============================================ */
.success-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.success-modal-overlay.open {
    display: flex;
}

.success-modal {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    max-width: 480px;
    width: 100%;
    text-align: center;
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.success-modal-icon {
    width: 80px;
    height: 80px;
    background: var(--color-success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-modal-icon svg {
    width: 40px;
    height: 40px;
    stroke: var(--color-success);
    stroke-width: 2.5;
    fill: none;
    animation: checkDraw 0.4s ease-out 0.3s both;
}

@keyframes checkDraw {
    from {
        stroke-dasharray: 50;
        stroke-dashoffset: 50;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.success-modal h2 {
    color: var(--color-success);
    margin-bottom: var(--space-sm);
}

.success-modal p {
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.reference-number-box {
    background: var(--color-bg-alt);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.reference-number-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
}

.reference-number-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    font-family: monospace;
    letter-spacing: 0.05em;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: var(--space-sm);
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--color-bg);
    border-color: var(--color-primary);
}

.copy-btn.copied {
    background: var(--color-success-light);
    border-color: var(--color-success);
    color: var(--color-success);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ============================================
   MOBILE NAVIGATION
   ============================================ */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    color: white;
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .public-nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-primary-dark);
        padding: var(--space-md) var(--space-lg);
        flex-direction: column;
        gap: var(--space-sm);
        box-shadow: var(--shadow-lg);
        z-index: 1000;
    }

    .public-nav-links.open {
        display: flex;
    }

    .public-nav-link {
        padding: var(--space-sm) 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .lang-switcher {
        margin-top: var(--space-sm);
        justify-content: center;
    }

    .public-nav {
        position: relative;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .public-nav,
    .public-footer,
    .action-buttons,
    .skip-link,
    .mobile-menu-toggle,
    .lang-switcher,
    .accessibility-bar {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .public-header {
        background: none;
        color: black;
        padding: var(--space-lg) 0;
        border-bottom: 2px solid #333;
    }

    .public-header h1,
    .public-header p {
        color: black;
    }

    .result-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .result-header {
        background: #f0f0f0;
        color: black;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .result-header .status-badge {
        background: #333;
        color: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .timeline-step.completed .timeline-dot,
    .timeline-step.active .timeline-dot {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .next-steps {
        border: 1px solid #0891b2;
        background: #f0f9fa;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    a {
        color: black;
        text-decoration: none;
    }

    .public-content,
    .public-content-wide {
        max-width: none;
        padding: 0;
    }

    .btn {
        display: none !important;
    }
}

/* ============================================
   DATA FRESHNESS INDICATOR
   ============================================ */
.data-freshness {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    background: var(--color-bg-alt);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
}

.data-freshness svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ============================================
   TRUST INDICATORS BAR
   ============================================ */
.trust-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-lg);
    background: var(--color-primary-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
    text-align: center;
}

.trust-item strong {
    display: block;
    font-size: 1.75rem;
    color: var(--color-primary-dark);
    line-height: 1.2;
}

.trust-item span {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ============================================
   HOW IT WORKS SECTION
   ============================================ */
.how-it-works {
    margin-top: var(--space-xl);
    padding: var(--space-xl);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.how-it-works h2 {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-lg);
}

.process-step {
    text-align: center;
    position: relative;
}

.step-icon {
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto var(--space-md);
}

.process-step h4 {
    margin-bottom: var(--space-xs);
    color: var(--color-primary-dark);
}

.process-step p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* ============================================
   TIMELINE ANIMATIONS
   ============================================ */
.timeline-step {
    opacity: 0;
    animation: fadeInTimeline 0.3s ease-out forwards;
}

.timeline-step:nth-child(1) { animation-delay: 0.05s; }
.timeline-step:nth-child(2) { animation-delay: 0.1s; }
.timeline-step:nth-child(3) { animation-delay: 0.15s; }
.timeline-step:nth-child(4) { animation-delay: 0.2s; }
.timeline-step:nth-child(5) { animation-delay: 0.25s; }
.timeline-step:nth-child(6) { animation-delay: 0.3s; }
.timeline-step:nth-child(7) { animation-delay: 0.35s; }
.timeline-step:nth-child(8) { animation-delay: 0.4s; }
.timeline-step:nth-child(9) { animation-delay: 0.45s; }
.timeline-step:nth-child(10) { animation-delay: 0.5s; }

@keyframes fadeInTimeline {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   CHART TOOLTIPS
   ============================================ */
.month-bar {
    position: relative;
}

.month-bar::after {
    content: attr(data-value) ' complaints';
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary-dark);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 10;
}

.month-bar:hover::after {
    opacity: 1;
}

/* ============================================
   PROGRESS HEADER ENHANCEMENT
   ============================================ */
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    padding: 0 var(--space-sm);
}

.progress-text {
    font-weight: 600;
    color: var(--color-text);
}

.progress-estimate {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--color-text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    stroke: var(--color-text-light);
    stroke-width: 1.5;
    fill: none;
    margin-bottom: var(--space-md);
}

.empty-state h3 {
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

/* ============================================
   FORM VALIDATION FEEDBACK
   ============================================ */
.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--color-danger);
    background-color: #fef2f2;
}

.form-input.error:focus,
.form-select.error:focus,
.form-textarea.error:focus {
    box-shadow: 0 0 0 3px var(--color-danger-light);
}

.form-error {
    color: var(--color-danger);
    font-size: 0.8rem;
    margin-top: var(--space-xs);
    display: none;
    align-items: center;
    gap: var(--space-xs);
}

.form-error.visible {
    display: flex;
}

.form-error svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.form-group.has-error .form-error {
    display: flex;
}

.form-input.valid,
.form-select.valid,
.form-textarea.valid {
    border-color: var(--color-success);
}

.form-success-indicator {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-success);
}

/* Radio/checkbox group error states */
.radio-group.error,
.decision-options.error {
    border: 2px solid var(--color-danger);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    background-color: #fef2f2;
}

.decision-option.error {
    border-color: var(--color-danger);
}

/* ============================================
   LOADING STATES
   ============================================ */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-secondary.btn-loading::after {
    border-color: rgba(0,0,0,0.2);
    border-top-color: var(--color-primary);
}

/* Skeleton loading for cards */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Loading overlay for cards/sections */
.card-loading {
    position: relative;
    pointer-events: none;
}

.card-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.card-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid var(--color-primary-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    z-index: 11;
    animation: spin 0.8s linear infinite;
}

/* Toast notification for async feedback */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
}

.toast {
    background: var(--color-primary-dark);
    color: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--color-success);
}

.toast.error {
    background: var(--color-danger);
}

.toast.warning {
    background: var(--color-warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   TEXT-TO-SPEECH ACCESSIBILITY
   ============================================ */

/* Speaker buttons on elements */
.tts-speaker-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 4px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    opacity: 0.6;
}

.tts-speaker-btn:hover {
    opacity: 1;
    background: var(--color-primary-light);
    border-color: var(--color-primary);
}

.tts-speaker-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    opacity: 1;
}

.tts-speaker-btn svg {
    width: 14px;
    height: 14px;
    stroke: var(--color-text-muted);
    stroke-width: 2;
    fill: none;
}

.tts-speaker-btn:hover svg {
    stroke: var(--color-primary);
}

/* Smaller speaker buttons for form labels */
.form-label .tts-speaker-btn {
    width: 20px;
    height: 20px;
    padding: 3px;
}

.form-label .tts-speaker-btn svg {
    width: 12px;
    height: 12px;
}

/* Highlight text being spoken */
.tts-highlight {
    background: linear-gradient(to right, var(--color-primary-light), var(--color-accent-light));
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
    animation: tts-pulse 1s ease-in-out infinite;
}

@keyframes tts-pulse {
    0%, 100% { outline-color: var(--color-primary); }
    50% { outline-color: var(--color-accent); }
}

/* Listen mode active indicator */
body.tts-listen-mode {
    cursor: crosshair;
}

body.tts-listen-mode *:not(input):not(select):not(textarea):not(button):not(a):not(.a11y-control *):not(.lang-switcher *) {
    cursor: pointer;
}

body.tts-listen-mode h1:hover,
body.tts-listen-mode h2:hover,
body.tts-listen-mode h3:hover,
body.tts-listen-mode p:hover,
body.tts-listen-mode li:hover,
body.tts-listen-mode label:hover,
body.tts-listen-mode .alert:hover,
body.tts-listen-mode td:hover,
body.tts-listen-mode th:hover {
    background: var(--color-primary-light);
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

/* TTS tooltip (shown when listen mode activated) */
.tts-tooltip {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary-dark);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    z-index: 10001;
    font-size: 0.9rem;
    animation: tts-tooltip-in 0.3s ease-out;
}

.tts-tooltip svg {
    stroke: currentColor;
    flex-shrink: 0;
}

@keyframes tts-tooltip-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.tts-tooltip-fade {
    animation: tts-tooltip-out 0.5s ease-out forwards;
}

@keyframes tts-tooltip-out {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* TTS notification (language fallback) */
.tts-notification {
    position: fixed;
    top: 80px;
    right: var(--space-lg);
    background: var(--color-warning-light);
    color: var(--color-warning);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    z-index: 10001;
    font-size: 0.85rem;
    border-left: 3px solid var(--color-warning);
    animation: tts-notification-in 0.3s ease-out;
}

.tts-notification svg {
    stroke: currentColor;
    flex-shrink: 0;
}

@keyframes tts-notification-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tts-notification-fade {
    animation: tts-notification-out 0.5s ease-out forwards;
}

@keyframes tts-notification-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* TTS controls in accessibility bar */
.tts-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-left: var(--space-md);
    border-left: 1px solid var(--color-border);
    margin-left: var(--space-sm);
}

.tts-controls .a11y-control button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tts-controls .tts-stop-btn {
    background: var(--color-danger-light);
    border-color: var(--color-danger);
    color: var(--color-danger);
    display: none;
}

.tts-controls .tts-stop-btn:hover {
    background: var(--color-danger);
    color: white;
}

/* Speed control group */
.tts-speed-group {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--color-bg-alt);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.tts-speed-group button {
    padding: 4px 6px !important;
    font-size: 0.7rem !important;
    min-width: auto;
    border-radius: 3px;
}

.tts-speed-group button.active {
    background: var(--color-primary);
    color: white;
}

/* Speaking indicator animation */
body.tts-speaking .tts-speaker-btn svg,
.a11y-control button[data-tts="listen"].active svg {
    animation: tts-speaking-icon 0.8s ease-in-out infinite;
}

@keyframes tts-speaking-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Mobile adjustments for TTS */
@media (max-width: 768px) {
    .tts-controls {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        padding-top: var(--space-xs);
        border-top: 1px solid var(--color-border);
        margin-top: var(--space-xs);
        flex-wrap: wrap;
        justify-content: center;
    }

    .tts-tooltip {
        bottom: var(--space-md);
        left: var(--space-md);
        right: var(--space-md);
        transform: none;
    }

    @keyframes tts-tooltip-in {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .tts-notification {
        top: auto;
        bottom: var(--space-lg);
        right: var(--space-md);
        left: var(--space-md);
    }
}

/* Hide TTS speaker buttons when printing */
@media print {
    .tts-speaker-btn,
    .tts-controls,
    .tts-tooltip,
    .tts-notification {
        display: none !important;
    }
}

/* High contrast mode TTS adjustments */
body.high-contrast .tts-highlight {
    background: #ffff00;
    outline-color: #ffffff;
}

body.high-contrast .tts-speaker-btn {
    background: #333;
    border-color: #fff;
}

body.high-contrast .tts-speaker-btn svg {
    stroke: #fff;
}

body.high-contrast .tts-tooltip {
    background: #000;
    border: 2px solid #fff;
}

body.high-contrast .tts-notification {
    background: #000;
    color: #ffcc00;
    border-color: #ffcc00;
}

/* Reduced motion - disable TTS animations */
body.reduce-motion .tts-highlight,
body.reduce-motion .tts-speaker-btn svg,
body.reduce-motion .a11y-control button svg {
    animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .tts-highlight,
    .tts-speaker-btn svg,
    .a11y-control button svg {
        animation: none !important;
    }
}
