/* =====================================================================
   SLOWFASTSTRONG – THEME GLOBAL + TOP BAR
   ===================================================================== */

/* -----------------------------------------------------
   1. COLOR VARIABLES (Light Theme)
   ----------------------------------------------------- */

:root {
    /* BRAND COLORS */
    --sfs-red: #D62828;
    --sfs-black: #000000;
    --sfs-white: #FFFFFF;
    /* GREYSCALE (Light UI) */
    --sfs-grey-50: #FAFAFA;
    --sfs-grey-100: #F3F3F3;
    --sfs-grey-200: #E6E6E6;
    --sfs-grey-300: #D8D8D8;
    --sfs-grey-400: #BFBFBF;
    --sfs-grey-500: #888888;
    --sfs-grey-600: #555555;
    --sfs-grey-700: #333333;
    --sfs-grey-800: #1A1A1A;
    --sfs-grey-900: #0E0E0E;
    /* SHADOWS */
    --sfs-shadow-1: 0px 1px 3px rgba(0,0,0,0.15);
    --sfs-shadow-2: 0px 4px 8px rgba(0,0,0,0.15);
    --sfs-shadow-3: 0px 8px 16px rgba(0,0,0,0.25);
    /* BORDER RADII */
    --sfs-border-radius-sm: 4px;
    --sfs-border-radius-md: 8px;
    --sfs-border-radius-lg: 12px;
    --sfs-border-radius-pill: 999px;
    /* TOP BAR HEIGHT (if you ever need it) */
    --top-menu-h: 0px;
}


/* -----------------------------------------------------
   2. TYPOGRAPHY & RESET
   ----------------------------------------------------- */

html,
body {
    margin: 0;
    padding: 0;
    background: var(--sfs-white);
    color: var(--sfs-black);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.4em 0;
    font-weight: 600;
    color: var(--sfs-black);
}

/* Paragraphs */
p {
    margin: 0 0 1em 0;
}

/* Links */
a {
    color: var(--sfs-red);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

/* Basic reset */
button {
    font-family: inherit;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Utility */
.sfs-hidden {
    display: none !important;
}


/* =====================================================================
   3. TOP MENU WRAPPER (3 lignes : user bar, nav public, brand)
   ===================================================================== */

.top-menu-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}


/* =====================================================================
   4. LIGNE 1 – USER BAR (login/register + hamburger)
   ===================================================================== */

/* Container in your HTML */
#container_user_menu {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0; /* inner bar will handle its own padding */
    position: relative; /* anchor for dropdown panel */
}

    /* Inner .sfs-user-menu is injected by the SP */
    #container_user_menu > .sfs-user-menu {
        width: 100%;
        margin: 0 auto;
        background: linear-gradient(90deg, var(--sfs-black), #151515);
        color: #fff;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 0.5rem;
        padding: 4px 8px;
        box-sizing: border-box;
    }

/* Neutral base class for user menu */
.sfs-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sfs-user-name {
    font-weight: 350;
}

.sfs-user-menu--logged-out .sfs-btn {
    width: auto;
}

/* Inverted button (Sign in / Register etc.) */
.sfs-btn-inverted {
    background: #111827; /* near-black */
    border: 1px solid #111827;
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 14px;
}

    .sfs-btn-inverted:hover {
        background: #000000;
        border-color: #000000;
    }

    .sfs-btn-inverted:active {
        transform: translateY(1px);
    }

/* Hamburger button */
.sfs-menu-btn {
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 999px;
}

    .sfs-menu-btn:hover {
        background: rgba(0, 0, 0, 0.05);
    }

    .sfs-menu-btn:focus-visible {
        outline: 2px solid var(--sfs-accent, #3b82f6);
        outline-offset: 2px;
    }

.sfs-menu-icon {
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 0.2s ease;
}
/* open state */
.sfs-menu-btn[aria-expanded="true"] .sfs-menu-icon {
    transform: rotate(90deg);
}


/* =====================================================================
   5. LIGNE 2 – PUBLIC HORIZONTAL NAV (scrollable + separators)
   ===================================================================== */

/* Outer container: full width, scrollable horizontally if needed */
#container_top_nav {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* for scroll */
    padding: 4px 10px;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Inner bar created by sfs_renderTopPublicNav */
.sfs-topnav-bar {
    display: flex;
    align-items: center;
    flex-wrap: nowrap; /* no wrap ? scroll horizontally */
    justify-content: flex-start;
    min-width: max-content; /* width = sum of items */
}

/* Individual items (Home, Events, Training, Contact…) */
.sfs-topnav-item {
    background: transparent;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: inherit;
    border-radius: 6px;
    white-space: nowrap;
    flex: 0 0 auto; /* don't shrink */
}

    /* Hover: centered around the text */
    .sfs-topnav-item:hover {
        background-color: rgba(0,0,0,0.05);
    }

    /* Visual separator " | " using border-left (no layout shift) */
    .sfs-topnav-item + .sfs-topnav-item {
        border-left: 1px solid rgba(0,0,0,0.35);
        margin-left: 8px; /* space before border */
        padding-left: 12px; /* space between border and text */
    }


/* =====================================================================
   6. LIGNE 3 – BRAND / BANNER
   ===================================================================== */

#container_top_brand {
    display: flex;
    justify-content: center;
    align-items: center;
}

