/* =====================================================================
   PulseChat — Ghana / Telecel
   Design tokens taken from the GTP Figma. Confirm the exact hex values in
   the Figma inspector and adjust here; every colour is a variable so
   nothing else needs touching.
   ===================================================================== */

:root {
    --gh-bg:            #000000;
    --gh-surface:       #141414;
    --gh-surface-raised:#1E1E1E;
    --gh-header:        #1C1C1C;
    --gh-border:        #2E2E2E;

    --gh-accent:        #F4D03F;
    --gh-accent-hover:  #F7DC6F;
    --gh-accent-ink:    #000000;

    --gh-text:          #FFFFFF;
    --gh-text-muted:    #9A9A9A;
    --gh-text-faint:    #6B6B6B;

    --gh-danger:        #E5484D;
    --gh-danger-bg:     #3A1418;
    --gh-danger-border: #7A2A2E;

    --gh-disabled-bg:   #6E6E6E;
    --gh-disabled-ink:  #3A3A3A;

    --gh-radius:        8px;
    --gh-radius-lg:     14px;

    --gh-font-display:  'Playfair Display', Georgia, 'Times New Roman', serif;

    /* Set from JS to the real rendered header height. Anything that sits
       below the header should use this, never a hardcoded pixel value —
       the preview banner and long brand names both change it. */
    --gh-header-h:      56px;
    --gh-font-body:     -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                        Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--gh-bg);
    color: var(--gh-text);
    font-family: var(--gh-font-body);
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ---------------------------------------------------------------------
   Header
   --------------------------------------------------------------------- */
.gh-header {
    background: var(--gh-header);
    padding: 14px 18px;
    position: sticky;
    top: 0;
    z-index: 20;
}

/* Keeps the logo and menu aligned with the page content instead of being
   pushed to the screen edges on wide displays. */
.gh-header__inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gh-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--gh-text);
}

/* Brand lockup: a single SVG, never recomposed from a square + text */
.gh-brand__logo {
    display: block;
    height: 26px;
    width: auto;
}

.gh-menu {
    background: none;
    border: 0;
    padding: 6px;
    cursor: pointer;
    color: var(--gh-accent);
    line-height: 0;
}

/* ---------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------- */
.gh-main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 28px 18px 40px;
}

.gh-panel {
    width: 100%;
    max-width: 360px;
    background: var(--gh-surface);
    border-radius: var(--gh-radius-lg);
    padding: 26px 22px 24px;
}

.gh-panel__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}

.gh-panel__logo .gh-brand__logo { height: 32px; }

.gh-title {
    font-family: var(--gh-font-display);
    font-weight: 700;
    font-size: 26px;
    text-align: center;
    margin: 0 0 6px;
}

.gh-subtitle {
    font-size: 12.5px;
    color: var(--gh-text-muted);
    text-align: center;
    margin: 0 0 22px;
}

/* ---------------------------------------------------------------------
   Form
   --------------------------------------------------------------------- */
.gh-field { margin-bottom: 16px; }

.gh-label {
    display: block;
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gh-text-muted);
    margin-bottom: 7px;
}

.gh-input-wrap {
    display: flex;
    align-items: center;
    background: var(--gh-surface-raised);
    border: 1px solid var(--gh-border);
    border-radius: var(--gh-radius);
    transition: border-color .15s ease;
}

.gh-input-wrap:focus-within { border-color: var(--gh-accent); }
.gh-input-wrap.is-invalid    { border-color: var(--gh-danger); }

.gh-prefix {
    padding: 0 4px 0 12px;
    color: var(--gh-text-muted);
    font-size: 14px;
    user-select: none;
}

.gh-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--gh-text);
    font-family: inherit;
    font-size: 14px;
    padding: 11px 12px 11px 8px;
    letter-spacing: 0.02em;
}

.gh-input::placeholder { color: var(--gh-text-faint); }

/* Kill the blue autofill wash so the dark theme survives */
.gh-input:-webkit-autofill,
.gh-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--gh-text);
    -webkit-box-shadow: 0 0 0 1000px var(--gh-surface-raised) inset;
    caret-color: var(--gh-text);
}

/* ---------------------------------------------------------------------
   Inline error
   --------------------------------------------------------------------- */
.gh-inline-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--gh-danger-bg);
    border: 1px solid var(--gh-danger-border);
    border-radius: var(--gh-radius);
    padding: 9px 11px;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.35;
    color: #F28A8D;
}

