/* =========================================================
   CHOK CLUB — DESIGN GLOBAL
   ========================================================= */

:root {
    --chok-red: #c1272d;
    --chok-red-hover: #a92126;

    --bg: #0b0b0b;
    --surface: #151515;
    --surface-2: #1c1c1c;

    --border: #303030;

    --text: #f5f5f5;
    --text-soft: #b5b5b5;
    --text-muted: #777777;

    --success: #35c66b;
    --error: #e05252;

    --radius: 10px;
    --radius-large: 14px;

    --max-width: 460px;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    background: var(--bg);
    color: var(--text);

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 16px;
    line-height: 1.5;
}

a {
    color: inherit;
}


/* =========================================================
   STRUCTURE PRINCIPALE
   ========================================================= */

.club-page {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;

    /*
     * Safe areas iPhone / PWA :
     * on conserve exactement les espacements CHOK existants
     * et on ajoute uniquement la zone réservée par iOS.
     */
    padding:
        calc(32px + env(safe-area-inset-top, 0px))
        calc(20px + env(safe-area-inset-right, 0px))
        calc(50px + env(safe-area-inset-bottom, 0px))
        calc(20px + env(safe-area-inset-left, 0px));
}

.club-container {
    width: 100%;
    max-width: var(--max-width);

    margin: 0 auto;
}


/* =========================================================
   LOGO / EN-TÊTE
   ========================================================= */

.club-header {
    text-align: center;

    margin-bottom: 30px;
}

.club-logo {
    display: block;

    width: 115px;
    max-width: 40%;

    height: auto;

    margin:
        0 auto
        12px;
}

.club-label {
    margin: 0;

    color: var(--text-soft);

    font-size: 13px;
    font-weight: 700;

    letter-spacing: 2px;
    text-transform: uppercase;
}


/* =========================================================
   CARTES
   ========================================================= */

.club-card {
    width: 100%;

    padding: 26px;

    background: var(--surface);

    border:
        1px solid
        var(--border);

    border-radius: var(--radius-large);
}

.club-card + .club-card {
    margin-top: 18px;
}


/* =========================================================
   TYPOGRAPHIE
   ========================================================= */

.club-title {
    margin:
        0
        0
        8px;

    font-size: 26px;
    line-height: 1.2;
    font-weight: 800;
}

.club-subtitle {
    margin:
        0
        0
        26px;

    color: var(--text-soft);

    font-size: 15px;
    line-height: 1.6;
}

.club-muted {
    color: var(--text-muted);
}


/* =========================================================
   FORMULAIRES
   ========================================================= */

.club-field {
    margin-bottom: 18px;
}

.club-label-form {
    display: block;

    margin-bottom: 7px;

    color: var(--text);

    font-size: 14px;
    font-weight: 700;
}

.club-input {
    display: block;

    width: 100%;

    padding:
        13px
        14px;

    background: #101010;
    color: var(--text);

    border:
        1px solid
        #3a3a3a;

    border-radius: var(--radius);

    font-family: inherit;
    font-size: 16px;

    outline: none;

    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.club-input::placeholder {
    color: #666666;
}

.club-input:focus {
    background: #121212;

    border-color: var(--chok-red);
}


/* =========================================================
   BOUTONS
   ========================================================= */

.club-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    width: 100%;

    min-height: 48px;

    padding:
        12px
        18px;

    border: 0;

    border-radius: var(--radius);

    background: var(--chok-red);
    color: #ffffff;

    font-family: inherit;
    font-size: 16px;
    font-weight: 800;

    text-align: center;
    text-decoration: none;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.1s ease,
        opacity 0.15s ease;
}

.club-button:hover {
    background: var(--chok-red-hover);
}

.club-button:active {
    transform: scale(0.99);
}

.club-button:disabled {
    opacity: 0.55;

    cursor: not-allowed;
}


/* =========================================================
   BOUTON SECONDAIRE
   ========================================================= */

.club-button-secondary {
    background: transparent;

    border:
        1px solid
        #444444;

    color: var(--text);
}

.club-button-secondary:hover {
    background: var(--surface-2);
}


/* =========================================================
   LIENS
   ========================================================= */

.club-link {
    color: var(--text);

    font-weight: 700;

    text-decoration: underline;
    text-decoration-color: #555555;
    text-underline-offset: 3px;
}