.sfs-top-brand {
    width: 100%;
    margin: 0 auto;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 2px 0 0;
    box-sizing: border-box;
    z-index: 10000;
}

#container_top_brand .sfs-paragraph,
#container_top_brand .sfs-paragraph-inner {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Very small screens: allow logo wrap if needed */
@media (max-width: 360px) {
    .sfs-top-brand {
        flex-wrap: wrap;
        row-gap: 8px;
    }
}


/* =====================================================================
   7. USER MENU PANEL (vertical accordion)
   ===================================================================== */

/* The panel is anchored to #container_user_menu */
.sfs-user-menu-panel {
    display: none;
}

    /* Open state (JS adds .is-open) */
    .sfs-user-menu-panel.is-open {
        display: block;
    }

/* Mobile: full-screen overlay */
@media (max-width: 768px) {
    .sfs-user-menu-panel {
        position: fixed;
        top: 40px !important; /* height of user bar */
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        padding: 1.5rem 1rem;
        overflow-y: auto;
        z-index: 2000;
    }

    /* keep user buttons compact */
    .sfs-user-menu .sfs-btn-inverted {
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
    }
}

/* Desktop: dropdown under the user bar on the right */
@media (min-width: 769px) {
    .sfs-user-menu-panel {
        position: absolute;
        top: 100%;
        right: 0;
        background: #fff;
        min-width: 220px;
        padding: 0.5rem 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        border-radius: 0.75rem;
        z-index: 2000;
    }
}

/* Panel header: title + close button (if you use it) */
.sfs-user-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

.sfs-user-menu-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.sfs-user-menu-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
}

/* Vertical list */
.sfs-user-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Each item */
.sfs-user-menu-item {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
    background: #ffffff;
}

    .sfs-user-menu-item:last-child {
        border-bottom: none;
    }

/* Full-width button */
.sfs-user-menu-button {
    width: 100%;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
}

    .sfs-user-menu-button:hover {
        background-color: rgba(0, 0, 0, 0.03);
        color: #000;
    }

/* Active item */
.sfs-user-menu-item.is-active .sfs-user-menu-button {
    background: rgba(10, 128, 144, 0.18);
    color: #0A8090;
    font-weight: 600;
}

.sfs-user-menu-text {
    flex: 1;
}

.sfs-user-menu span,
.sfs-user-menu button {
    flex-shrink: 0;
}

/* Back row at top when in submenu */
.sfs-user-menu-header-row {
    background: #d1d5db;
    border-bottom: 1px solid #c5c9d0;
}

    .sfs-user-menu-header-row .sfs-user-menu-button {
        font-weight: 600;
        color: #1f2937;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sfs-user-menu-header-row:hover {
        background: #bfc4cc;
    }

.sfs-user-menu-back {
    font-size: 1.1rem;
    color: #111827;
    display: inline-flex;
    align-items: center;
}

/* Optional mobile logo inside user bar if you want to use it */
.sfs-mobile-logo {
    display: none;
}

@media (max-width: 768px) {
    .sfs-mobile-logo {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
        font-weight: 600;
        font-size: 0.9rem;
        margin-right: auto;
    }

        .sfs-mobile-logo img {
            height: 24px;
            width: auto;
        }
}


/* =====================================================================
   8. FORM / LOGIN BOX / BUTTONS
   ===================================================================== */

.sfs-card {
    box-sizing: border-box;
}

    /* LOGIN BOX / CARD */
    .sfs-login-box,
    .sfs-card.sfs-form {
        max-width: 420px;
        padding: 16px;
        border-radius: 16px;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        box-shadow: 0 10px 25px rgba(0,0,0,0.08);
        color: #111827;
    }

/* Titles */
.sfs-title {
    font-size: 16px;
    font-weight: 750;
    margin-bottom: 6px;
}

.sfs-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 14px;
}

/* FORM FIELDS */
.sfs-login-form {
    display: block;
}

