:root {
    /* Color Palette */
    --brand-primary: #1e3a8a;           /* Indigo-900 */
    --brand-primary-hover: #2d3748;      /* Indigo-800 */
    --brand-primary-focus-ring: rgba(30, 58, 138, 0.25);
    --bg-brand-soft: #eef2ff;            /* Indigo-50 for subtle hover states */
    --brand-secondary: #4b5563;
    --action-primary: #2563eb;          /* Blue-600 */
    --action-primary-hover: #1d4ed8;     /* A slightly darker blue for hover 
    --accent: #F2C94C;                  /* Amber from spec */

    --text-dark: #111827;               /* Gray-900 for headings */
    --text-body: #1f2937;               /* Gray-800 for body text */
    --text-muted: #4b5563;              /* Gray-600 for secondary text */
    --text-light: #6b7280;              /* Gray-500 for captions, footers */
    --text-inverted: #ffffff;           /* White */

    --bg-light: #ffffff;                /* White */
    --bg-soft: #f9fafb;                 /* Gray-50 for page background */
    --bg-medium: #f3f4f6;               /* Gray-100 for section backgrounds */

    --border-color: #e2e8f0;             /* slate-200, a good neutral */
    --border-standard: 1px solid var(--border-color);

    --success: #10B981;
    --error: #EF4444;                   /* --color-danger */
    --error-hover: #dc2626;

    --gradient-start: rgba(30,58,138,0.9);
    --gradient-end: rgba(79,70,229,0.9);
    /* Font Families (From Tax App) */
    --font-family-sans: "Public Sans", "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-family-icons: 'Material Symbols Outlined';

    /* Typography */
    --line-height-base: 1.5;
    --font-size-sm: 0.875rem; /* 14px */
    --font-size-base: 1rem;   /* 16px */
    --font-size-md: 1.125rem; /* 18px */
    --font-size-lg: 1.25rem;  /* 20px */
    --font-size-xl: 1.875rem; /* 30px */
    --font-size-xxl: 2.25rem; /* 36px */

    /* Spacing & Sizing (8-point grid system from spec) */
    --spacing-xs: 0.25rem; /* 4px */
    --spacing-sm: 0.5rem;  /* 8px */
    --spacing-md: 1rem;    /* 16px */
    --spacing-lg: 2rem;    /* 32px */
    --spacing-xl: 4rem;    /* 64px */

    /* Borders & Shadows */
    --border-radius: 4px;
    --box-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --box-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}


/* ==========================================================================
   2. FONT-FACE (Kept from Tax App)
   ========================================================================== */

/* Noto Sans */
@font-face {
    font-family: 'Noto Sans';
    font-style: normal;
    font-weight: 400;
    src: url('/static/fonts/noto-sans-v39-latin-regular.woff2') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Noto Sans';
    font-style: normal;
    font-weight: 500;
    src: url('/static/fonts/noto-sans-v39-latin-500.woff2') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Noto Sans';
    font-style: normal;
    font-weight: 700;
    src: url('/static/fonts/noto-sans-v39-latin-700.woff2') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Noto Sans';
    font-style: normal;
    font-weight: 900;
    src: url('/static/fonts/noto-sans-v39-latin-900.woff2') format('woff2');
    font-display: swap;
}

/* Public Sans */
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 400;
    src: url('/static/fonts/public-sans-v20-latin-regular.woff2') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 500;
    src: url('/static/fonts/public-sans-v20-latin-500.woff2') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 700;
    src: url('/static/fonts/public-sans-v20-latin-700.woff2') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 900;
    src: url('/static/fonts/public-sans-v20-latin-900.woff2') format('woff2');
    font-display: swap;
}

/* Material Icons / Symbols */
@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: url('/static/fonts/material-icons-v143-latin-regular.woff2') format('woff2');
  font-display: block; /* 'block' is preferred for icon fonts */
}
 @font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 400;
    src: url('/static/fonts/material-symbols-outlined-v254-latin-regular.woff2') format('woff2');
    font-display: block;
  }
  @font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 500;
    src: url('/static/fonts/material-symbols-outlined-v257-latin-500.woff2') format('woff2');
    font-display: block;
  }
  @font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 700;
    src: url('/static/fonts/material-symbols-outlined-v257-latin-700.woff2') format('woff2');
    font-display: block;
  }


