/* ⚠️ GENERATED FILE — Run `npm run build:css` to regenerate from static/src/style.css. */
/* ==================== Design tokens ==================== */

:root {
    /* Typography */
    --font-family-base: 'Figtree', sans-serif;
    --font-family-heading: 'Gelasio', serif;
    --font-weight-regular: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-size-base: 1rem;
    --line-height-base: 1.5;

    /* Spacing scale */
    --space-0: 0;
    --space-1: 0.25rem;
    --space-1-25: 0.3125rem;
    --space-1-5: 0.375rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border radii */
    --radius-none: 0;
    --radius-xs: 0.25rem;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-pill: 2rem;

    /* Color palette */
    --color-black: #000;
    --color-white: #fff;
    --color-blue-500: #44C4DD; /* theme blue */
    --TR-SKY: var(--color-blue-500); /* Alias to theme sky blue */
    --color-red-500: #FF3030; /* theme red */
    --color-gray-50: #f9fafb;
    --color-gray-75: #f8f8f8;
    --color-gray-100: #edf2f7;
    --color-gray-150: #ced4da;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-350: #ccc;
    --color-gray-400: #888;
    --color-gray-500: #495057;
    --color-gray-700: #374151; /* gray-700 */
    --color-gray-800: #333;
    --color-gray-850: #222;
    --color-gray-900: #1f2937; /* gray-900 */
    --color-focus-ring: rgba(66, 153, 225, 0.6);
    --color-blue-500-alpha-25: rgba(68, 196, 221, 0.25);
    --color-glass-surface: rgba(255, 255, 255, 0.6);
    --color-glass-border: rgba(255, 255, 255, 0.4);
    --glass-border-shade: rgba(0, 0, 0, 0.15);
    --color-pencil-stroke: rgba(0, 0, 0, 0.1);
    --color-gold-soft: rgba(247, 247, 11, 0.15);
    --color-gold-border: rgba(247, 247, 11, 0.6);
    --color-overlay: rgba(0, 0, 0, 0.5);
    --color-overlay-light: rgba(255, 255, 255, 0.9);

    /* Chart brand tokens (match Affordability exactly) */
    --color-sipp: #44C4DD;
    --color-isa: #F7F70B;
    --color-taxable: #000000;
    --color-total: #44C4DD;

    /* Shadows */
    --shadow-soft: 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-raised: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-card-subtle: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-panel: 0 2px 5px rgba(0, 0, 0, 0.1);
    --shadow-outer-lg: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-button-hover: 0 6px 12px rgba(0, 0, 0, 0.15);
    --shadow-button-active: 0 3px 6px rgba(0, 0, 0, 0.2);
    --shadow-focus: 0 0 0 3px var(--color-focus-ring);
    --shadow-focus-subtle: 0 0 0 3px var(--color-blue-500-alpha-25);
    --shadow-glass-inset: inset 0 0 0 2px var(--glass-border-shade), inset 0 0 10px var(--glass-border-shade);

    /* Layout metrics */
    --nav-h: 4rem; /* matches navbar height */
    --footer-h: 12rem; /* matches footer height */
    --focus-outline-offset: 2px;
}

:root.dark,
.dark :root {
    --color-sipp: #44C4DD;
    --color-isa: #F7F70B;
    --color-taxable: #000000;
    --color-total: #44C4DD;
}

/* Utility overrides */

/* Allow wider content shells on large displays */
.max-w-screen-2xl {
    max-width: 120rem;
}

/* ==================== Base ==================== */

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

html,
body {
    height: 100%;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-black);
    /* Remove default browser margin to prevent unwanted gaps */
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100svh;
}

/* ==================== Utilities ==================== */

.font-handsc {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-regular);
    font-style: normal;
    color: var(--color-black);
}

.font-gelasio {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-regular);
}

.min-h-svh {
    min-height: 100svh;
}

/* Utility class for links that should use the same sky blue as our charts */
.sky-blue-link {
    color: var(--color-blue-500); /* theme blue */
    transition: color 0.2s ease;
}

.sky-blue-link:hover {
    color: var(--color-blue-500); /* theme blue */
    text-decoration: underline;
}

.text-theme-blue {
    color: var(--color-blue-500);
}

/* ==================== Headings ==================== */

.heading-brand {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-regular);
    letter-spacing: -0.025em;
}

:where(.heading-primary, .header-title) {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-regular);
    letter-spacing: -0.025em;
    color: var(--color-gray-900);
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
    line-height: 1.05;
    font-size: clamp(2.75rem, 6vw, 4.5rem);
}

.heading-secondary {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-regular);
    letter-spacing: -0.025em;
    color: var(--color-gray-900);
    margin-top: var(--space-4);
    margin-bottom: var(--space-3);
    line-height: 1.15;
}

