/* Accessibility Improvements for CalcMyWealth */

/* Improve color contrast for better readability */
:root {
    --primary-color: #5b21b6; /* Darker purple for better contrast */
    --secondary-color: #6d28d9;
    --success-color: #059669; /* Darker green */
    --text-color: #111827; /* Darker text */
    --border-color: #d1d5db;
    --background-color: #ffffff;
    --link-color: #2563eb; /* Better contrast blue */
}

/* Ensure all interactive elements have visible focus states */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

/* Skip to main content link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

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

/* Ensure sufficient color contrast for all text */
.help-text {
    color: #4b5563; /* Darker gray for better contrast */
}

.result-label {
    color: #374151;
}

/* Improve button contrast */
.btn {
    font-weight: 600;
    min-height: 44px; /* Touch target size */
    min-width: 44px;
}

.btn-primary {
    background-color: #2563eb;
    color: #ffffff;
}

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

.btn-secondary {
    background-color: #6b7280;
    color: #ffffff;
}

/* Ensure form elements have proper sizing for accessibility */
input[type="number"],
input[type="text"],
input[type="search"],
select {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
}

/* Improve link contrast and underlines */
a {
    color: var(--link-color);
    text-decoration: underline;
}

a:hover {
    text-decoration: none;
}

/* Navigation links should be clearly distinguished */
.nav-menu a {
    padding: 10px 15px;
    display: inline-block;
}

/* Ensure error messages are accessible */
.error-message {
    color: #dc2626;
    font-weight: 600;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Ensure tables are accessible */
table {
    border-collapse: collapse;
    width: 100%;
}

th {
    text-align: left;
    font-weight: 700;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #4c1d95;
        --text-color: #000000;
        --background-color: #ffffff;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Ensure interactive elements are large enough */
.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    min-height: 44px;
    cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* Improve readability of disclaimer notices */
.disclaimer-notice {
    border: 2px solid #f59e0b;
    background-color: #fffbeb;
}

.disclaimer-notice h4 {
    color: #92400e;
}