* {
    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;
}

/* A LINK wearing the button (`<a class="cta-button">`, "Go to sign in").
 * `.auth-container a` above outranks `.cta-button` on specificity, so without
 * this the label takes the link's green — green on a green button, i.e. a
 * blank slab. It also has to be told to be a block: `.auth-container button`
 * gives real buttons their width and top margin, and an anchor is not one. */
.auth-container a.cta-button,
.auth-container a.cta-button:hover {
    display: block;
    width: 100%;
    margin-top: 20px;
    text-align: center;
    color: #ffffff;
    text-decoration: none;
}

/* The quiet second action under the main one — "Start over", "Back to sign
 * in", "Cancel". Some are links and some are POST buttons (Start over flushes
 * the session), so both spellings are made to look like ONE thing: the
 * sign-in page's own "Forgot your password?" (owner, 2026-09-17) — plain
 * green text, LEFT-aligned under the button, never centred, never a slab. */
.auth-container .auth-secondary {
    display: block;
    width: auto;
    margin: 16px 0 0;
    padding: 0;
    border: none;
    background: none;
    color: #228B22;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.auth-container .auth-secondary:hover {
    text-decoration: underline;
}

/* Whatever follows a form sits clear of its button. */
.auth-container form + p,
.auth-container form + details {
    margin-top: 16px;
}

.auth-container summary {
    color: #228B22;
    cursor: pointer;
}

/* `hidden` must win. `.auth-error` and friends set `display`, and an author
 * `display` beats the browser's own `[hidden] { display: none }` — which
 * would leave an empty red paragraph holding its margin open. */
.auth-container [hidden] {
    display: none !important;
}

/* "or use your password" — between the passkey button and the form. */
.auth-container .auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    font-size: 0.9rem;
    color: #666666;
}

.auth-container .auth-divider::before,
.auth-container .auth-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid #dddddd;
}

.auth-container .auth-note {
    font-size: 0.9rem;
    color: #666666;
}

/* Django's own per-field error list (`form.as_p`). Red, unbulleted, and
 * tight to the field BELOW it — as_p prints it above the field it is about,
 * and at body colour with a bullet it read as a note on the field above. */
.auth-container ul.errorlist {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
    color: #b00020;
}

/* Sign Up lists every error once, at the top, by field name. */
#signup-form ul.errorlist {
    display: none;
}

.auth-container .auth-error {
    display: block;
    margin-top: 4px;
    color: #b00020;
}

.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 */
}

/* A disabled button has to LOOK disabled. Until this rule there was none, so
 * "Resend link (18s)" counted down in full live green, and Sign Up before the
 * terms box is ticked looked pressable. `transform` is pinned because
 * base.html's hover script scales every .cta-button inline. */
.cta-button:disabled,
.cta-button:disabled:hover {
    background-color: #a9b8a9;
    color: #f4f4f4;
    box-shadow: none;
    cursor: not-allowed;
    transform: none !important;
}

/* 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: 767px) {
    .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;
}

/* ---------------------------------------------------------------------------
 * Card headers on the narrowest phone (<400px)
 *
 * A card's BODY is scaled all over the site — the table ladders, the
 * `.card-footnote` ladder below, a page's own @media block. Its HEADER was
 * not: Bootstrap's h5 is a flat 1.25rem at every width, so at the smallest
 * breakpoint the title (plus its leading Bootstrap icon, and the buttons
 * opposite it) overruns the header and wraps.
 *
 * FLAT, not a ladder, and deliberately: the header reads correctly at every
 * width above this one — only the 399px rung is too big. One step down at
 * one breakpoint, so nothing changes on a tablet or a desktop.
 *
 * All six heading levels are named because headers are not uniform — h5 is
 * the convention (`<h5 class="mb-0">`), h4 appears, and a page whose card
 * title is the document title uses `<h1 class="h4 mb-0">`. Naming the
 * ELEMENT beats the `.h4` utility on specificity, which is what makes that
 * last case scale with the rest. The icon inside is sized in `em`, so it
 * follows its heading with no rule of its own.
 *
 * `.btn` rather than `.btn-sm`: every header button today is `btn-sm` (the
 * page hamburgers and every chat card's `*_header_actions.html`), and this
 * way one that is not still scales.
 * ------------------------------------------------------------------------- */
@media (max-width: 399px) {
    .card-header {
        padding: 0.5rem 0.75rem;
    }

    .card-header h1,
    .card-header h2,
    .card-header h3,
    .card-header h4,
    .card-header h5,
    .card-header h6 {
        font-size: 1rem;
    }

    .card-header .btn {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

/* ---------------------------------------------------------------------------
 * 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; }
}