.heading-tertiary {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-regular);
    letter-spacing: -0.025em;
    color: var(--color-gray-900);
    margin-top: var(--space-3);
    margin-bottom: var(--space-2);
    line-height: 1.2;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.text-theme-red {
    color: var(--color-red-500);
}

.focus-ring-theme-blue:focus,
.focus-ring-theme-blue:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-blue-500);
}

/* ==================== Layout ==================== */

/* Shared hero and section background */
.jumbotron-section,
.hero-bg,
.about-bg {
    background-image: url("/static/background.svg"); /* Adjust path as necessary */
    /* Scale the SVG so more detail is visible within the hero. */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Ensure list typography matches paragraph styling on the About page */
.about-bg ul,
.about-bg ol {
    font-family: var(--font-family-base);
    line-height: var(--line-height-base);
}

.about-bg li {
    font-size: 1.5rem;
    line-height: var(--line-height-base);
    font-family: var(--font-family-base);
}

/* Jumbotron Section */
.jumbotron-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    flex-direction: column;
    gap: var(--space-8); /* Adjust as necessary */
    flex: 1;
    min-height: 0;
}

/* Hero section that fills available viewport height */
.hero-balanced {
    min-height: calc(100vh - var(--nav-h) - var(--footer-h));
    min-height: calc(100svh - var(--nav-h) - var(--footer-h));
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Allow hero content wrappers to stretch without forcing FAQ carousels */
.hero-balanced > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

.dashboard-page .hero-balanced {
    min-height: auto;
}

/* Keep the FAQ wrapper flexible without inheriting the hero stretching rules */
.faq-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

.faq-carousel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(var(--space-4), 2vw, var(--space-6));
    width: 100%;
}

/* Ensure login page hero fits within the viewport height */
.login-hero {
    min-height: calc(100vh - var(--nav-h) - var(--footer-h));
}

.login-card .glass-card-content {
    height: auto;
}

