/*  branded.css — design D tokens + the one web font, for the hand-built brand components.
    Shipped from the RCL at: _content/Agilis.Shared/branded.css
    Reference it once from each host app's <head>.

    The two colors a gym chooses (--pb-brand, --pb-accent) and the tints derived from them are
    overridden per gym by <GymTheme>, which writes a :root rule from GymPalette. The values here are
    the Park's, so anything that paints before that rule (the member boot screen) still looks right.
    Everything else is fixed for every gym — see GymPalette for why.
    Mud components don't read these; they read the MudTheme, built from the same palette.          */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,400..800&display=swap');

:root {
    /* Chosen by the gym (overridden by <GymTheme>) */
    --pb-brand:           #22285B;
    --pb-accent:          #C84800;
    --pb-on-brand-muted:  #B4BCDF;
    --pb-heat-1:          #E6EAFD;
    --pb-heat-2:          #BEC8F2;
    --pb-heat-3:          #818ECA;

    /* Fixed (design D §1.1–1.3) */
    --pb-ink:             #121733;
    --pb-ink-2:           #3A3F5C;
    --pb-muted:           #5B6079;
    --pb-canvas:          #F6F7FA;
    --pb-surface:         #FFFFFF;
    --pb-line:            #E4E6EE;
    --pb-line-soft:       #EEF0F5;
    --pb-control-line:    #C9CCDA;
    --pb-focus:           #4C8DFF;

    --pb-on-brand:        #FFFFFF;
    --pb-on-brand-good:   #8EE0B5;
    --pb-on-brand-warn:   #FFC49E;
    --pb-on-brand-line:   rgba(255,255,255,.18);
    --pb-on-brand-fill:   rgba(255,255,255,.10);

    --pb-good:            #1F7A50;
    --pb-warn:            #8A4B00;
    --pb-warn-bg:         #FFF6EA;
    --pb-warn-line:       #EBCB97;
    --pb-warn-ink:        #5A3200;
    --pb-neutral-band:    #9AA0B8;

    /* Older names, kept as aliases so components written before design D follow the gym too */
    --pb-navy:            var(--pb-brand);
    --pb-green:           var(--pb-good);
    --pb-faint:           #8A8FA6;
    --pb-track:           var(--pb-line);

    /* Type: one family at three widths. Wide for headings, normal for reading, condensed for numbers. */
    --pb-font:            'Archivo', system-ui, sans-serif;
    --pb-display:         var(--pb-font);
    --pb-body:            var(--pb-font);

    --pb-radius-brand:    10px;
    --pb-radius-mud:      6px;
}

/*  Mud has no width setting, so the wide headings live here. */
.mud-typography-h1, .mud-typography-h2, .mud-typography-h3,
.mud-typography-h4, .mud-typography-h5, .mud-typography-h6 {
    font-stretch: 112%;
}

@keyframes pb-pulse {
    0%, 100% { opacity: 1;   transform: scale(1);  }
    50%      { opacity: .35; transform: scale(.7); }
}

/*  Sign-in brand panel — the custom left half of the Admin sign-in screen.
    The form on the right is MudBlazor + the scoped SignIn.razor.css.          */

.pb-signin {
    display: flex;
    min-height: 100vh;
}

.pb-signin__brand {
    position: relative;
    flex: 1.15;
    overflow: hidden;
    background: var(--pb-brand);
    padding: 56px 56px 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pb-signin__stripes {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(135deg, rgba(255,255,255,.025), rgba(255,255,255,.025) 2px, transparent 2px, transparent 16px);
}

.pb-signin__glow {
    position: absolute;
    right: -120px;
    top: -120px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--pb-accent) 32%, transparent), transparent 70%);
}

.pb-signin__logo {
    position: relative;
    font: 800 24px var(--pb-display), sans-serif;
    color: #fff;
}
.pb-signin__logo span {
    color: var(--pb-accent);
    letter-spacing: .12em;
}

/* Centred in the space under the logo (auto margins win over the panel's space-between). */
.pb-signin__pitch { position: relative; margin: auto 0; }

.pb-signin__eyebrow {
    font: 700 13px var(--pb-display), sans-serif;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--pb-accent);
}

.pb-signin__headline {
    margin: 14px 0 0;
    font: 800 64px var(--pb-display), sans-serif;
    line-height: .98;
    letter-spacing: -.01em;
    color: #fff;
}

.pb-signin__lede {
    margin: 20px 0 0;
    max-width: 440px;
    font: 400 17px var(--pb-body), sans-serif;
    line-height: 1.55;
    color: #B7BBD2;
}

.pb-signin__form {
    flex: .85;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px;
}

.pb-signin__formInner {
    width: 100%;
    max-width: 380px;
}

@media (max-width: 900px) {
    .pb-signin__brand { display: none; }
}

/* ------------------------------------------------------------------------
   Design D primitives — shared by every D screen. The structural pieces
   (GlanceHeader, StatStrip, Sheet, Panel…) are components with their own
   scoped CSS; these are the small things pages put inside them.
   ------------------------------------------------------------------------ */

/* Phone below 600px (Mud's sm), web from 600px. Content that differs by width
   is rendered once per form and switched here, rather than reshaped in C#. */
@media (max-width: 599.98px) { .pb-web { display: none !important; } }
@media (min-width: 600px)    { .pb-phone { display: none !important; } }

/* Numbers: condensed and tabular so money, times and counts line up. */
.pb-num {
    font-stretch: 75%;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.pb-title { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--pb-ink); }
.pb-meta  { font-size: 13px; line-height: 1.4; color: var(--pb-muted); }
.pb-good-text { color: var(--pb-good); }
.pb-warn-text { color: var(--pb-warn); }
.pb-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Buttons (design D §4.12). Labels name the thing and the amount when money moves. */
.pb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    font: 700 14px/1.2 var(--pb-font);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}
.pb-btn--primary   { background: var(--pb-brand);  color: #fff; }
.pb-btn--action    { background: var(--pb-accent); color: #fff; }
.pb-btn--secondary { background: #fff; color: var(--pb-ink); border-color: var(--pb-control-line); }
.pb-btn--block     { width: 100%; min-height: 44px; }
.pb-btn:disabled   { opacity: .55; cursor: default; }

.pb-link {
    font: 700 13px var(--pb-font);
    color: var(--pb-brand);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.pb-link:hover { text-decoration: underline; }

.pb-btn:focus-visible, .pb-link:focus-visible {
    outline: 3px solid var(--pb-focus);
    outline-offset: 2px;
}

/* Kind tag: "Open gym", "Camp". Classes get none — they're the default. It follows a title, and
   Razor trims the space between them, so the gap is its own. */
.pb-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--pb-line-soft);
    color: var(--pb-ink-2);
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

/* A readable column inside the sheet, for forms and single-thing pages. The sheet itself runs to
   1200px, which is right for lists and far too wide for a form. */
.pb-column {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Plain content inside the sheet: Mud pieces stack with the sheet's rhythm. */
.pb-sheet-content {
    width: 100%;
    min-width: 0;
}

/* Mud cards inside a design D sheet take the D panel look — flat, a hairline border, 10px corners —
   so pages whose content is still Mud read as one family with the new ones. Popovers, menus and
   dialogs render outside the sheet, so they keep their elevation. */
:is(.pb-sheet-content, .pb-column) .mud-paper:not(.mud-alert) {
    box-shadow: none;
    border: 1px solid var(--pb-line);
    border-radius: 10px;
}
