/* Font styles */
.font-handsc {
    font-family: 'Figtree', sans-serif;
    font-weight: 400;
    font-style: normal;
    color: #000;
}

.font-gelasio {
    font-family: 'Gelasio', serif;
    font-weight: 400;
}

:root {
    --glass-border-shade: rgba(0, 0, 0, 0.15);
    --nav-h: 4rem; /* matches navbar height */
    --footer-h: 12rem; /* matches footer height */
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Figtree', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: #000;
    /* Remove default browser margin to prevent unwanted gaps */
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100svh;
}

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

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

.sky-blue-link:hover {
    color: #44C4DD; /* theme blue */
    text-decoration: underline;
}

/* Jumbotron Section */
.jumbotron-section {
    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;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    flex-direction: column;
    gap: 2rem; /* Adjust as necessary */
    flex: 1;
    min-height: 0;
}

.hero-bg {
    background-image: url("/static/background.svg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

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

/* Allow hero content wrapper to stretch */
.hero-balanced > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

/* Width-constrained wrapper for hero content on larger layouts */
.container-wide {
    width: 100%;
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Vertical spacing utility for full-width sections */
.section-y {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.faq-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

/* Default layout for dashboard hero on mid-sized screens */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .dashboard-grid {
        height: calc(100vh - var(--nav-h) - var(--footer-h));
    }
}

.text-content {
    text-align: center;
  }
  
  @media (min-width: 1024px) {
    .text-content {
      text-align: left;
    }
  }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #edf2f7;
}

::-webkit-scrollbar-thumb {
    background: #000;
}

::-webkit-scrollbar-thumb:hover {
    background: #000;
}

/* Custom Section Background */

.about-bg {
    background-image: url("/static/background.svg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Base Styles for Headings and Paragraphs */
h1, h2, h3 {
    font-family: 'Gelasio', serif;
    font-weight: 400;
    color: black;
    margin: 1rem 0;
}
  
p {
font-size: 1.5rem;
line-height: 1.5;
color: #000;
margin-bottom: 1rem;
font-family: 'Figtree', sans-serif;
}

/* Responsive Alignment for Articles on Small Screens */
article,
article h2,
article p {
text-align: center;
}

article ul,
article ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

article li {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    line-height: 1.5;
}

article table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

article th,
article td {
    padding: 0.5rem;
    text-align: left;
    font-size: 1.5rem;
}

/* Left Align Articles on Large Screens (min-width: 1024px) */
@media (min-width: 1024px) {
article,
article h2,
article p {
    text-align: left;
}
}

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

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

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

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

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

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

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

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

.contentpara {
    font-size: 1rem;
}

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

label{
    margin-right: 5px;
  }

  .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 */
  }


/* Navbar styles */
.navbar {
    font-family: 'Figtree', sans-serif;
    font-weight: bolder;
    background-color: #fff; /* Set background color to white */
    color: #000; /* Set text color */
    border: 1px solid #e5e7eb; /* border-gray-200 */
    border-radius: 0.375rem; /* rounded */
    padding: 1rem;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow */
    margin: 0;
}

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

.navbar-brand {
    display: flex;
    align-items: center;
}
/* Reset list style for navigation */
nav ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

/* Increase navigation link font size on all screens */
nav a {
    font-size: 1.25rem;
}

nav a:hover {
    color: #ccc; /* Optional: Change link color on hover */
}

/* Button styles */
.button-register, .button-login {
    font-family: 'Figtree', sans-serif;
    font-size: 1.5rem; /* Adjust as necessary */
    padding: 0.5rem 1.25rem;
    margin: 0.5rem;
    border: 2px solid #000; /* Adjust color as necessary */
    border-radius: 0.75rem; /* more rounded corners */
    text-decoration: none;
    transition: transform 0.2s, background-color 0.3s, color 0.3s, box-shadow 0.2s;
    cursor: pointer;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button-register {
    background-color: #fff;
    color: #000;
    width: 220px;
    max-width: 220px;
}

.button-login {
    background-color: #000;
    color: #fff;
}

.button-register:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background-color: #000;
    color: #fff;
}

.button-login:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    background-color: #fff;
    color: #000;
}

.button-register:active,
.button-login:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.button-register:focus,
.button-login:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.6);
}

/* Ensure buttons align flush with surrounding text */
.button-container a:first-child {
    margin-left: 0;
}

.button-container {
    display: flex;
    flex-direction: column; /* Stack vertically on small screens */
    justify-content: center;
    align-items: center;
    gap: 1rem; /* Space between buttons */
    width: 100%;
}

