* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif; /* Replace Montserrat with Poppins */
}

/* ⭐⭐ THE OTHER HALF OF `viewport-fit=cover` (B-17, 2026-08-26).
 *
 * `base.html` declares `viewport-fit=cover` so that `env(safe-area-inset-*)`
 * stops returning 0 — without the meta the /chat composer's own safe-area
 * padding was a no-op and its send button was cut in half by the home
 * indicator on a real iPhone.
 *
 * ⚠ BUT THE META ALSO LETS EVERY PAGE PAINT INTO THE NOTCH AND THE
 * INDICATOR. These insets are what keeps that from being a regression on
 * pages nobody was thinking about. **The meta and this rule are ONE change;
 * never ship or revert one without the other.**
 *
 * Left/right matter in LANDSCAPE on a notched phone, where the notch eats
 * one edge; bottom is the home indicator. All three resolve to 0 on
 * everything else, so this costs nothing on a desktop, an old phone, or
 * an Android without cutouts.
 *
 * ⚠ A page that sets its own `padding-bottom` on `body` REPLACES this one
 * and must add the inset back — `chat.css` does exactly that for the
 * floating composer's reservation. */
body {
    background-color: #121212;
    color: #ffffff;
    font-weight: 400; /* Default to lighter weight */
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Paper trading global background override */
body.paper-mode-body {
    background-color: #222222; /* fallback behind wallpaper */
    background-image: url("../images/paper_mode_wallpaper.19d155694854.png");
    background-repeat: repeat;
    background-size: auto;
}

/* Optional: keep sections transparent so wallpaper shows through */
body.paper-mode-body section {
    background-color: transparent;
}

h1, h2, h3 {
    font-weight: 600; /* Slightly bold for headings */
    letter-spacing: -0.5px; /* Smooth out jagged appearance */
}

/* Company logo */
.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

/* Auth forms */
.auth-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    color: #333333; /* Add this line to set dark text color */
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333333; /* Add this line */
}

.auth-container form p {
    margin-bottom: 15px;
}

.auth-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333333; /* Add this line */
}

.auth-container input[type="text"],
.auth-container input[type="email"],
.auth-container input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    color: #333333; /* Add this line for input text */
    background-color: #ffffff; /* Ensure input background is white */
}

.auth-container button {
    width: 100%;
    margin-top: 20px;
}

.auth-container p {
    color: #333333; /* Add this line for paragraph text */
}

.auth-container a {
    color: #228B22; /* Link color */
    text-decoration: none;
}

.auth-container a:hover {
    text-decoration: underline;
}

.message {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}


/* Hero Section */
.hero {
    height: 80vh;
    background-image: url("/static/images/hero-dark.acb13ff13513.jpg?text=AI+Investment+Graph");
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    margin-top: 60px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.cta-button {
    background-color: #228B22;
    color: #ffffff;
    padding: 0.75rem 1.5rem; /* Slightly reduced padding for elegance */
    border: none;
    border-radius: 8px; /* More rounded corners */
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Subtle shadow */
}

.cta-button:hover {
    background-color: #1a6b1a; /* Darker green */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Enhanced shadow on hover */
}

/* Section Styling */
section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

section h2 {
    font-size: 2.5rem;
    color: #228B22;
    margin-bottom: 1.5rem;
}

section p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #dddddd;
}