.login-card form {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.dashboard-grid {
    flex: 1;
    height: 100%;
}

/* mobile overflow fix */
.faq-wrapper img,
.faq-wrapper video {
    max-width: 100%;
    height: auto;
}

.faq-wrapper .faq-card-content {
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

/* === FAQ article pages === */
.faq-article-page {
    padding-block: clamp(var(--space-8), 6vw, var(--space-14));
}

.faq-article-container {
    width: 100%;
    max-width: 80rem;
    padding-inline: clamp(var(--space-4), 4vw, var(--space-8));
}

.faq-article-card.glass-card {
    max-width: clamp(54rem, 78vw, 68rem);
    margin-left: auto;
    margin-right: auto;
}

.faq-article-content {
    display: flex;
    flex-direction: column;
    gap: clamp(var(--space-5), 2vw, var(--space-7));
    padding: clamp(var(--space-6), 3vw, var(--space-8));
}

.faq-article-body {
    display: flex;
    flex-direction: column;
    gap: clamp(var(--space-4), 1.5vw, var(--space-6));
    max-width: 68ch;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.faq-article-body::after {
    content: "";
    display: block;
    clear: both;
}

.faq-article-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: clamp(var(--space-4), 1.5vw, var(--space-6)) auto;
}

.faq-wrapper pre,
.faq-wrapper code {
    overflow-x: auto;
    word-break: break-word;
}

/* === FAQ Carousel — Canonical (source-of-truth) === */

.faqs-carousel {
    width: 100%;
}

/* Fix: allow controls below cards to be visible on large screens */
@media (min-width: 1024px) {
    .faqs-carousel {
        overflow: visible;
        max-height: none;
    }
}

.faqs-carousel .glass-card {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.faq-carousel {
    width: 100%;
    box-sizing: border-box;
}

/* Track: owns gap; is the scroll container; no horizontal padding on mobile */
.faqs-carousel .faq-carousel {
    --faq-carousel-gap: var(--space-4);
    --faq-gap: var(--faq-carousel-gap);    /* alias maintained for JS helpers */
    --faq-cols: 1;                         /* mobile: one card per view */

    display: flex;
    gap: var(--faq-carousel-gap);
    column-gap: var(--faq-carousel-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;

    padding-left: 0;
    padding-right: 0;

    flex-wrap: nowrap;
    max-width: 100%;
    min-width: 0;
    margin-inline: auto;
    scrollbar-gutter: stable both-edges;
    overscroll-behavior-inline: contain;
}

.faqs-carousel .faq-carousel::-webkit-scrollbar {
    display: none;
}

/* Slides: one per view on small/medium; explicit basis overrides Tailwind flex-none */
.faqs-carousel .faq-slide {
    flex: 0 0 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.faqs-carousel .faq-carousel .faq-slide {
    /* equal widths without relying on tailwind utilities */
    flex: 0 0 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;

    /* no margins that fight gap */
    margin-left: 0;
    margin-right: 0;

    /* snap behaviour */
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.faqs-carousel .faq-card-content {
    width: 100%;
}

/* === FAQ Carousel — Image Normalisation === */
.faqs-carousel .faq-media {
    min-width: 0;
    overflow: hidden;
}

.faqs-carousel .faq-media img,
.faqs-carousel .faq-media picture > img,
.faqs-carousel .faq-media svg {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 639.98px) {
    .faqs-carousel .faq-media img,
    .faqs-carousel .faq-media picture > img,
    .faqs-carousel .faq-media svg {
        max-height: min(42dvh, 64vw);
    }
}

@media (min-width: 1024px) {
    .faqs-carousel .faq-media img,
    .faqs-carousel .faq-media picture > img,
    .faqs-carousel .faq-media svg {
        max-height: none;
    }
}

/* Mobile gutters + snap padding (match values exactly) */
@media (max-width: 639.98px) {
    .faqs-carousel { padding-inline: 1rem; }

    .faqs-carousel .faq-carousel {
        scroll-padding-left: 1rem;
        scroll-padding-right: 1rem;

        /* Critical: remove inter-card gap at 1-up to eliminate any RHS spill/crop */
        gap: 0;
    }
}

@media (--handheld-landscape) {
    .faq-carousel {
        padding: 0;
    }
}

@media (--handheld-portrait) {
    .faq-carousel {
        padding: 0;
    }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .faqs-carousel .faq-carousel {
        --faq-cols: 3;
        gap: var(--faq-carousel-gap);
    }

    .faqs-carousel .faq-slide,
    .faqs-carousel .faq-carousel .faq-slide {
        flex: 0 0 calc((100% - (var(--faq-carousel-gap) * 2)) / 3);
        max-width: calc((100% - (var(--faq-carousel-gap) * 2)) / 3);
    }
}

/* Neutralise any global glass-card max-width inside carousel */
.faqs-carousel .faq-slide.glass-card {
    max-width: none;
}

/* Prevent any nested element from exceeding the slide’s content box */
.faqs-carousel .faq-slide,
.faqs-carousel .faq-slide * {
  max-width: 100%;
}

.text-content,
article,
article h2,
article p {
    text-align: center;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: var(--space-1-5);
}

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-black);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-black);
}

/* Base Styles for Headings and Paragraphs */
h1, h2, h3 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-regular);
    letter-spacing: -0.025em;
    color: var(--color-black);
    margin: var(--space-4) 0;
}

p {
    font-size: 1.5rem;
    line-height: var(--line-height-base);
    color: var(--color-black);
    margin-bottom: var(--space-4);
    font-family: var(--font-family-base);
}

/* Responsive Alignment for Articles on Small Screens */
article ul,
article ol {
    margin: var(--space-4) 0;
    padding-left: var(--space-6);
}

article li {
    margin-bottom: var(--space-2);
    font-size: 1.5rem;
    line-height: var(--line-height-base);
}

article table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-4) 0;
}

article th,
article td {
    padding: var(--space-2);
    text-align: left;
    font-size: 1.5rem;
}

/* Left Align text-based content on large screens */
@media (min-width: 64rem) {
    .text-content,
    article,
    article h2,
    article p {
        text-align: left;
    }
}

/* Responsive Font Sizes for h1 */
h1 {
    font-size: 2.5rem;
}

@media (min-width: 48rem) {
h1 {
    font-size: 3rem;
}
}

@media (min-width: 64rem) {
h1 {
    font-size: 3.5rem;
}
}

/* Responsive Font Sizes for h2 */
h2 {
font-size: 1.8rem;
}

@media (min-width: 48rem) {
h2 {
    font-size: 2.2rem;
}
}

@media (min-width: 64rem) {
h2 {
    font-size: 2.75rem;
}
}

/* Responsive Font Sizes for h3 */
h3 {
    font-size: 1.4rem;
}

@media (min-width: 64rem) {
    h3 {
        font-size: 1.75rem;
    }
}

.contentpara {
    font-size: 1rem;
}

/* Smaller paragraph text for form instructions */
.form-instruction {
    font-size: 1rem;
}

label{
    margin-right: var(--space-1-25);
  }

  .clickable-image {
    cursor: pointer;
    transition: transform 0.2s ease-in-out; /* Removed box-shadow transition */
  }
  
  .clickable-image:hover {
    transform: scale(1.05);
    /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);  <-- This line has been removed */
  }


/* ==================== Components ==================== */