@media (min-width: 1024px) {
    /* On large screens align buttons horizontally and match text alignment */
    .button-container {
        flex-direction: row;
        justify-content: flex-start;
    }
    .button-register,
    .button-login {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

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

.button-register i,
.button-login i {
    margin-right: 0.5rem;
}

/* Footer styles */
footer {
    font-family: 'Figtree', sans-serif;
    background-color: #000; /* bg-black */
    color: #fff; /* text-white */
    padding: 3rem 1rem; /* increased vertical spacing */
    line-height: 1.6;
}

/*
 * 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: 1024px) {
    footer .text-center {
        text-align: left;
    }
}*/

footer .footer-container {
    display: flex;
    flex-direction: column; /* Stack sections vertically on narrow screens */
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    footer .footer-container {
        flex-direction: row; /* Restore horizontal layout on wider screens */
    }
}

footer p {
    color: #FFFFFF;
}

footer p.text-lg {
    font-size: 1.125rem; /* text-lg */
    font-weight: 600; /* font-semibold */
}

footer p.mt-2 {
    margin-top: 0.5rem; /* mt-2 */
}

footer a {
    color: #FFFFFF;
    transition: color 0.3s;
    margin-right: 1rem; /* mr-4 */
}

footer a:hover {
    color: #D1D5DB; /* light gray on hover */
}

footer svg {
    height: 1.5rem; /* h-6 */
    width: 1.5rem; /* w-6 */
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


@media (min-width: 1024px) { 
}



.header-title {
    font-family: 'Gelasio', serif;
    font-weight: 400; /* font-semibold */
    margin: 1rem 0; /* m */
    color: black;
    text-align: center;
}


/* Form group */
.form-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1rem;
}

/* Utility class for horizontal form groups */
.form-group-row {
    flex-direction: row;
    align-items: center;
}

.form-group label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    box-sizing: border-box;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 1rem;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #44C4DD; /* theme blue */
    box-shadow: 0 0 0 3px rgba(68, 196, 221, 0.25);
}

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

@media (min-width: 1024px) {
    .form-group input,
    .form-group select,
    .form-group 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;
    }
}

.label-tooltip-container {
    display: flex;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.label-tooltip-container label {
    margin-right: 0.5rem;
    margin-bottom: 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: rgba(0, 0, 0, 0.5); /* 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: 2rem 1rem;         /* Reduce horizontal padding on small screens */
    overflow-x: hidden;
}

/* Modal content */
.modal-content {
    padding: 1.5rem;
    max-width: 500px;
    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: #fff;         /* Opaque background for modal content */
}

/* When glass-card styling is used inside a modal, apply the glass effect
   directly and preserve modal-specific sizing. */
.modal-content.glass-card {
    background-color: rgba(255, 255, 255, 0.6);
    box-shadow:
      inset 0 0 0 2px var(--glass-border-shade),
      inset 0 0 10px var(--glass-border-shade);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 1rem;
    background-clip: padding-box;
    width: 90%;
    max-width: 500px;
    overflow-x: auto;
}


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

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

.modal-close:hover {
    color: #000;
}

.modal.active {
    display: flex;
}

/* Ensure modal text and tables have consistent spacing */
.modal-content p {
    margin-bottom: 0.75rem;
    text-align: left;
}

.modal-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    word-break: break-word;
}

.modal-content th,
.modal-content td {
    padding: 0.5rem;
    text-align: left;
    word-break: break-word;
}

/* Media query for optimizing modal sizing on small screens */
@media screen and (max-width: 640px) {
    .modal-content {
        padding: 1rem;         /* 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 screen and (min-width: 1024px) {
    .modal-content {
        max-width: 700px;      /* Provide a roomier modal on big displays */
    }
    .modal-content.glass-card {
        max-width: 700px;
    }
}

.help-text-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    color: #FF3030;            /* theme red */
    vertical-align: middle;    /* Align icon with text */
    line-height: 1;            /* Better baseline alignment */
}

.help-text-button:focus {
    outline: 2px solid #44C4DD; /* theme blue */
    outline-offset: 2px;
}

.help-text-button img {
    display: block;
    width: 16px;
    height: 16px;
}

.help-text-button i {
    font-size: 1.25rem;    /* Larger icon for readability */
    color: #FF3030;        /* theme red */
    line-height: 1;
}