/* display:flex outranks the browser's [hidden] rule, so restate it */
.gh-inline-error[hidden] { display: none; }

.gh-inline-error svg { flex: 0 0 auto; margin-top: 1px; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.gh-btn {
    display: block;
    width: 100%;
    border: 0;
    border-radius: var(--gh-radius);
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, opacity .15s ease;
}

.gh-btn--primary {
    background: var(--gh-accent);
    color: var(--gh-accent-ink);
}
.gh-btn--primary:hover:not(:disabled) { background: var(--gh-accent-hover); }

.gh-btn--secondary {
    background: #FFFFFF;
    color: #000000;
}
.gh-btn--secondary:hover { background: #EDEDED; }

.gh-btn:disabled,
.gh-btn[aria-disabled="true"] {
    background: var(--gh-disabled-bg);
    color: var(--gh-disabled-ink);
    cursor: not-allowed;
}

.gh-btn + .gh-btn { margin-top: 10px; }

.gh-link {
    display: block;
    text-align: center;
    color: var(--gh-accent);
    font-size: 12px;
    text-decoration: underline;
    margin: 14px 0 0;
    background: none;
    border: 0;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
}

.gh-hint {
    text-align: center;
    color: var(--gh-text-muted);
    font-size: 12px;
    margin: 12px 0 10px;
}

/* ---------------------------------------------------------------------
   Profile
   --------------------------------------------------------------------- */
.gh-avatar {
    display: block;
    width: 84px;
    height: 84px;
    margin: 4px auto 20px;
}

.gh-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--gh-surface-raised);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    margin-bottom: 9px;
}

.gh-status__icon { line-height: 0; flex: 0 0 auto; }
.gh-status--ok  .gh-status__icon { color: var(--gh-accent); }
.gh-status--bad .gh-status__icon { color: var(--gh-danger); }

.gh-until {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--gh-text-muted);
    margin: 16px 0 20px;
}

.gh-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
}

.gh-chip--ok  { background: var(--gh-surface-raised); color: var(--gh-text); }
.gh-chip--bad { background: var(--gh-danger); color: #FFFFFF; }

/* ---------------------------------------------------------------------
   Modals
   --------------------------------------------------------------------- */
.gh-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .62);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}

.gh-modal.is-open { display: flex; }

.gh-modal__box {
    position: relative;
    width: 100%;
    max-width: 300px;
    background: var(--gh-bg);
    border: 1px solid var(--gh-accent);
    border-radius: var(--gh-radius-lg);
    padding: 24px 22px 20px;
    text-align: center;
}

.gh-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: 0;
    color: var(--gh-text);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
}

.gh-modal__title {
    font-family: var(--gh-font-display);
    font-weight: 700;
    font-size: 20px;
    margin: 0 0 16px;
}

.gh-modal__icon {
    display: block;
    width: 88px;
    height: 88px;
    margin: 0 auto 14px;
}

.gh-modal__text {
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--gh-text-muted);
    margin: 0 0 18px;
}

/* ---------------------------------------------------------------------
   Accessibility
   --------------------------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--gh-accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------------
   Navigation drawer
   --------------------------------------------------------------------- */
.gh-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 110;
}

.gh-nav-backdrop.is-open { display: block; }

.gh-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 84vw;
    background: var(--gh-surface);
    border-left: 1px solid var(--gh-border);
    z-index: 120;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .22s ease;
}

.gh-nav.is-open { transform: translateX(0); }

.gh-nav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid var(--gh-border);
}

.gh-nav__user { display: flex; align-items: center; gap: 10px; min-width: 0; }