/* Navbar styles */
.navbar {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-bold);
    background-color: var(--color-white); /* Set background color to white */
    color: var(--color-black); /* Set text color */
    border: 1px solid var(--color-gray-200); /* border-gray-200 */
    border-radius: var(--radius-sm); /* rounded */
    padding: var(--space-4);
    box-shadow: var(--shadow-soft); /* shadow */
    margin: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.navbar-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    margin: 0 auto; /* mx-auto */
    padding: 0 var(--space-4); /* px-2 sm:px-4 */
    min-width: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar #mobile-menu a {
    position: relative;
    display: block;
    transition: color 0.25s ease, transform 0.25s ease;
}

@media (min-width: 64rem) {
    .navbar #mobile-menu a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: var(--space-2) var(--space-3);
        border-radius: var(--radius-pill);
        width: auto;
    }

    .navbar #mobile-menu a::after {
        content: "";
        position: absolute;
        left: var(--space-3);
        right: var(--space-3);
        bottom: calc(-1 * var(--space-2));
        height: 2px;
        background-color: var(--color-blue-500);
        opacity: 0;
        transform: scaleX(0);
        transform-origin: center;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .navbar #mobile-menu a:hover,
    .navbar #mobile-menu a:focus-visible {
        color: var(--color-blue-500);
        transform: translateY(-2px);
    }

    .navbar #mobile-menu a:hover::after,
    .navbar #mobile-menu a:focus-visible::after {
        opacity: 1;
        transform: scaleX(1);
    }
}
/* Reset list style for navigation */
nav ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

@layer components {
    nav a:hover {
        color: var(--color-gray-350); /* Optional: Change link color on hover */
    }
}

/* Button styles */
:is(.cta-button, .button-register, .button-login, .dashboard-card-button) {
    font-family: var(--font-family-base);
    border: 2px solid var(--color-black);
    border-radius: var(--radius-lg);
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-raised);
    transition: transform 0.2s, background-color 0.3s, color 0.3s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    margin: var(--space-2) 0;
}

:is(.cta-button, .button-register, .button-login, .dashboard-card-button):hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-button-hover);
}

:is(.cta-button, .button-register, .button-login, .dashboard-card-button):active {
    transform: translateY(0) scale(0.98);
    box-shadow: var(--shadow-button-active);
}

:is(.cta-button, .button-register, .button-login, .dashboard-card-button):focus {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.button-register {
    background-color: var(--color-white);
    color: var(--color-black);
    font-size: clamp(1.125rem, 2vw, 1.5rem);
}

.button-register:hover {
    background-color: var(--color-black);
    color: var(--color-white);
}

.button-login {
    background-color: var(--color-black);
    color: var(--color-white);
    font-size: clamp(1.125rem, 2vw, 1.5rem);
}

.button-login:hover {
    background-color: var(--color-white);
    color: var(--color-black);
}

.dashboard-card-button {
    background-color: var(--color-black);
    color: var(--color-white);
    font-size: clamp(1.125rem, 2vw, 1.5rem);
}

.dashboard-card-button:hover {
    background-color: var(--color-white);
    color: var(--color-black);
}

.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.button-container > :is(.button-login, .button-register) {
    /* Let shared auth buttons size to their content instead of stretching */
    flex: 0 0 auto;
    width: auto;
    max-width: max-content;
    text-align: center;
    align-self: center;
}

@media (min-width: 64rem) {
    .button-container {
        flex-direction: row;
        justify-content: flex-start;
    }
}

.button-center {
    justify-content: center;
}

@media (min-width: 64rem) {
    .button-center {
        justify-content: center;
    }
}

/* Footer styles */
.site-footer {
    font-family: var(--font-family-base);
    background-color: var(--color-black); /* bg-black */
    color: var(--color-white); /* text-white */
    padding: var(--space-12) var(--space-4); /* increased vertical spacing */
    line-height: 1.6;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/*
 * The following rule forced all elements with the `.text-center` class inside
 * the footer to left align on large screens. This conflicted with Tailwind's
 * responsive classes such as `sm:text-right`, causing unexpected text
 * justification. The rule has been commented out so that alignment is handled
 * purely by the utility classes defined in the templates.
 */
/*@media (min-width: 64rem) {
    .site-footer .text-center {
        text-align: left;
    }
}*/

.site-footer .footer-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 100%;
}

@media (min-width: 64rem) {
    .site-footer .footer-container {
        flex-direction: row;
        justify-content: space-between;
    }
}

.site-footer p {
    color: var(--color-white);
}

.site-footer a {
    color: var(--color-white);
    transition: color 0.3s;
    margin-right: var(--space-4); /* mr-4 */
}

.site-footer a:hover {
    color: var(--color-gray-300); /* light gray on hover */
}

input.form-control:-webkit-autofill,
input.form-control:-webkit-autofill:focus,
textarea.form-control:-webkit-autofill,
textarea.form-control:-webkit-autofill:focus,
select.form-control:-webkit-autofill,
select.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--color-gray-900);
    transition: background-color 5000s ease-in-out 0s;
    box-shadow: 0 0 0px 1000px var(--color-glass-surface) inset;
}