@media (max-width: 640px) {
    #retiredPlanForm {
        text-align: center;
    }
    .form-group {
        align-items: center;
    }
    .form-group label,
    .form-group input {
        text-align: center;
    }
    .label-tooltip-container {
        flex-direction: row;
    }
    .help-text-button {
        margin-left: 0;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }
    .text-center {
        text-align: center; 
    }
}

.plan-grid-container {
    display: grid;
    position: relative;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (orientation: landscape) and (max-width: 1023px) {
    .plan-grid-container {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

@media (orientation: portrait) and (max-width: 1023px) {
    .plan-grid-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .plan-grid-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas: "a d"
                             "b e"
                             "c f";
        grid-auto-rows: auto;
        align-items: start;
        gap: 1.5rem;
    }
    .a-column {
        grid-area: a;
    }
    .b-column {
        grid-area: b;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .c-column {
        grid-area: c;
    }
    .d-column {
        grid-area: d;
    }
    .e-column {
        grid-area: e;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .f-column {
        grid-area: f;
    }
}

/* Plot Container */
#plotContainer {
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 1024px) {
    #plotContainer {
        border: none;
        box-shadow: none;
    }
}

/* Chart Container */
.chart-container {
    width: 100%;
    max-width: 100%;
    margin: auto;
    padding: 6px;
    box-sizing: border-box;
    min-height: 300px;
    height: auto;
    aspect-ratio: 16 / 9;
}

@media (orientation: landscape) and (max-height: 500px) {
    .chart-container {
        min-height: 200px;
    }
}

@media (orientation: portrait) {
    .chart-container {
        max-width: 100%;
        padding: 8px;
        aspect-ratio: 3 / 4;
    }
}

@media (min-width: 1024px) {
    .chart-container {
        align-items: left;
    }
}



/* Assumptions Section Container */
#assumptionsSectionContainer {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: #f9fafb;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
}

@media (orientation: landscape) and (max-width: 1023px) {
    #assumptionsSectionContainer {
        align-items: flex-start;
        text-align: left;
    }
}

@media (min-width: 1024px) {
    #assumptionsSectionContainer {
        grid-column: 1 / -1;
        margin-top: 0;
        align-items: flex-start;
        text-align: left;
    }
}

/* Recalculate Button */
#assumptionsSectionContainer #calculate-button {
    background-color: #000;
    color: #fff;
    border: none;
    border-radius: 0.25rem;
    padding: 0.75rem 1.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

#assumptionsSectionContainer #calculate-button:hover {
    background-color: #333;
    transform: scale(1.05);
}

/* Help text */
.help-text {
    display: outside;
    color: #888;
    font-size: 0.9em;
}


/* FAQ items (within each timeline event) */
.faq-item {
    margin-bottom: 1.5rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.faq-item:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    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: 1.5rem; /* space for arrow */
    font-weight: 600;
    color: #374151; /* 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: #1f2937; /* gray-800 */
}

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

details[open] summary {
    color: #44C4DD; /* theme blue */
}
/* Default: center text for small screens in both forms */
#desiredSalaryPlanForm h2,
#desiredSalaryPlanForm p,
#retiredPlan h2,
#retiredPlan p,
#nominalIncomePlanForm h2,
#nominalIncomePlanForm p {
  text-align: center;
}

/* On screens 768px and up, left align text in both forms */
@media (min-width: 768px) {
  #desiredSalaryPlanForm h2,
  #desiredSalaryPlanForm p,
  #retiredPlan h2,
  #retiredPlan p,
  #nominalIncomePlanForm h2,
  #nominalIncomePlanForm p {
    text-align: left;
  }
}

/* Styles only for article pages */
body.article-page {
    font-family: 'Figtree', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #000;
    background-color: #f8f8f8;
}

/* Support pages where the article itself has the article-page class */
article.article-page {
    font-family: 'Figtree', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #000;
    background-color: #f8f8f8;
}
  
body.article-page article,
article.article-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

body.article-page article h2,
article.article-page h2 {
  font-size: 1.75rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #222;
}

body.article-page article h3,
article.article-page h3 {
    font-weight: 600;
}

body.article-page article p,
article.article-page p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

body.article-page article ul,
article.article-page ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

body.article-page article li,
article.article-page li {
  margin-bottom: 0.5rem;
  font-size: 16px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
body.article-page article,
article.article-page {
    margin: 1rem;
    padding: 1rem;
}

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;
  max-width: 50rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  overflow-x: hidden;
}

.glass-card-content {
  /* Slightly more opaque for better readability */
  background-color: rgba(255, 255, 255, 0.6);
  /* Coarse pencil-style inner shading */
  box-shadow:
    inset 0 0 0 2px var(--glass-border-shade),
    inset 0 0 10px var(--glass-border-shade);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: inherit;
  background-clip: padding-box;
  display: flex;
  flex-direction: column;
  height: 100%;
}


