/* =====================================================================
   Gaia Home Screen app — /my-gaia page + "app mode" chrome.
   Loaded directly by /my-gaia, and injected by assets/js/gaia-app.js on
   every page when Gaia is opened from the Home Screen (html.is-app).
   Brand palette only; radii 8 / 16 / 100px / 50%; tinted layered shadows;
   only transform/opacity animate.
   ===================================================================== */

:root {
    --gapp-ink: #180026;
    --gapp-ink-2: #463351;
    --gapp-forest: #1D4641;
    --gapp-sage: #D4E9CA;
    --gapp-mist: #F3F7FA;
    --gapp-hair: rgba(192, 186, 196, 0.6);
    --gapp-shadow: 0 1px 3px rgba(29, 70, 65, 0.06), 0 4px 16px rgba(29, 70, 65, 0.08);
    --gapp-top-h: 56px;
    --gapp-tabs-h: 64px;
}

/* ---------------------------------------------------------- /my-gaia page */
.mg-page { background: var(--gapp-mist); padding: 48px 0 72px; }
.mg-wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

.mg-hero { text-align: center; margin-bottom: 32px; }
.mg-hero__icon { width: 72px; height: 72px; border-radius: 16px; box-shadow: var(--gapp-shadow); margin-bottom: 16px; }
.mg-eyebrow { font-size: 14px; font-weight: 500; letter-spacing: 0.02em; color: var(--gapp-forest); margin-bottom: 8px; }
.mg-hero h1 {
    font-size: 40px; line-height: 48px; letter-spacing: -0.03em; color: var(--gapp-forest); margin-bottom: 12px;
}
.mg-hero p { color: var(--gapp-ink-2); font-size: 16px; line-height: 1.6; margin: 0 auto; max-width: 520px; }

.mg-card {
    background: #fff; border-radius: 16px; box-shadow: var(--gapp-shadow);
    padding: 24px; margin-bottom: 24px;
}
.mg-account { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mg-account__text { flex: 1 1 240px; }
.mg-account__text b { display: block; font-size: 18px; color: var(--gapp-forest); font-weight: 600; }
.mg-account__text span { color: var(--gapp-ink-2); font-size: 14px; line-height: 1.6; }
.mg-account__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.mg-section-title {
    font-size: 24px; line-height: 32px; letter-spacing: -0.02em; color: var(--gapp-forest);
    margin: 32px 0 16px;
}

.mg-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.mg-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 12px;
    background: #fff; border-radius: 16px; padding: 20px 8px; text-align: center; text-decoration: none;
    box-shadow: var(--gapp-shadow);
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.mg-tile:hover { transform: translateY(-2px); }
.mg-tile:active { transform: scale(0.97); }
.mg-tile:focus-visible { outline: 2px solid var(--gapp-forest); outline-offset: 3px; }
.mg-tile img { width: 64px; height: 64px; object-fit: contain; }
.mg-tile span { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--gapp-ink); }

/* Business tiles use an icon in a sage circle (the families tiles use
   illustrated icons that already include their circle). */
.mg-tile__circle {
    width: 64px; height: 64px; border-radius: 50%; background: var(--gapp-sage);
    display: grid; place-items: center; color: var(--gapp-forest); font-size: 28px;
}
@media (max-width: 420px) {
    .mg-tile__circle { width: 52px; height: 52px; font-size: 24px; }
}
@media (max-width: 767px) {
    .mg-tiles--icons { grid-template-columns: repeat(2, 1fr); }
}

