/*
 * ALLENYX Coach: presentation layer over wger's Bootstrap 5.3 build.
 *
 * Loaded after every other stylesheet (ptsaas/_brand_css.html). Only colours,
 * borders, spacing and typography: no layout rebuild, nothing hidden.
 * White dominates, anthracite for text and navigation, coral only for selected
 * states and accents. Coral is too light for white text (2.3:1), so anything
 * written on coral is anthracite.
 */

:root {
    --allenyx-anthracite: #191E2B;
    --allenyx-anthracite-hover: #2C3347;
    --allenyx-anthracite-active: #0F131C;
    --allenyx-coral: #FF8A60;
    --allenyx-coral-soft: #FFE2D7;
    --allenyx-coral-strong: #B4451C; /* coral family text on white, 4.9:1 */
    --allenyx-grey: #F4F5F7;
    --allenyx-line: #E6E8EC;
    --allenyx-muted: #5B6273;

    --bs-primary: #191E2B;
    --bs-primary-rgb: 25, 30, 43;
    --bs-body-color: #191E2B;
    --bs-body-color-rgb: 25, 30, 43;
    --bs-body-bg: #FFFFFF;
    --bs-emphasis-color: #191E2B;
    --bs-secondary-color: rgba(25, 30, 43, 0.72);
    --bs-secondary-bg: #F4F5F7;
    --bs-tertiary-bg: #F4F5F7;
    --bs-light: #F4F5F7;
    --bs-light-rgb: 244, 245, 247;
    --bs-border-color: #E6E8EC;
    --bs-link-color: #191E2B;
    --bs-link-color-rgb: 25, 30, 43;
    --bs-link-hover-color: #B4451C;
    --bs-link-hover-color-rgb: 180, 69, 28;
    --bs-focus-ring-color: rgba(255, 138, 96, 0.35);
    --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    font-family: var(--bs-font-sans-serif);
    color: var(--allenyx-anthracite);
    background-color: #FFFFFF;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--bs-font-sans-serif);
    color: var(--allenyx-anthracite);
    font-weight: 700;
    letter-spacing: -0.01em;
}

a {
    text-underline-offset: 0.18em;
}

.text-muted {
    color: var(--allenyx-muted) !important;
}

/* --------------------------------------------------------------- Navigation */

.navbar.bg-primary {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid var(--allenyx-line);
    /* the PT's own colour (Il mio marchio), when set, as a thin top accent */
    border-top: 3px solid var(--ptsaas-tenant, #FFFFFF);
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2825, 30, 43, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    --bs-navbar-toggler-border-color: var(--allenyx-line);
}

.navbar.bg-primary .navbar-brand,
.navbar.bg-primary .nav-link,
.navbar.bg-primary .text-white {
    color: var(--allenyx-anthracite) !important;
}

.navbar.bg-primary .nav-link:hover,
.navbar.bg-primary .nav-link:focus {
    color: #000000 !important;
}

/* active section: coral underline instead of a text underline */
.navbar.bg-primary .nav-link.text-decoration-underline {
    text-decoration: none !important;
    box-shadow: inset 0 -3px 0 var(--allenyx-coral);
}

.navbar.bg-primary .nav-link.text-warning {
    color: var(--allenyx-coral-strong) !important;
}

/* wger nests the navbar row in an inline display:flex container without wrap:
   on phones the opened menu has to go below the brand, not next to it */
.navbar.bg-primary > .container-fluid > .container-lg {
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.navbar.bg-primary .navbar-toggler-icon {
    background-image: var(--bs-navbar-toggler-icon-bg);
}

.allenyx-brand {
    gap: 0.5rem;
    min-width: 0;
}

.allenyx-brand-symbol {
    height: 32px;
    width: auto;
    flex: 0 0 auto;
}

.allenyx-brand-product {
    font-weight: 800;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.allenyx-brand-product small {
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--allenyx-coral-strong);
    font-size: 0.85em;
}

.allenyx-brand-studio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    padding-left: 0.75rem;
    margin-left: 0.25rem;
    border-left: 1px solid var(--allenyx-line);
    font-weight: 600;
}

.allenyx-brand-studio img {
    height: 30px;
    width: auto;
    max-width: 88px;
    border-radius: 4px;
    border: 1px solid var(--allenyx-line);
    background: #FFFFFF;
}

@media (max-width: 575.98px) {
    /* phone: symbol + studio name, the product name returns from 576px */
    .allenyx-brand-product {
        display: none;
    }

    .allenyx-brand-studio {
        padding-left: 0.5rem;
        margin-left: 0;
    }
}

.dropdown-menu {
    --bs-dropdown-border-color: var(--allenyx-line);
    --bs-dropdown-link-active-bg: var(--allenyx-coral-soft);
    --bs-dropdown-link-active-color: var(--allenyx-anthracite);
    --bs-dropdown-link-hover-bg: var(--allenyx-grey);
    box-shadow: 0 6px 18px rgba(25, 30, 43, 0.08);
}

/* ----------------------------------------------------------------- Headings */

#page-title.page-header {
    font-size: 1.75rem;
    margin-top: 1.25rem;
}