.form-row {
    display: flex;
    flex-direction: column;
    position: relative;
    color: var(--color-gray-900);
}

.form-label {
    display: inline-flex;
    align-items: center;
    text-align: left;
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-900);
}

.register-page .form-label {
    justify-content: center;
    text-align: center;
}

.form-label .required-indicator {
    margin-left: 0.25rem;
    color: var(--color-gray-500);
    font-weight: var(--font-weight-regular);
}

.form-control {
    color: var(--color-gray-900);
    background-color: var(--color-glass-surface);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card-subtle);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-clip: padding-box;
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

.form-control::placeholder {
    color: var(--color-gray-500);
    opacity: 0.85;
}

.form-control:focus,
.form-control:focus-visible {
    outline: 2px solid transparent;
    outline-offset: var(--focus-outline-offset);
    border-color: var(--color-blue-500);
    box-shadow: 0 0 0 3px var(--color-blue-500-alpha-25);
}

.form-control[aria-invalid="true"],
.form-control:invalid {
    border-color: var(--color-red-500);
    box-shadow: 0 0 0 3px rgba(255, 48, 48, 0.2);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-red-500) 45%, transparent);
}

.form-control[readonly],
.form-control:read-only,
.form-control[disabled],
.form-control:disabled {
    color: var(--color-gray-500);
    border-color: var(--color-gray-150);
    box-shadow: none;
    background-color: color-mix(in srgb, var(--color-glass-surface) 85%, transparent);
    cursor: not-allowed;
}

.form-help {
    text-align: left;
    color: var(--color-gray-500);
}

.register-page .form-help {
    text-align: center;
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-gray-900);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    column-gap: 0.25rem;
}

.form-error {
    font-weight: 500;
    margin: 0;
    padding: 0;
    color: var(--color-red-500);
    display: flex;
    flex-direction: column;
    row-gap: 0.25rem;
}

.form-error span {
    display: inline-flex;
    align-items: center;
    column-gap: 0.375rem;
}

.form-error span::before {
    content: "!";
    font-weight: var(--font-weight-semibold);
}

/*
 * Preserve the legacy "hidden" toggles used by the interactive plan forms
 * without overriding Tailwind's responsive display utilities elsewhere.
 * These forms live inside the <main> region on pages that set body.plan-page.
 */
.plan-page main .hidden {
    display: none !important;
}

.form-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
    width: 100%;
}

.form-group label {
    display: inline-block;
    margin-bottom: var(--space-2);
    font-size: 1rem;
}

.form-group :is(input, select, textarea) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.form-group input,
.form-group textarea {
    text-align: center;
}

.input-field {
    box-sizing: border-box;
}

@media (min-width: 64rem) {
    .form-group :is(input, select, textarea) {
        max-width: 20rem;
    }
    .form-group input.input-field {
        max-width: 20rem;
    }
    .form-group input.input-3-digits {
        width: 6ch;
    }
    .form-group input.input-6-digits {
        width: 9ch;
    }
    .form-group input.input-9-digits {
        width: 12ch;
    }
}

.form-group-row {
    width: 100%;
}

@media (min-width: 48rem) {
    .form-group-row {
        flex-direction: row;
        align-items: center;
    }
}

.label-tooltip-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    width: 100%;
    gap: 0.5rem;
}

.label-tooltip-container label {
    margin-right: var(--space-2);
    margin-bottom: var(--space-0);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;              /* Ensure overlay spans full viewport width */
    height: 100vh;             /* Cover full screen height on all browsers */
    background: var(--color-overlay); /* Dark overlay to focus attention */
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;           /* Allow scrolling on very tall content */
    /* Include padding in size calculations and avoid horizontal scroll */
    box-sizing: border-box;
    padding: var(--space-8) var(--space-4);         /* Reduce horizontal padding on small screens */
    overflow-x: hidden;
}

/* Modal content */
.modal-content {
    padding: var(--space-6);
    max-width: 31.25rem;
    width: 90%;
    position: relative;
    box-sizing: border-box;
    max-height: 80vh;          /* Allow scrolling for tall content */
    overflow-y: auto;
    overflow-x: auto;         /* Prevent horizontal spillover */
    background: var(--color-white);         /* Opaque background for modal content */
}