.mg-list { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 16px; box-shadow: var(--gapp-shadow); overflow: hidden; }
.mg-list li + li { border-top: 0.5px solid var(--gapp-hair); }
.mg-list a {
    display: flex; align-items: center; gap: 12px; padding: 16px 20px; text-decoration: none; color: var(--gapp-ink);
    transition: opacity 0.2s ease;
}
.mg-list a:hover { opacity: 0.75; }
.mg-list a:active { opacity: 0.6; }
.mg-list a:focus-visible { outline: 2px solid var(--gapp-forest); outline-offset: -2px; }
.mg-list i { font-size: 20px; color: var(--gapp-forest); width: 24px; text-align: center; }
.mg-list span { flex: 1; font-size: 16px; }
.mg-list small { display: block; color: var(--gapp-ink-2); font-size: 13px; }
.mg-list .bi-chevron-right { font-size: 14px; color: #807388; width: auto; }

.mg-help { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mg-help p { flex: 1 1 240px; margin: 0; color: var(--gapp-ink-2); line-height: 1.6; }
.mg-help b { color: var(--gapp-forest); }

@media (max-width: 767px) {
    .mg-page { padding: 32px 0 56px; }
    .mg-hero h1 { font-size: 32px; line-height: 40px; }
    .mg-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 420px) {
    .mg-tiles { gap: 8px; }
    .mg-tile { padding: 16px 4px; gap: 8px; }
    .mg-tile img { width: 52px; height: 52px; }
    .mg-tile span { font-size: 13px; line-height: 18px; }
    .mg-account__actions, .mg-account__actions .btn, .mg-help .btn { width: 100%; }
}
@media (max-width: 339px) {
    .mg-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* --------------------------------------------------- install prompt card */
.gapp-install {
    display: flex; gap: 16px; align-items: flex-start; text-align: left;
    background: #fff; border: 0.5px solid var(--gapp-hair); border-radius: 16px;
    padding: 20px; box-shadow: var(--gapp-shadow); position: relative;
}
.gapp-install__icon { width: 48px; height: 48px; border-radius: 8px; flex: 0 0 48px; }
.gapp-install__body { flex: 1; min-width: 0; }
.gapp-install__title { display: block; color: var(--gapp-forest); font-size: 16px; margin-bottom: 4px; }
.gapp-install__text { color: var(--gapp-ink-2); font-size: 14px; line-height: 1.6; margin: 0 0 12px; }
.gapp-install__steps { margin: 4px 0 0; padding-left: 20px; color: var(--gapp-ink-2); font-size: 14px; line-height: 1.7; }
.gapp-install__steps b { color: var(--gapp-ink); }
.gapp-share { vertical-align: -3px; color: var(--gapp-forest); }
.gapp-install--compact { margin-bottom: 24px; padding-right: 44px; }
.gapp-install__x {
    position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 50%;
    background: transparent; color: #807388; font-size: 22px; line-height: 1;
    transition: opacity 0.2s ease;
}
.gapp-install__x:hover { opacity: 0.7; }
.gapp-install__x:focus-visible { outline: 2px solid var(--gapp-forest); outline-offset: 2px; }

/* ------------------------------------------- app mode (opened from Home Screen) */
html.is-app #header,
html.is-app #primaryDarkHeader,
html.is-app #footer,
html.is-app #demoBox,
html.is-app #subscribeNewsLetter,
html.is-app .mg-hero,
html.is-app [data-gaia-install],
html.is-app .auth-segment { display: none !important; /* overrides page-level display utilities */ }


html.is-app body {
    padding-top: var(--gapp-top-h);
    padding-bottom: calc(var(--gapp-tabs-h) + env(safe-area-inset-bottom, 0px));
    -webkit-tap-highlight-color: transparent;
}
html.is-app .mg-page { padding-top: 24px; }

.gapp-top {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1040;
    height: var(--gapp-top-h); padding-top: env(safe-area-inset-top, 0px);
    display: flex; align-items: center; gap: 8px; padding-left: 8px; padding-right: 16px;
    background: rgba(255, 255, 255, 0.96); border-bottom: 0.5px solid var(--gapp-hair);
    box-shadow: 0 1px 8px rgba(29, 70, 65, 0.06);
}
.gapp-top__back, .gapp-top__logo {
    width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--gapp-forest);
    display: grid; place-items: center; flex: 0 0 40px; transition: opacity 0.2s ease;
}
.gapp-top__logo img { border-radius: 8px; }
.gapp-top__back:active { opacity: 0.6; }
.gapp-top__back:focus-visible, .gapp-top__logo:focus-visible { outline: 2px solid var(--gapp-forest); outline-offset: 1px; }
.gapp-top__title {
    font-family: "Taviraj", serif; font-weight: 600; font-size: 20px; color: var(--gapp-forest);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.gapp-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
    height: calc(var(--gapp-tabs-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex; background: #fff; border-top: 0.5px solid var(--gapp-hair);
    box-shadow: 0 -2px 12px rgba(29, 70, 65, 0.06);
}
html.is-app .gapp-tabs .gapp-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    color: #807388; text-decoration: none; font-size: 12px; font-weight: 500;
    transition: opacity 0.2s ease;
}
/* Scoped under html.is-app so page-level link colours (e.g. the account
   portal's) can't override the tab states. */
html.is-app .gapp-tabs .gapp-tab:hover { color: var(--gapp-forest); }
html.is-app .gapp-tabs .gapp-tab:active { opacity: 0.6; }
html.is-app .gapp-tabs .gapp-tab:focus-visible { outline: 2px solid var(--gapp-forest); outline-offset: -4px; border-radius: 8px; }
html.is-app .gapp-tabs .gapp-tab.is-active { color: var(--gapp-forest); font-weight: 600; }
html.is-app .gapp-tabs .gapp-tab.is-active svg { stroke-width: 2.2; }

/* Focused step-by-step flows: no app bars (the flow has its own header,
   close button and Back/Continue bar). */
html.is-app.is-app-flow body { padding-top: 0; padding-bottom: 0; }

/* Floating help buttons and toasts sit above the tab bar, not behind it. */
html.is-app .eb-get-help { bottom: calc(var(--gapp-tabs-h) + 16px); }
html.is-app .dn-toast,
html.is-app .omt-toast { bottom: calc(var(--gapp-tabs-h) + 16px + env(safe-area-inset-bottom, 0px)); }

/* The account portal has its own full-height shell: fit it between the bars. */
html.is-app .acct-app { min-height: calc(100vh - var(--gapp-top-h) - var(--gapp-tabs-h)); }
html.is-app .acct-side { top: var(--gapp-top-h); height: calc(100vh - var(--gapp-top-h) - var(--gapp-tabs-h)); }
html.is-app .acct-top { top: var(--gapp-top-h); }

@media (prefers-reduced-motion: reduce) {
    .mg-tile, .mg-list a, .gapp-tab, .gapp-top__back { transition: none; }
}
@media (forced-colors: active) {
    .gapp-tab.is-active { text-decoration: underline; }
}