/* Border and shadow styling without layout rules */
.glass-border {
  /* Slightly more opaque for better readability */
  background-color: rgba(255, 255, 255, 0.6);
  /* Coarse pencil-style inner shading */
  box-shadow:
    inset 0 0 0 2px var(--glass-border-shade),
    inset 0 0 10px var(--glass-border-shade);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 1rem;
  background-clip: padding-box;
}

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

/* Variant without flex and fixed height for plan pages */
.plan-card-content {
  /* Slightly more opaque for better readability */
  background-color: rgba(255, 255, 255, 0.6);
  /* Coarse pencil-style inner shading */
  box-shadow:
    inset 0 0 0 2px var(--glass-border-shade),
    inset 0 0 10px var(--glass-border-shade);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: inherit;
  background-clip: padding-box;
}

/* Dashboard and FAQ cards need to grow with their content */
.dashboard-card-content {
  /* Slightly more opaque for better readability */
  background-color: rgba(255, 255, 255, 0.6);
  /* Coarse pencil-style inner shading */
  box-shadow:
    inset 0 0 0 2px var(--glass-border-shade),
    inset 0 0 10px var(--glass-border-shade);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: inherit;
  background-clip: padding-box;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: auto;
  max-height: 100%;
  overflow-y: auto;
}

.faq-card-content {
  /* Slightly more opaque for better readability */
  background-color: rgba(255, 255, 255, 0.6);
  /* Coarse pencil-style inner shading */
  box-shadow:
    inset 0 0 0 2px var(--glass-border-shade),
    inset 0 0 10px var(--glass-border-shade);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: inherit;
  background-clip: padding-box;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: auto;
  max-height: 100%;
  overflow-y: auto;
}

/* 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%;
}

/* Allow all slides in a Swiper carousel to share height */
.swiper-wrapper {
  display: flex;
  align-items: stretch;
}

/* Narrower FAQ slide cards */
.glass-card.faq-slide {
  width: 100%;
  max-width: 30rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* Reinstate fixed height so FAQ cards remain consistent */
  height: clamp(28rem, 80vh, 36rem);
  box-sizing: border-box;
}

/* Full-width dashboard slide cards that expand with content */
.glass-card.dashboard-slide {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  max-height: 100%;
  box-sizing: border-box;
}

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

/* Consistent logo sizing for dashboard slides */
.dashboard-logo {
  width: clamp(7rem, 11vh, 11rem);
  height: clamp(7rem, 11vh, 11rem);
  object-fit: contain;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}

.dashboard-logo:hover {
  transform: scale(1.05);
}

.dashboard-carousel .swiper-slide h1 a {
  display: inline-block;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}

.dashboard-carousel .swiper-slide h1 a:hover {
  transform: scale(1.05);
}

/* FAQ grid styling */
.faq-item summary {
  font-family: 'Gelasio', serif;
}

.faq-image {
  width: 80%;
  max-width: 260px;
  border-radius: 0.5rem;
  display: block;
  height: auto;
  object-fit: contain;
  object-position: center top;
}

/* Ensure only one dashboard card is visible at a time */
.dashboard-carousel {
  overflow: hidden;
  max-width: 100%;
  padding: 2rem;
  box-sizing: border-box;
}

/* Ensure only one FAQ card is visible at a time */
.faq-carousel {
  overflow: hidden;
  padding: 0 4rem;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
}

@media (orientation: landscape) and (max-width: 1023px) {
  .faq-carousel,
  .dashboard-carousel {
    padding: 0 2rem;
  }
}

@media (orientation: portrait) and (max-width: 1023px) {
  .faq-carousel,
  .dashboard-carousel {
    padding: 0 4rem;
  }
}

@media (min-width: 1024px) {
  .glass-card.dashboard-card {
    max-width: 100%;
  }

  .dashboard-carousel {
    max-width: 100%;
    padding: 2rem;
  }

  .dashboard-carousel .glass-card.dashboard-slide {
    max-width: 100%;
  }

  .faq-carousel {
    padding: 0 4rem;
  }
}