.club-link:hover {
    text-decoration-color: var(--chok-red);
}

.club-link-red {
    color: var(--chok-red);

    font-weight: 700;

    text-decoration: none;
}


/* =========================================================
   MESSAGES
   ========================================================= */

.club-message {
    margin-bottom: 20px;

    padding:
        13px
        14px;

    border-radius: var(--radius);

    font-size: 14px;
    line-height: 1.5;
}

.club-message-success {
    background: rgba(53, 198, 107, 0.10);

    border:
        1px solid
        rgba(53, 198, 107, 0.55);

    color: #b9f3cd;
}

.club-message-error {
    background: rgba(224, 82, 82, 0.10);

    border:
        1px solid
        rgba(224, 82, 82, 0.55);

    color: #ffc1c1;
}


/* =========================================================
   BAS DE CARTE
   ========================================================= */

.club-footer-link {
    margin-top: 22px;

    text-align: center;

    color: var(--text-soft);

    font-size: 14px;
}

.club-footer-link a {
    color: var(--text);

    font-weight: 700;

    text-decoration: none;
}

.club-footer-link a:hover {
    color: var(--chok-red);
}


/* =========================================================
   SÉPARATEUR
   ========================================================= */

.club-separator {
    height: 1px;

    margin:
        24px
        0;

    background: var(--border);

    border: 0;
}


/* =========================================================
   PETITS ÉCRANS
   ========================================================= */

@media (max-width: 520px) {

    .club-page {
        padding:
            calc(24px + env(safe-area-inset-top, 0px))
            calc(16px + env(safe-area-inset-right, 0px))
            calc(40px + env(safe-area-inset-bottom, 0px))
            calc(16px + env(safe-area-inset-left, 0px));
    }

    .club-card {
        padding: 22px 18px;
    }

    .club-logo {
        width: 100px;
    }

    .club-title {
        font-size: 24px;
    }
}
/* =========================================================
   CHOK CLUB — CARTE MEMBRE
   ========================================================= */

/* PAGE MEMBRE */

.member-page {
    /*
     * La carte membre garde son espacement plus compact (20px),
     * mais inclut elle aussi la safe area.
     * Cette règle remplace le padding-top global : elle ne s'y additionne pas.
     */
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
}

.member-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.member-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-brand-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.member-brand-text {
    display: flex;
    flex-direction: column;
}

.member-brand-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.1;
}

.member-brand-label {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.member-logout {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.member-logout:hover {
    color: #ffffff;
}


/* =========================================================
   PROFIL
   ========================================================= */

.member-profile-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    background:
        radial-gradient(
            circle at top right,
            rgba(193, 39, 45, 0.12),
            transparent 42%
        ),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
}

.member-profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.member-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    overflow: hidden;
    background: #202020;
    border: 2px solid #404040;
    border-radius: 50%;
    color: #ffffff;
    font-size: 21px;
    font-weight: 900;
    letter-spacing: 1px;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-identity {
    min-width: 0;
    flex: 1;
}

.member-name {
    margin: 0 0 7px;
    overflow: hidden;
    color: #ffffff;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   BADGES DE STATUT
   ========================================================= */

.member-status {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 5px 9px;
    border: 1px solid #454545;
    border-radius: 7px;
    background: #202020;
    color: #d0d0d0;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: 0.3px;
}

.status-1 {
    background: #1c1c1c;
    border-color: #454545;
    color: #bcbcbc;
}

.status-2 {
    background: linear-gradient(
        135deg,
        #252525,
        #171717
    );
    border-color: #737373;
    color: #e2e2e2;
}

.status-3 {
    background: rgba(193, 39, 45, 0.10);
    border-color: rgba(193, 39, 45, 0.75);
    color: #ff7c80;
}

.status-4 {
    background: linear-gradient(
        135deg,
        rgba(193, 39, 45, 0.17),
        rgba(134, 79, 37, 0.13)
    );
    border-color: #9a6339;
    color: #e6b27d;
}

.status-5 {
    background: linear-gradient(
        135deg,
        #201c12,
        #111111
    );
    border-color: #b99143;
    color: #e4c46f;
    box-shadow:
        inset 0 0 0 1px rgba(255, 215, 120, 0.05);
}

.status-6 {
    background: linear-gradient(
        135deg,
        #2a2110,
        #0d0d0d 70%
    );
    border-color: #d1aa4f;
    color: #f3d987;
    box-shadow:
        0 0 16px rgba(209, 170, 79, 0.12),
        inset 0 0 0 1px rgba(255, 223, 137, 0.10);
}


/* =========================================================
   STATS
   ========================================================= */

.member-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 18px;
}

.member-stat {
    min-width: 0;
    padding: 11px 5px;
    background: #101010;
    border: 1px solid #292929;
    border-radius: 10px;
    text-align: center;
}

.member-stat-value {
    display: block;
    color: #ffffff;
    font-size: 19px;
    font-weight: 900;
    line-height: 1.1;
}

.member-stat-label {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
}


/* =========================================================
   PROGRESSION
   ========================================================= */

.member-progress {
    margin-top: 16px;
}

.member-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
}