#page-title + hr {
    border-top: 2px solid var(--allenyx-coral);
    opacity: 1;
    width: 48px;
    margin-top: 0.5rem;
}

/* ------------------------------------------------------------------ Buttons */

.btn {
    font-weight: 600;
}

.btn-primary {
    --bs-btn-color: #FFFFFF;
    --bs-btn-bg: var(--allenyx-anthracite);
    --bs-btn-border-color: var(--allenyx-anthracite);
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: var(--allenyx-anthracite-hover);
    --bs-btn-hover-border-color: var(--allenyx-anthracite-hover);
    --bs-btn-focus-shadow-rgb: 255, 138, 96;
    --bs-btn-active-color: #FFFFFF;
    --bs-btn-active-bg: var(--allenyx-anthracite-active);
    --bs-btn-active-border-color: var(--allenyx-anthracite-active);
    --bs-btn-disabled-color: #FFFFFF;
    --bs-btn-disabled-bg: var(--allenyx-anthracite);
    --bs-btn-disabled-border-color: var(--allenyx-anthracite);
}

/* wger uses btn-success for its save / submit buttons: same weight as primary */
.btn-success {
    --bs-btn-color: #FFFFFF;
    --bs-btn-bg: var(--allenyx-anthracite);
    --bs-btn-border-color: var(--allenyx-anthracite);
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: var(--allenyx-anthracite-hover);
    --bs-btn-hover-border-color: var(--allenyx-anthracite-hover);
    --bs-btn-focus-shadow-rgb: 255, 138, 96;
    --bs-btn-active-color: #FFFFFF;
    --bs-btn-active-bg: var(--allenyx-anthracite-active);
    --bs-btn-active-border-color: var(--allenyx-anthracite-active);
    --bs-btn-disabled-color: #FFFFFF;
    --bs-btn-disabled-bg: var(--allenyx-anthracite);
    --bs-btn-disabled-border-color: var(--allenyx-anthracite);
}

.password-toggle-btn .fas {
    color: var(--allenyx-muted) !important;
}

.btn-outline-primary {
    --bs-btn-color: var(--allenyx-anthracite);
    --bs-btn-border-color: var(--allenyx-anthracite);
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: var(--allenyx-anthracite);
    --bs-btn-hover-border-color: var(--allenyx-anthracite);
    --bs-btn-focus-shadow-rgb: 255, 138, 96;
    --bs-btn-active-color: #FFFFFF;
    --bs-btn-active-bg: var(--allenyx-anthracite-active);
    --bs-btn-active-border-color: var(--allenyx-anthracite-active);
}

.btn-light {
    --bs-btn-bg: var(--allenyx-grey);
    --bs-btn-border-color: var(--allenyx-line);
    --bs-btn-hover-bg: #EBEDF0;
    --bs-btn-hover-border-color: #DADDE3;
    --bs-btn-color: var(--allenyx-anthracite);
}

/* main call to action of a page (invite, add athlete): coral, anthracite text */
.btn-allenyx-cta {
    --bs-btn-color: var(--allenyx-anthracite);
    --bs-btn-bg: var(--allenyx-coral);
    --bs-btn-border-color: var(--allenyx-coral);
    --bs-btn-hover-color: var(--allenyx-anthracite);
    --bs-btn-hover-bg: #FF9D7A;
    --bs-btn-hover-border-color: #FF9D7A;
    --bs-btn-focus-shadow-rgb: 255, 138, 96;
    --bs-btn-active-color: var(--allenyx-anthracite);
    --bs-btn-active-bg: #F07A50;
    --bs-btn-active-border-color: #F07A50;
}

/* -------------------------------------------------------------------- Forms */

.form-control:focus,
.form-select:focus {
    border-color: var(--allenyx-coral);
    box-shadow: 0 0 0 0.2rem rgba(255, 138, 96, 0.25);
}

.form-check-input:checked {
    background-color: var(--allenyx-anthracite);
    border-color: var(--allenyx-anthracite);
}