/* Shared frosted glass surface styling */
.modal-content.glass-card,
.glass-card-content,
.glass-border,
.dashboard-card-content,
.faq-card-content {
    background-color: var(--color-glass-surface);
    box-shadow: var(--shadow-glass-inset);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--color-glass-border);
    border-radius: inherit;
    background-clip: padding-box;
}

/* Preserve modal-specific sizing for glass-styled content */
.modal-content.glass-card {
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 31.25rem;
    overflow-x: auto;
}


.modal-content h2 {
    margin-top: 0;
}

.modal-close {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: none;
    border: none;
    font-size: 2rem;        /* Larger close icon for better visibility */
    line-height: 1;
    cursor: pointer;
    color: var(--color-gray-800);
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--color-black);
}

.modal.active {
    display: flex;
}

/* Ensure modal text and tables have consistent spacing */
.modal-content p {
    margin-bottom: var(--space-3);
    text-align: left;
}

.modal-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: var(--space-4) 0;
    word-break: break-word;
}

.modal-content th,
.modal-content td {
    padding: var(--space-2);
    text-align: left;
    word-break: break-word;
}

/* Media query for optimizing modal sizing on small screens */
@media (max-width: 40rem) {
    .modal-content {
        padding: var(--space-4);         /* Reduce padding on small screens */
        max-width: 95%;        /* Allow content to take nearly full width */
        max-height: 80vh;       /* Limit modal height to prevent overflow */
    }
    .modal-content.glass-card {
        width: 100%;
        max-width: 95%;
    }
}

/* Widen modals on large screens */
@media (min-width: 64rem) {
    .modal-content {
        max-width: 43.75rem;      /* Provide a roomier modal on big displays */
    }
    .modal-content.glass-card {
        max-width: 43.75rem;
    }
}

.help-text-button {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-red-500);            /* theme red */
    display: inline-flex;
    cursor: pointer;
    align-items: center;
    margin-left: 0.5rem;
    vertical-align: middle;
    line-height: 1;
}

.help-text-button:focus {
    outline: 2px solid var(--color-blue-500); /* theme blue */
    outline-offset: var(--focus-outline-offset);
}

.help-text-button img {
    display: block;
    height: 1rem;
    width: 1rem;
}

.help-text-button i {
    color: var(--color-red-500);        /* theme red */
    font-size: 1.25rem;
    line-height: 1;
}

/* Help text */
.help-text {
    display: block;
    list-style-position: outside;
    color: var(--color-gray-400);
    font-size: 0.9em;
}


/* FAQ items (within each timeline event) */
.faq-item {
    margin-bottom: var(--space-6);
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card-subtle);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

/* Hide native marker for details element */
details summary::-webkit-details-marker {
display: none;
}

/* Add a small arrow to summary text */
details summary {
    list-style: none;
    cursor: pointer;
    position: relative;
    padding-right: var(--space-6); /* space for arrow */
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-700); /* gray-700 */
    transition: color 0.2s ease;
}

details summary:after {
    content: "\25BC";
    position: absolute;
    right: 0;
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

details summary:hover {
    color: var(--color-gray-900); /* gray-900 */
}

details[open] summary:after {
transform: rotate(-180deg);
}

details[open] summary {
    color: var(--color-blue-500); /* theme blue */
}
/* Styles only for article pages */
body.article-page {
    font-family: var(--font-family-base);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-black);
    background-color: var(--color-gray-75);
}

/* Support pages where the article itself has the article-page class */
article.article-page {
    font-family: var(--font-family-base);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-black);
    /* Background handled in the shared card styles below to keep a single surface color */
}
  
/* Shared card styles give both entry points the same surface treatment */
body.article-page article,
article.article-page {
  max-width: 50rem;
  margin: var(--space-8) auto;
  padding: var(--space-6);
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
}

body.article-page article h2,
article.article-page h2 {
  font-size: 1.75rem;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  color: var(--color-gray-850);
}

body.article-page article h3,
article.article-page h3 {
    font-weight: var(--font-weight-semibold);
}