.member-progress-track {
    width: 100%;
    height: 6px;
    overflow: hidden;
    background: #292929;
    border-radius: 999px;
}

.member-progress-bar {
    height: 100%;
    background: var(--chok-red);
    border-radius: 999px;
}


/* =========================================================
   QR CODE
   ========================================================= */

.member-qr-card {
    display: flex;
    align-items: center;
    gap: 17px;
    margin-top: 14px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
}

.member-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    flex: 0 0 112px;
    padding: 7px;
    background: #ffffff;
    border-radius: 10px;
}

.member-qr canvas,
.member-qr img {
    display: block;
    max-width: 100%;
    height: auto;
}

.member-qr-content {
    min-width: 0;
}

.member-qr-title {
    margin: 0 0 6px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
}

.member-qr-text {
    margin: 0;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.45;
}


/* =========================================================
   TITRES DE SECTIONS
   ========================================================= */

.member-section {
    margin-top: 26px;
}

.member-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.member-section-title {
    margin: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 900;
}

.member-section-caption {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
}


/* =========================================================
   RÉCOMPENSES ACTIVES
   ========================================================= */

.active-rewards {
    display: grid;
    gap: 10px;
}

.active-reward {
    position: relative;
    display: block;
    padding: 15px;
    overflow: hidden;
    background:
        linear-gradient(
            135deg,
            rgba(53, 198, 107, 0.10),
            #151515 65%
        );
    border: 1px solid rgba(53, 198, 107, 0.50);
    border-radius: 12px;
    color: #ffffff;
    text-decoration: none;
}

.active-reward-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.active-reward-label {
    color: #69db91;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.active-reward-timer {
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
}

.active-reward-name {
    margin-top: 6px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
}


/* =========================================================
   BOUTIQUE
   ========================================================= */

.reward-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.reward-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 174px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.reward-card.available {
    border-color: #3b3b3b;
}

.reward-card.locked {
    opacity: 0.62;
}

.reward-icon {
    margin-bottom: 10px;
    font-size: 25px;
    line-height: 1;
}

.reward-name {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.reward-description {
    margin: 5px 0 10px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
}

.reward-bottom {
    margin-top: auto;
}

.reward-cost {
    margin-bottom: 9px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
}

.reward-cost strong {
    color: #f0ce67;
}

.reward-button {
    width: 100%;
    min-height: 38px;
    padding: 8px 9px;
    border: 0;
    border-radius: 8px;
    background: var(--chok-red);
    color: #ffffff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.reward-button:hover {
    background: var(--chok-red-hover);
}

.reward-button:disabled {
    background: #292929;
    color: #777777;
    cursor: not-allowed;
}


/* =========================================================
   BAS DE PAGE
   ========================================================= */

.member-footer {
    padding: 30px 0 8px;
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
}


/* =========================================================
   PETITS MOBILES
   ========================================================= */

@media (max-width: 370px) {

    .member-avatar {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
    }

    .member-name {
        font-size: 19px;
    }

    .member-stat-value {
        font-size: 17px;
    }

    .member-qr {
        width: 96px;
        height: 96px;
        flex-basis: 96px;
    }

    .reward-card {
        min-height: 166px;
        padding: 12px;
    }
}

/* =========================================================
   VERROUILLAGE MOBILE — SAFARI iOS
   ========================================================= */

html {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow-x: clip;
    touch-action: pan-y;
}

.club-page {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    touch-action: pan-y;
}

.club-container {
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}