.sfs-field {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

/* Labels */
.sfs-label {
    font-size: 12px;
    font-weight: 650;
    color: #374151;
}

/* INPUTS / TEXTAREA / SELECT */
.sfs-input,
.sfs-textarea,
.sfs-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #111827;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

    .sfs-input::placeholder,
    .sfs-textarea::placeholder {
        color: #9ca3af;
    }

    .sfs-input:focus,
    .sfs-textarea:focus,
    .sfs-select:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 4px rgba(37,99,235,0.18);
    }

/* Code input (OTP) */
#code.sfs-input {
    letter-spacing: 0.22em;
    font-variant-numeric: tabular-nums;
}

/* BUTTONS */
.sfs-btn {
    width: 100%;
    border-radius: 14px;
    padding: 10px 14px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #111827;
    font-weight: 700;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}

    .sfs-btn:hover {
        background: #e5e7eb;
    }

    .sfs-btn:active {
        transform: translateY(1px);
    }

/* Primary button */
.sfs-btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

    .sfs-btn-primary:hover {
        background: #1d4ed8;
    }

/* Errors */
.sfs-error {
    margin-top: 6px;
    font-size: 12px;
    color: #dc2626;
}

.sfs-input.is-invalid,
.sfs-textarea.is-invalid,
.sfs-select.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220,38,38,0.18);
}


/* =====================================================================
   9. LOGIN CONTAINER AS MODAL OVERLAY
   ===================================================================== */

.sfs-dialog-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

    .sfs-dialog-close:hover {
        opacity: 1;
    }

#container_login {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none; /* hidden by default */
    align-items: center;
    justify-content: center;
    padding: 24px;
}

    #container_login::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.45);
    }

    #container_login > * {
        position: relative;
        z-index: 1;
    }


/* =====================================================================
   10. DARK MODE
   ===================================================================== */

@media (prefers-color-scheme: dark) {

    .sfs-login-box,
    .sfs-card.sfs-form {
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.14);
        box-shadow: 0 10px 30px rgba(0,0,0,0.35);
        color: #f9fafb;
    }

    .sfs-subtitle {
        color: rgba(255,255,255,0.70);
    }

    .sfs-label {
        color: rgba(255,255,255,0.75);
    }

    .sfs-input,
    .sfs-textarea,
    .sfs-select {
        background: rgba(255,255,255,0.06);
        border-color: rgba(255,255,255,0.14);
        color: #f9fafb;
    }

        .sfs-input::placeholder {
            color: rgba(255,255,255,0.45);
        }

        .sfs-input:focus,
        .sfs-textarea:focus,
        .sfs-select:focus {
            border-color: rgba(96,165,250,0.75);
            box-shadow: 0 0 0 4px rgba(96,165,250,0.25);
        }

    .sfs-btn {
        background: rgba(255,255,255,0.06);
        border-color: rgba(255,255,255,0.14);
        color: #f9fafb;
    }

    .sfs-btn-primary {
        background: rgba(96,165,250,0.22);
        border-color: rgba(96,165,250,0.45);
    }

        .sfs-btn-primary:hover {
            background: rgba(96,165,250,0.30);
        }

    .sfs-btn-inverted {
        background: #ffffff;
        border-color: #ffffff;
        color: #111827;
    }

        .sfs-btn-inverted:hover {
            background: #e5e7eb;
        }

    .sfs-error {
        color: rgba(248,113,113,0.95);
    }
}

/* =====================================================
   FIX: LOGIN MODAL TRANSPARENCY (MOBILE + DARK MODE)
   ===================================================== */

/* Ensure modal card is always solid */
#container_login .sfs-login-box,
#container_login .sfs-card.sfs-form {
    background: #ffffff;
    opacity: 1;
    isolation: isolate;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #container_login {
        align-items: flex-start;
        padding-top: max(16px, env(safe-area-inset-top));
    }

        #container_login .sfs-login-box,
        #container_login .sfs-card.sfs-form {
            width: 100%;
            max-width: 420px;
            background: #ffffff;
        }
}

/* Dark mode FIX (replace transparent background) */
@media (prefers-color-scheme: dark) {
    #container_login .sfs-login-box,
    #container_login .sfs-card.sfs-form {
        background: #111827; /* SOLID instead of rgba(...) */
        color: #f9fafb;
    }
}

/* Center on screen */
.sfs-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Form */
.sfs-form {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Email input */
.sfs-input-email {
    width: 100%;
    height: 52px;
    min-height: 52px; /* prevents shrinking on mobile */

    padding: 0 16px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

/* Continue button */
.sfs-btn-continue {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 10px;
    background: #111;
    color: white;
    font-size: 15px;
    cursor: pointer;
}

/* Optional mobile adjustments */
@media (max-width: 640px) {

    .sfs-login-wrapper {
        padding: 24px;
    }

    .sfs-input-email,
    .sfs-btn-continue {
        height: 54px;
        min-height: 54px;
        font-size: 16px;
    }
}