/* ==========================================================================
   3. GLOBAL RESET & BASE
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-family-sans);
    background-color: var(--bg-soft);
    color: var(--text-body);
    line-height: var(--line-height-base);
    min-height: 100vh;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
    color: var(--text-dark);
}


/* ==========================================================================
   4. LAYOUT & UTILITIES
   ========================================================================== */

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Consolidated Container */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
@media (min-width: 1024px) {
    .container {
        max-width: 1280px;
    }
}

.flex-grow {
    flex-grow: 1;
}

.w-100 {
    width: 100%;
}

/* Material Icons Helper */
.material-icons,
.material-symbols-outlined {
    font-family: var(--font-family-icons);
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: 'liga';
}


/* ==========================================================================
   5. COMPONENTS
   ========================================================================== */

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.625rem 1.25rem;
    font-size: var(--font-size-sm);
    font-weight: 600;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
.btn:hover {
    text-decoration: none;
}
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--bg-light), 0 0 0 4px var(--brand-primary);
}

.btn-primary {
    background-color: var(--action-primary);
    color: var(--text-inverted);
    box-shadow: var(--box-shadow-md);
}
.btn-primary:hover {
    background-color: var(--action-primary-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--brand-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-sm); /* A more subtle shadow than primary */
}

.btn-secondary:hover {
    background-color: var(--bg-medium); /* Faint gray for hover */
    color: var(--text-dark); /* Slightly darken text on hover for emphasis */
    border-color: var(--border-color); /* Ensure border color remains consistent */
}

.btn--inverted {
    background-color: transparent;
    color: var(--text-inverted); /* White text */
    border: 1px solid var(--text-inverted); /* White border */
    box-shadow: none;
}

.btn--inverted:hover {
    background-color: rgba(255, 255, 255, 0.1); /* Subtle white glow on hover */
    color: var(--text-inverted);
    border-color: var(--text-inverted);
}

.btn-danger {
    background-color: var(--error);
    color: var(--text-inverted);
}
.btn-danger:hover {
    background-color: var(--error-hover);
}

.btn-outline {
    background-color: transparent;
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}
.btn-outline:hover {
    background-color: var(--bg-brand-soft);
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
}
.btn-link:hover {
    color: var(--brand-primary);
    text-decoration: underline;
}
.btn-link:focus-visible {
    box-shadow: none;
    outline: 1px dotted;
}

.btn-disabled,
.btn[disabled] {
    background-color: var(--bg-medium);
    color: var(--text-light);
    border-color: transparent;
    box-shadow: none;
    cursor: not-allowed;
}

/* Ensure hover state doesn't change a disabled button */
.btn-disabled:hover,
.btn[disabled]:hover {
    background-color: var(--bg-medium);
    color: var(--text-light);
    border-color: transparent;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    font-size: 0.9em;
    color: var(--text-muted);
}
.form-label .optional-text {
    font-weight: normal;
    font-size: 0.9em;
    color: var(--text-light);
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-body);
    background-color: var(--bg-light);
    background-clip: padding-box;
    border: var(--border-standard);
    border-radius: var(--border-radius);
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.form-control:focus {
    border-color: var(--brand-primary);
    outline: 0;
    box-shadow: 0 0 0 3px var(--brand-primary-focus-ring);
}
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.select-wrapper {
    position: relative;
}
.select-wrapper::after { /* Custom arrow for select */
    content: '\25BC';
    font-size: 12px;
    color: var(--text-light);
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
select.form-control {
    cursor: pointer;
    padding-right: 30px; /* Make space for custom arrow */
}

.form-group-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}
.form-group-checkbox label {
    margin-bottom: 0; /* Override default label margin */
}