.form-check-input:focus {
    border-color: var(--allenyx-coral);
    box-shadow: 0 0 0 0.2rem rgba(255, 138, 96, 0.25);
}

/* ------------------------------------------------- Tables, cards and states */

.table {
    --bs-table-hover-bg: #F9FAFB;
    --bs-table-border-color: var(--allenyx-line);
}

.table > thead > tr > th,
table.dataTable > thead > tr > th {
    background-color: var(--allenyx-grey);
    color: var(--allenyx-anthracite);
    font-weight: 600;
    border-bottom: 1px solid var(--allenyx-line);
    white-space: nowrap;
}

.card {
    --bs-card-border-color: var(--allenyx-line);
    --bs-card-cap-bg: var(--allenyx-grey);
    border-radius: 12px;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link,
.list-group-item.active,
.page-item.active .page-link {
    background-color: var(--allenyx-coral-soft);
    border-color: var(--allenyx-coral);
    color: var(--allenyx-anthracite);
}

.nav-tabs .nav-link.active {
    border-bottom: 3px solid var(--allenyx-coral);
    color: var(--allenyx-anthracite);
}

.badge.text-bg-primary,
.badge.bg-primary {
    background-color: var(--allenyx-anthracite) !important;
    color: #FFFFFF !important;
}

/* athletes still waiting for their invitation (gym member list) */
.allenyx-badge-invite {
    background-color: var(--allenyx-coral-soft);
    color: var(--allenyx-anthracite);
    border: 1px solid var(--allenyx-coral);
    font-weight: 600;
}

.allenyx-badge-invite:hover {
    background-color: var(--allenyx-coral);
    color: var(--allenyx-anthracite);
}

/* "you are browsing as ...": the trainer acting for an athlete */
.alert-info {
    --bs-alert-bg: var(--allenyx-coral-soft);
    --bs-alert-color: var(--allenyx-anthracite);
    --bs-alert-border-color: var(--allenyx-coral);
    --bs-alert-link-color: var(--allenyx-anthracite);
    border-left-width: 4px;
}

/* -------------------------------------------- React (MUI) parts of the pages */
/* Dashboard and routine pages are rendered by the wger React build with its own
   MUI theme; only the primary colour of its buttons and icons is aligned here. */

.MuiButton-containedPrimary,
.MuiButton-contained.MuiButton-colorPrimary {
    background-color: var(--allenyx-anthracite) !important;
    color: #FFFFFF !important;
}

.MuiButton-containedPrimary:hover,
.MuiButton-contained.MuiButton-colorPrimary:hover {
    background-color: var(--allenyx-anthracite-hover) !important;
}

.MuiButton-outlinedPrimary,
.MuiButton-outlined.MuiButton-colorPrimary {
    color: var(--allenyx-anthracite) !important;
    border-color: rgba(25, 30, 43, 0.45) !important;
}

.MuiFab-secondary,
.MuiFab-colorSecondary,
.MuiFab-primary {
    background-color: var(--allenyx-coral) !important;
    color: var(--allenyx-anthracite) !important;
}

.MuiFab-secondary:hover,
.MuiFab-colorSecondary:hover,
.MuiFab-primary:hover {
    background-color: #FF9D7A !important;
}

.MuiButton-textPrimary,
.MuiButton-text.MuiButton-colorPrimary,
.MuiIconButton-colorPrimary,
.MuiSvgIcon-colorPrimary {
    color: var(--allenyx-anthracite) !important;
}

/* ------------------------------------------------------------------- Footer */

#main-footer {
    background-color: var(--allenyx-grey) !important;
    border-top: 1px solid var(--allenyx-line) !important;
}

#main-footer .bg-wger-light {
    background-color: transparent !important;
}

/* phones: the legal line wraps, so the footer follows the content instead of
   sitting at a fixed 4rem height at the bottom */
@media (max-width: 767.98px) {
    footer#main-footer {
        position: static;
        height: auto;
        padding-bottom: 0.75rem;
    }

    body {
        margin-bottom: 0 !important;
    }
}

/* ------------------------------------------------- Login and invite pages */

.allenyx-login-logo {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.allenyx-product-label {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--allenyx-grey);
    border: 1px solid var(--allenyx-line);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--allenyx-anthracite);
}

.allenyx-invite-panel {
    background: var(--allenyx-grey);
    border: 1px solid var(--allenyx-line);
    border-radius: 12px;
    padding: 1rem;
}

.allenyx-invite-panel .form-control[readonly] {
    background-color: #FFFFFF;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
}