body.article-page article p,
article.article-page p {
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

body.article-page article ul,
article.article-page ul {
  margin: var(--space-4) 0;
  padding-left: var(--space-6);
}

body.article-page article li,
article.article-page li {
  margin-bottom: var(--space-2);
  font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 40rem) {
body.article-page article,
article.article-page {
    margin: var(--space-4);
    padding: var(--space-4);
}

body.article-page article h2,
article.article-page h2 {
    font-size: 1.5rem;
}

body.article-page article p,
body.article-page article li,
article.article-page p,
article.article-page li {
    font-size: 1rem;
}
}

/* Frosted glass card effect */
.glass-card {
  background-color: transparent;
  box-shadow: none;
  border: none;
  border-radius: 1rem;
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}

/* FAQ carousel must not clip horizontally — allow full card to render at snap */
.faqs-carousel .glass-card {
  overflow-x: visible;
  /* If a global overflow:hidden is set, neutralise fully on the carousel cards */
  overflow-y: visible;
}

.glass-card:not(.faq-slide) {
  max-width: 50rem;
  margin-left: auto;
  margin-right: auto;
}

.glass-card-content {
    box-sizing: border-box;
}

.glass-card-content > * {
    max-width: 100%;
}

.glass-card-content > :where(p,
        ul,
        ol,
        dl,
        blockquote,
        table,
        form,
        .text-content,
        .dashboard-card-content,
        .faq-card-content,
        .form-group,
        .chart-container,
        .w-full) {
    width: 100%;
}

.glass-card h2,
.modal-content.glass-card h2 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-regular);
    letter-spacing: -0.025em;
    color: var(--color-gray-900);
    margin-bottom: var(--space-3);
    margin-top: 0;
}

.modal-content.glass-card h2 {
    font-family: var(--font-family-heading);
}

.glass-card h3,
.modal-content.glass-card h3 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-regular);
    letter-spacing: -0.025em;
    color: var(--color-gray-900);
    margin-bottom: var(--space-2);
    margin-top: 0;
}

.modal-content.glass-card h3 {
    font-family: var(--font-family-heading);
}

.glass-card-content img:not(.dashboard-card-image),
.glass-card-content svg,
.modal-content.glass-card img,
.modal-content.glass-card svg {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}


/* Border helper for glass surfaces */
.glass-border {
  border-radius: var(--radius-xl);
}

/* Optional outer shadow for glass cards */
.glass-border-shadow {
  box-shadow:
    var(--shadow-outer-lg),
    inset 0 0 0 2px var(--glass-border-shade),
    inset 0 0 10px var(--glass-border-shade);
}
/* Light sketch-style cross-hatched background */
.pencil-bg {
  background-image:
    repeating-linear-gradient(45deg, var(--color-pencil-stroke) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(-45deg, var(--color-pencil-stroke) 0 1px, transparent 1px 5px);
}

/* Dashboard and FAQ cards need to grow with their content */
.dashboard-card-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    height: auto;
    max-height: 100%;
    overflow-y: auto;
}

.dashboard-card-heading {
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
    font-size: clamp(1.9rem, 3.6vw, 2.5rem);
}

.dashboard-card-image-link {
    display: inline-block;
    margin-inline: auto;
    outline: none;
}

.dashboard-card-image-link:focus,
.dashboard-card-image-link:focus-visible {
    outline: none;
}

.dashboard-card-image-link:hover .dashboard-card-image,
.dashboard-card-image-link:focus-visible .dashboard-card-image {
    transform: scale(1.05);
}

.dashboard-card-footer {
  margin-top: auto;
  padding-top: var(--space-4);
  padding-bottom: var(--space-3);
  display: flex;
  justify-content: center;
  width: 100%;
}

.dashboard-card-image {
    height: clamp(5.5rem, 7vw, 7rem);
    width: auto;
    max-width: clamp(5.5rem, 7vw, 7rem);
    object-fit: contain;
    display: block;
    margin-inline: auto;
    transition: transform 0.2s ease;
}

.dashboard-card-heading .interactive-heading-link {
    display: inline-block;
    color: inherit;
    text-decoration: none;
    outline: none;
    box-shadow: none;
    transition: color 0.2s ease, font-size 0.2s ease;
}

.dashboard-card-heading .interactive-heading-link:focus,
.dashboard-card-heading .interactive-heading-link:focus-visible {
    outline: none;
    box-shadow: none;
}

.dashboard-card-heading .interactive-heading-link:hover,
.dashboard-card-heading .interactive-heading-link:focus-visible {
    color: var(--color-blue-500);
    font-size: 1.05em;
}