.features {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.feature-item {
    flex: 1;
    min-width: 250px;
    background-color: #1e1e1e;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.steps {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.step img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.testimonial {
    background-color: #1e1e1e;
    color: #ffffff;
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
}

footer {
    background-color: #121212;
    color: #dddddd;
    padding: 2rem;
    text-align: center;
}

footer a {
    color: #228B22;
    text-decoration: none;
}

@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .navbar a {
        padding: 0.5rem;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .cta-button {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
}

/* Ensure Bootstrap modals have readable text on white background */
.modal-content,
.modal-header,
.modal-body,
.modal-footer {
    color: #212529; /* Bootstrap's default body text color */
}

/* Normalize card colors across all pages so headers/bodies are not inverted */
.card {
    background-color: #1e1e1e;
    color: #ffffff;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 0.5rem;      /* rounded corners for the card */
    overflow: hidden;           /* ensure children respect the radius */
}

/* A card must not clip its own dropdown menu.
 * ------------------------------------------
 * The `overflow: hidden` above also clips anything ABSOLUTELY POSITIONED
 * inside the card, and a Bootstrap `.dropdown-menu` is exactly that: Popper
 * positions it against its toggle, so an actions menu taller than the card
 * loses its tail — the LAST items, which by our menu convention is where
 * Delete lives. First reported on /your-accounts/ Card 2 (2026-08-24), where
 * a ~230px menu opened on a Details render barely half that tall.
 *
 * Popper's own flip cannot rescue this: it measures the VIEWPORT, not the
 * clipping ancestor, so it sees room below and never flips the menu upward.
 *
 * `:has()` keeps this to the cards that actually carry a menu — every other
 * card keeps clipping exactly as before. It matches a menu anywhere inside,
 * so both conventions are covered: the header hamburger (Card 2, the
 * manage_goal / manage_strategy / your_plan cards) and the in-body filter
 * menus (the tax cards).
 *
 * Cost is nil for a padded body: `.card-header` and `.card-body` each declare
 * their own corner radii below, and padding keeps content off the corners.
 * A FLUSH (`p-0`) body is the exception — its table would square the bottom
 * corners — so the clip is handed back to it, unless the body is itself what
 * holds the menu. Re-clipping there also keeps that body's scroll context
 * unchanged, which matters: `position: sticky` resolves against the nearest
 * scroll container, and `overflow: hidden` is one. */
.card:has(.dropdown-menu) {
    overflow: visible;
}

.card:has(.dropdown-menu) > .card-body.p-0:not(:has(.dropdown-menu)) {
    overflow: hidden;
}

.card-header {
    background: linear-gradient(90deg, #1a1a1a, #2a2a2a);
    color: white;
    border-bottom: 1px solid #ffffff; /* keep border continuous with outer white border */
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.card-body {
    background-color: #ffffff;
    color: #000000;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* ---------------------------------------------------------------------------
 * Table totals rows — UI standards §6.5
 *
 * Use on a <tr> alongside the matching Bootstrap variant class:
 *   - Grand total:       <tr class="table-primary grand-total">
 *   - Account subtotal:  <tr class="table-active subtotal">
 *
 * Bootstrap supplies the background; these rules add the top-rule separator
 * and weight that the spec calls for.
 * ------------------------------------------------------------------------- */
.grand-total td {
    border-top: 2px solid #0d6efd;
    font-weight: 600;
}

.subtotal td {
    border-top: 2px solid #dee2e6;
    font-weight: 600;
}
/* ---------------------------------------------------------------------------
 * Card footnotes — UI standards §7
 *
 * The small print that sits in a card's bottom corner: the "Status as of"
 * stamp (common/services/as_of.py) and the today's-dollars basis note.
 *
 * It has to be laddered like the table above it, or it doesn't stay small
 * print. Every footnote used to carry a bare inline `font-size: 0.75rem`
 * while the tables scaled down to 0.75 and then 0.65 on a phone — so the
 * note that should whisper ended up set LARGER than the figures it annotates
 * and wrapped across two lines (owner, 2026-08-25; /your-plan card 1 on an
 * iPhone). A `rem` is measured against the root, so nothing about a table's
 * own ladder reaches it: it needs its own rungs, one step below the table's
 * at each width.
 *
 * Use `class="card-footnote"` INSTEAD of an inline font-size — an inline
 * style wins over this file and the ladder silently does nothing.
 * ------------------------------------------------------------------------- */
.card-footnote {
    font-size: 0.75rem;
}

@media (max-width: 991px) {
    .card-footnote { font-size: 0.7rem; }
}

@media (max-width: 575px) {
    .card-footnote { font-size: 0.65rem; }
}

@media (max-width: 399px) {
    .card-footnote { font-size: 0.6rem; }
}