.gh-nav__avatar {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gh-accent);
    color: var(--gh-accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gh-nav__id {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gh-nav__close {
    flex: 0 0 auto;
    background: none;
    border: 0;
    color: var(--gh-text);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}

.gh-nav__list {
    flex: 1;
    list-style: none;
    margin: 10px 0;
    padding: 0;
    overflow-y: auto;
}

.gh-nav__link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: 0;
    border-left: 3px solid transparent;
    color: var(--gh-text);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.gh-nav__link:hover { background: rgba(255, 255, 255, .04); }

.gh-nav__link.is-active {
    border-left-color: var(--gh-accent);
    background: rgba(244, 208, 63, .08);
    color: var(--gh-accent);
}

.gh-nav__foot {
    border-top: 1px solid var(--gh-border);
    padding: 8px 0;
}

/* Legal links sit above the account actions: present but secondary. */
.gh-nav__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 14px 16px;
    border-top: 1px solid var(--gh-border);
}

.gh-nav__legal a {
    color: var(--gh-text-faint);
    font-size: 12px;
    text-decoration: none;
}

.gh-nav__legal a:hover { color: var(--gh-accent); }

/* ---------------------------------------------------------------------
   Shared form controls
   Used by the image and presentation pages. They live here, not in a
   page-specific sheet, because more than one page needs them.
   --------------------------------------------------------------------- */
.gh-field { margin-bottom: 20px; }

.gh-flabel {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gh-text-muted);
    margin-bottom: 8px;
}

.gh-textarea, .gh-select {
    display: block;
    width: 100%;
    background: var(--gh-surface-raised);
    border: 1px solid var(--gh-border);
    border-radius: var(--gh-radius);
    color: var(--gh-text);
    font-family: inherit;
    font-size: 16px;
    padding: 12px 14px;
    outline: 0;
    margin-bottom: 20px;
}

.gh-textarea { min-height: 120px; resize: vertical; }
.gh-textarea:focus, .gh-select:focus { border-color: var(--gh-accent); }
.gh-textarea::placeholder { color: var(--gh-text-faint); }
.gh-select { cursor: pointer; }

.gh-error {
    background: var(--gh-danger-bg);
    border: 1px solid var(--gh-danger-border);
    border-radius: var(--gh-radius);
    padding: 11px 13px;
    color: #F28A8D;
    font-size: 13px;
    margin-bottom: 18px;
}

.gh-error[hidden] { display: none; }

/* ---------------------------------------------------------------------
   Bottom navigation (mobile)
   Coexists with the drawer, as in the main app. Column count comes from
   the partial via --gh-bn-count, so hiding a feature doesn't leave a gap.
   --------------------------------------------------------------------- */
.gh-bottomnav { display: none; }

@media (max-width: 768px) {
    .gh-bottomnav {
        display: grid;
        grid-template-columns: repeat(var(--gh-bn-count, 5), 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        background: rgba(10, 10, 10, .96);
        border-top: 1px solid var(--gh-border);
        padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
        backdrop-filter: blur(10px);
    }

    .gh-bottomnav__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 6px 2px;
        min-width: 0;
        color: var(--gh-text-muted);
        text-decoration: none;
    }

    .gh-bottomnav__item.is-active { color: var(--gh-accent); }

    .gh-bottomnav__item svg { width: 22px; height: 22px; flex: 0 0 auto; }

    .gh-bottomnav__label {
        font-size: 10px;
        font-weight: 500;
        line-height: 1;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Keep page content clear of the bar. Pages that own their bottom edge
       (the chat composer) opt out with .gh-no-bottomnav. */
    body:not(.gh-no-bottomnav) {
        padding-bottom: calc(62px + env(safe-area-inset-bottom));
    }
}

.gh-legal-link {
    text-align: center;
    margin: 18px 0 0;
    font-size: 12px;
}

.gh-legal-link a { color: var(--gh-text-muted); }
.gh-legal-link a:hover { color: var(--gh-accent); }

/* Sign-in pill in the header, shown on the landing page when logged out. */
.gh-header__signin {
    background: var(--gh-accent);
    color: var(--gh-accent-ink);
    font-size: 13px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 999px;
    text-decoration: none;
}

.gh-header__signin:hover { background: var(--gh-accent-hover); }

/* ---------------------------------------------------------------------
   Loading overlay
   Shared by the image, video and presentation pages, so it lives here
   rather than in a single page's sheet.
   --------------------------------------------------------------------- */
.gh-loading {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .88);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.gh-loading.is-open { display: flex; }

.gh-loading__box { text-align: center; padding: 0 20px; }
.gh-loading__box h2 { font-size: 18px; margin: 0 0 6px; }
.gh-loading__box p  { color: var(--gh-text-muted); font-size: 13px; margin: 0; }

.gh-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(244, 208, 63, .2);
    border-top-color: var(--gh-accent);
    border-radius: 50%;
    animation: ghImgSpin 1s linear infinite;
    margin: 0 auto 18px;
}

@keyframes ghImgSpin { to { transform: rotate(360deg); } }