.faq-card-content {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Narrower width for pages displaying two glass cards */
.glass-card.double-card {
  max-width: 35rem;
}

/* Full-width glass cards for plan pages with charts */
.glass-card.wide-card {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Ensure direct content fits within glass card boundaries */
.glass-card > * {
  box-sizing: border-box;
  max-width: 100%;
}

/* Prevent chart canvases from overflowing the card */
.glass-card canvas {
  max-width: 100%;
}

/* Shared layout for carousel glass cards */
.glass-card.faq-slide {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
}

/* FAQ slide cards inherit their width from the flex basis so they align with the carousel track */
.glass-card.faq-slide {
  width: auto;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  height: clamp(28rem, 80vh, 36rem);
}

/* Full-width adjustment for the static dashboard card */
.glass-card.dashboard-card {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* FAQ grid styling */
.faq-item summary {
  font-family: var(--font-family-heading);
}

.faq-image {
  border-radius: var(--radius-md);
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center top;
}

/* === Carousel Controls (canonical) === */
.carousel-controls {
  /* Layout handled in template with Tailwind */
}

.carousel-controls .carousel-prev,
.carousel-controls .carousel-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 1px solid var(--TR-SKY);
  background: transparent;
  color: var(--TR-SKY);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.carousel-controls .carousel-prev:hover,
.carousel-controls .carousel-next:hover {
  background: color-mix(in oklab, var(--TR-SKY) 12%, transparent);
  transform: translateY(-1px);
}

.carousel-controls .carousel-prev:disabled,
.carousel-controls .carousel-next:disabled,
.carousel-controls .carousel-prev[aria-disabled="true"],
.carousel-controls .carousel-next[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.carousel-controls .carousel-prev:focus-visible,
.carousel-controls .carousel-next:focus-visible {
  outline: 2px solid var(--TR-SKY);
  outline-offset: 2px;
}

.carousel-controls .carousel-pagination {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.carousel-controls .carousel-pagination .dot,
.carousel-controls .carousel-pagination .swiper-pagination-bullet {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: rgba(68, 196, 221, 0.32);
  background: color-mix(in oklab, var(--TR-SKY) 32%, transparent);
  opacity: 0.7;
  transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.carousel-controls .carousel-pagination .dot:hover,
.carousel-controls .carousel-pagination .swiper-pagination-bullet:hover {
  opacity: 0.95;
  transform: scale(1.08);
}

.carousel-controls .carousel-pagination .dot.is-active,
.carousel-controls .carousel-pagination .swiper-pagination-bullet-active {
  background-color: var(--TR-SKY);
  background: var(--TR-SKY);
  opacity: 1;
  transform: scale(1.15);
}

.dark .carousel-controls .carousel-prev,
.dark .carousel-controls .carousel-next {
  box-shadow: none;
}

.dark .carousel-controls .carousel-prev:hover,
.dark .carousel-controls .carousel-next:hover {
  background: color-mix(in oklab, var(--TR-SKY) 20%, transparent);
}

/* Toggle Switch */
.toggle-row {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
}

.toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.toggle-input:focus-visible {
    outline: none;
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    color: inherit;
    font-size: 0.95rem;
    line-height: 1;
}

.toggle-row.items-start .toggle-label {
    margin-top: 0.125rem;
}

.ui-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 9999px;
    background-color: var(--color-gray-350);
    box-shadow: inset 0 0 0 1px var(--color-gray-200);
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.ui-toggle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0.125rem;
    transform: translate(0, -50%);
    border-radius: 9999px;
    background-color: var(--color-white);
    width: 1rem;
    height: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s ease-in-out;
    will-change: transform;
}

.ui-toggle--sm {
    width: 2.5rem;
    height: 1.25rem;
    padding: 0.125rem;
}

.ui-toggle--md {
    width: 3rem;
    height: 1.5rem;
    padding: 0.125rem;
}

.ui-toggle--md::before {
    width: 1.25rem;
    height: 1.25rem;
}

.ui-toggle--lg {
    width: 3.5rem;
    height: 2rem;
    padding: 0.25rem;
}

.ui-toggle--lg::before {
    width: 1.75rem;
    height: 1.75rem;
    left: 0.25rem;
}

.toggle-row .ui-toggle {
    flex-shrink: 0;
}

.peer:checked + .ui-toggle {
    background-color: var(--color-blue-500);
}

.peer:checked + .ui-toggle::before {
    transform: translate(1.25rem, -50%);
    /* Default travel for sm size: (40px track - 16px thumb - 4px padding) = 20px */
}

.peer:checked + .ui-toggle.ui-toggle--md::before {
    transform: translate(1.5rem, -50%);
    /* (48px track - 20px thumb - 4px padding) = 24px travel */
}

.peer:checked + .ui-toggle.ui-toggle--lg::before {
    transform: translate(1.25rem, -50%);
    /* (56px track - 28px thumb - 8px padding) = 20px travel */
}

.toggle-row:focus-within .ui-toggle {
    box-shadow: inset 0 0 0 1px var(--color-gray-200), 0 0 0 2px var(--color-blue-500);
}

/* ==================== Overrides ==================== */

@media (min-width: 96rem) {
    .dashboard-grid {
        align-items: start;
        /* Allow both the welcome section and carousel to take up more space on very wide screens */
        max-width: 120rem;
        margin-left: auto;
        margin-right: auto;
    }

    .dashboard-grid > div:first-child {
        max-width: 100%;
    }
}