/* Form Validation & Messages */
.form-errors {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: 1.25rem;
}
.field-error {
    color: var(--error);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
}
#feedback-form-message.success { color: var(--success); font-weight: bold; }
#feedback-form-message.error { color: var(--error); font-weight: bold; }


/* --- Cards --- */
.card {
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-md);
    padding: var(--spacing-lg);
    width: 100%;
}
.card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.card-header h2 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-sm);
}
.card-header p {
    font-size: var(--font-size-base);
    color: var(--text-muted);
}
.card-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: var(--border-standard);
    font-size: var(--font-size-sm);
    color: var(--text-light);
}


/* --- Modals & Banners --- */
.modal-overlay {
    display: none; /* JS toggles to 'flex' */
    position: fixed;
    z-index: 1000;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
}
.modal-panel {
    position: relative;
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 550px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: fadeInModal 0.3s ease-out;
}
@keyframes fadeInModal {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}
.modal-close-btn:hover,
.modal-close-btn:focus {
    color: var(--text-dark);
}


/* --- Header & Navigation --- */

.header {
    background-color: var(--brand-primary);
    color: var(--text-inverted);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--box-shadow-md);
}

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

.header__title {
    font-size: 1.5rem; /* 24px */
    font-weight: 700;
    color: var(--text-inverted);
    margin: 0;
}

.header__subtitle {
    font-size: 0.875rem; /* 14px */
    color: var(--bg-brand-soft); /* Using a soft color for the subtitle */
    margin: 0;
    font-weight: 400;
}

.header__brand-link {
    display: inline-flex; /* Use inline-flex to keep it contained */
    align-items: center;  /* Vertically align the icon and text */
    gap: 0.75rem;         /* Space between the icon and the text */
    text-decoration: none; /* Remove the default link underline */
    color: inherit;       /* Make the link inherit the header's text color */
}

.header__brand-icon {
    font-size: 2.5rem; /* ~40px - makes the icon prominent */
    color: #a5b4fc;   /* Use the light indigo for a nice accent */
}

/* Optional: Ensure hover states don't change the text color within the brand link */
.header__brand-link:hover .header__title,
.header__brand-link:hover .header__subtitle {
    color: inherit;
}

.footer {
    background-color: var(--brand-primary);
    color: var(--light-text-color);
    padding-top: 3rem;
}

.footer__container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer__brand {
    line-height: 1.3;
}
.footer__title {
    margin: 0;
    font-size: 1.5rem;
    color: var(--bg-brand-soft)
}
.footer__tagline {
    margin: 0;
    color: #ccc;
}

.footer__nav {
    display: flex;
    gap: 1.5rem;
}
.footer__link {
    color: #ccc;
    text-decoration: none;
}
.footer__link:hover {
    color: white;
}

.footer__bottom-bar {
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
    border-top: 1px solid #343a40;
    font-size: 0.9rem;
    color: #ccc;
}


.nav {
    display: flex; /* Adjust for mobile later */
    gap: var(--spacing-lg);
}

.nav__link {
    color: var(--text-inverted);
    font-weight: 500;
    text-decoration: none;
    padding-bottom: 0.25rem; /* Space for the underline */
    position: relative;
    transition: color 0.2s ease-in-out;
}
.nav__link:hover {
    color: #c7d2fe; /* Light indigo for hover */
    text-decoration: none;
}
/* Underline effect from your inspiration */
.nav__link::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--text-inverted);
    transition: width .3s;
    position: absolute;
    bottom: 0;
    left: 0;
}
.nav__link:hover::after {
    width: 100%;
}

.nav__mobile-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    color: var(--text-inverted);
    cursor: pointer;
}
/* Add simple media query for mobile nav button */
@media (max-width: 768px) {
    .nav {
        display: none; /* Hide desktop nav on mobile */
    }
    .nav__mobile-toggle {
        display: block;
    }
}

/* --- Hero Section --- */
.hero-gradient {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: var(--text-inverted);
    padding: var(--spacing-xl) 0;
}