/*
 * Brand colors and dashboard-wide layout tweaks for the shared layout (main_dashboard.php).
 *
 * Brand colors come from the --brand-* variables the layout prints from protected/config/brands.php.
 * The website-derived rules in site-base.css / site-custom.css use those variables directly.
 */

/* ---- dashboard links and form errors (the website's locationiq-bootstrap-custom.css used to set these; it only targeted Bootstrap 2 and is no longer loaded) ---- */

.bootstrap-dashboard a,
.bootstrap-dashboard a:hover {
    color: var(--brand-primary-alt, #ff5c5c);
}

div .errorMessage {
    color: #e74c3c;
    margin-top: 5px;
}


/* ---- signed-in pages: tinted header, warm off-white page ---- */
/* Login and signup keep the tinted banner; once signed in, content sits on a near-white page so white cards stand out and charts stay readable. */

.signed-in .price-inner-banner {
    background-color: #fcfbf9;
}

.signed-in #header {
    background: var(--brand-tint, #fff4f4);
}

/* Account menu (first name + caret) in the signed-in header: looks like the other header links */
#header .header-account summary {
    align-items: center;
    color: var(--heading-font-color, #2e3c40);
    cursor: pointer;
    display: flex;
    font-size: 14px;
    font-weight: 700;
    gap: 6px;
    letter-spacing: 1px;
    padding: 10px 0;
    white-space: nowrap;
}
/* Generic person icon (not an avatar: there's no profile picture to show) */
#header .header-account summary::before {
    background-color: currentColor;
    content: "";
    flex: 0 0 auto;
    height: 18px;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='8' cy='5.5' r='2.75'/%3E%3Cpath d='M2.75 13.75c.6-2.6 2.75-4 5.25-4s4.65 1.4 5.25 4'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='8' cy='5.5' r='2.75'/%3E%3Cpath d='M2.75 13.75c.6-2.6 2.75-4 5.25-4s4.65 1.4 5.25 4'/%3E%3C/svg%3E") center / contain no-repeat;
    width: 18px;
}
/* Long first names stop at ~12 characters with an ellipsis; the menu shows the full name */
#header .header-account-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}
#header .header-account summary:hover {
    color: var(--brand-primary, #ff4747);
}
#header .header-account .ui-menu {
    letter-spacing: 0;
    max-width: 300px;
    min-width: 220px;
}
#header .header-account-who {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    gap: 2px;
    padding: 6px 10px 4px;
}
#header .header-account-who strong {
    color: var(--ui-ink, #2a251f);
    overflow-wrap: anywhere;
}
#header .header-account-who span {
    color: var(--ui-muted, #5a534a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- footer: straight on every page, pinned to the bottom ---- */
/* The website footer's skewed top edge overlapped page content, and on tall screens the footer floated
   mid-window. Every dashboard page now has a straight footer at the bottom of a full-height page; the
   .footer-spacer in main_dashboard.php takes up the slack. Page banners keep their own slanted edge. */

#wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Login/signup: room for the banner's slanted edge before the footer */
.footer-spacer {
    flex: 1 0 160px;
}

#wrapper > #footer {
    margin-top: 0;
    position: relative;
    z-index: 2;
}

#footer::before,
.footer-container::before {
    content: none;
    display: none;
}

#footer {
    border-top: 1px solid #e3e8ea;
}

/* The footer is just the legal/links row (no signup band); its own top border is the only edge */
#footer .footer-stripe-container {
    border-top: 0;
    padding-top: 0;
}

#footer .footer-stripe-container .last-footer {
    margin-top: 0;
    padding: 22px 0;
}

/* The remaining decorative shape poked above the straight footer edge */
.footer-container::after {
    content: none;
    display: none;
}

/* Signed in: no signup band or decoration, and a near-white page under the footer */
.signed-in #wrapper {
    background-color: #fcfbf9;
}

.signed-in .footer-spacer {
    flex-basis: 48px;
}

/* No white slanted banner edge anywhere: login/signup use the brand tint for the whole page,
   signed-in pages use the near-white page */
.inner-banner::after {
    content: none;
    display: none;
}

body:not(.signed-in) #wrapper {
    background-color: var(--brand-tint, #fff4f4);
}

/* Anything rendered after #wrapper (widgets, iframes) sits on the footer colour, not a white strip */
body {
    background-color: #f2f6f7;
}

.signed-in #footer {
    border-top-color: #e7e1db;
}

.signed-in #footer .last-footer {
    margin-top: 0;
    padding: 22px 0;
}

/* ---- footer link hierarchy: useful links on the right, copyright and legal links quiet on the left ---- */

.last-footer {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 32px;
    justify-content: space-between;
}

.foot-legal {
    align-items: center;
    color: #8a979b;
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 4px 14px;
}

.foot-legal a,
.foot-legal #footer-unwired-link {
    color: #8a979b;
}

.foot-legal a:hover {
    color: #2e3c40;
}

.last-footer .foot-last-link a {
    color: #2e3c40;
    font-size: 13.5px;
    font-weight: 400;
}

.last-footer .foot-last-link a:hover {
    color: var(--brand-primary, #ff4747);
}

/* Keep footer links clear of the fixed Help launcher (Freshworks) in the bottom-right corner */
@media (min-width: 768px) {
    .signed-in #footer .last-footer {
        padding-right: 150px;
    }
}
@media (max-width: 767px) {
    .last-footer {
        justify-content: center;
        text-align: center;
    }
    .foot-legal {
        justify-content: center;
    }
    .signed-in #footer .last-footer {
        padding-bottom: 90px;
    }
}