/* Responsive dashboard carousel sizing */
@media (max-width: 640px) {
  .glass-card.dashboard-card {
    width: 100%;
    max-width: 100%;
  }

  .dashboard-carousel {
    width: 100%;
    max-width: 100%;
    padding: 0 4rem;
    box-sizing: border-box;
  }

  .faq-carousel {
    padding: 0 4rem;
  }

  .glass-card.faq-slide,
  .glass-card.dashboard-slide {
    width: 100% !important;
    max-width: 100%;
  }
  .glass-card.dashboard-slide {
    height: clamp(24rem, 80vh, 32rem);
  }

  .faq-image {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .glass-card.faq-slide,
  .glass-card.dashboard-slide {
    padding: 1rem;
  }
}


/* Center content within Swiper slides */
.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: stretch;
  box-sizing: border-box;
}

/* FAQ carousel controls */
.faq-carousel .swiper-button-prev,
.dashboard-carousel .swiper-button-prev,
.faq-carousel .swiper-button-next,
.dashboard-carousel .swiper-button-next {
  color: #44C4DD; /* theme blue */
  background-color: rgba(255, 255, 255, 0.9);
  border: 2px solid #44C4DD;
  border-radius: 9999px;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-carousel .swiper-button-prev,
.dashboard-carousel .swiper-button-prev {
  left: 1rem;
}

.faq-carousel .swiper-button-next,
.dashboard-carousel .swiper-button-next {
  right: 1rem;
}

.faq-carousel .swiper-button-prev::after,
.dashboard-carousel .swiper-button-prev::after,
.faq-carousel .swiper-button-next::after,
.dashboard-carousel .swiper-button-next::after {
  font-size: 1.25rem;
}

.faq-carousel .swiper-pagination,
.dashboard-carousel .swiper-pagination {
  position: relative;
  margin-top: 1.5rem;
}

.faq-carousel .swiper-pagination-bullet,
.dashboard-carousel .swiper-pagination-bullet {
  background-color: #44C4DD;
  opacity: 0.5;
}

.faq-carousel .swiper-pagination-bullet-active,
.dashboard-carousel .swiper-pagination-bullet-active {
  opacity: 1;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 3.5rem;
    height: 1.5rem;
    vertical-align: middle; /* Align switch with surrounding text */
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 2rem;
}

.slider:before {
    position: absolute;
    content: "";
    height: 1.3rem;
    width: 1.3rem;
    left: 0.1rem;
    bottom: 0.1rem;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    z-index: 2;
}

input:checked + .slider {
    background-color: #44C4DD; /* theme blue */
}

input:checked + .slider:before {
    transform: translateX(2rem);
}

.toggle-container {
    display: flex;
    align-items: center;
}

.toggle-label {
    margin: 0 0.5rem;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    line-height: 1.5rem;  /* Match toggle height for better alignment */
    vertical-align: middle;
}

/* Center headings and paragraphs within charts and assumptions on small portrait screens */
@media (max-width: 640px) and (orientation: portrait) {
    #plotContainer h2,
    #plotContainer p,
    #assumptionsSectionContainer h2,
    #assumptionsSectionContainer h3,
    #assumptionsSectionContainer p {
        text-align: center;
    }
}

/* Round blue checkboxes for retired toggles */
#is_retired,
#spouse_is_retired {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid #44C4DD; /* theme blue */
    cursor: pointer;
    position: relative;
}

#is_retired:checked,
#spouse_is_retired:checked {
    background-color: #44C4DD; /* theme blue */
}

/* Container styling for spouse sections */
.spouse-card {
    background: rgba(247, 247, 11, 0.15); /* brighter theme yellow */
    padding: 0.5rem;
    padding-top: 0; /* Remove top padding to align with user column */
    border-radius: 0.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(247, 247, 11, 0.6);
}

/* Hook class used only for JS toggling */
.spouse-field {}

@media (max-width: 768px) {
    .spouse-card {
        order: 1;
    }
}

@media (orientation: landscape) and (max-width: 768px) {
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
        gap: 0;
    }

    .dashboard-carousel {
        padding: 0 1rem;
        max-width: 100vw;
    }

    .dashboard-carousel .swiper-slide,
    .glass-card.dashboard-slide {
        width: 100% !important;
        max-width: 100vw;
    }

    .glass-card.faq-slide {
        width: 100% !important;
        max-width: 90vw;
    }
}

@media (orientation: landscape) and (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 0;
    }
}

@media (min-width: 1536px) {
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
        /* Allow both the welcome section and carousel to take up more space on very wide screens */
        gap: 4rem;
        max-width: 1920px;
        margin-left: auto;
        margin-right: auto;
    }

    .dashboard-carousel {
        padding: 2rem;
    }

    .dashboard-carousel .glass-card.dashboard-slide {
        max-width: 100%;
    }

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

