/* --- HULYX AUTH SYSTEM (Viewport Masking Logic) --- */

.h-auth-overlay-system {
    /* Le conteneur devient le masque : il est centré et fait la largeur de la vidéo */
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--h-video-width);
    height: 100%;
    z-index: 100;
    pointer-events: none;
    
    /* CRUCIAL : Tout ce qui sort de la largeur de la vidéo est invisible */
    overflow: hidden; 
    
    /* On gère l'opacité ici pour le fondu de fond */
    background: rgba(0, 0, 0, 0);
    transition: background 0.4s ease, visibility 0.4s;
    visibility: hidden;
}

.h-auth-overlay-system.visible {
    visibility: visible;
    pointer-events: auto;
    background: var(--h-bg-overlay); /* Voile noir limité à la zone vidéo */
}

/* Le Layer de flou (Optionnel : si tu veux que le flou soit aussi limité au cadre) */
.h-auth-overlay-system::before {
    content: '';
    position: absolute;
    inset: 0;
   
    opacity: 0;
    transition: opacity 0.4s;
    z-index: -1;
}

.h-auth-overlay-system.visible::before {
    opacity: 1;
}

.h-auth-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--h-bg-surface);
    border-left: 1px solid var(--h-border-subtle);
    padding: 60px 35px 140px;
    box-sizing: border-box;
   
    overflow-y: auto;

    /* ÉTAT INITIAL : Le panneau est caché juste à droite du bord de la vidéo */
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.h-auth-overlay-system.visible .h-auth-content {
    /* ÉTAT ACTIF : Le panneau glisse vers sa position 0 (le cadre de la vidéo) */
    transform: translateX(0);
}

/* --- ELEMENTS INTERNES --- */
.h-auth-logo { text-align: center; margin-bottom: 10px; margin-top: 25px !important; }
.h-auth-logo img { width: 110px; }

.h-auth-box { 
    background: transparent; 
    padding: 0; 
    position: relative; 
}

/* VIEW STATES */
.h-dash-view { display: none; opacity: 1 !important; visibility: visible !important; }
.h-dash-view.is-active { display: block !important; }

/* PROFILE ELEMENTS */
.h-auth-status { color: var(--h-accent-blue); text-align: center; font-weight: 900; font-size: 10px; letter-spacing: 3px; margin-bottom: 20px; }
.h-profile-display { text-align: center; margin-bottom: 20px; }
.h-avatar-circle { width: 90px; height: 90px; border-radius: 50%; border: 2px solid var(--h-accent-blue); margin: 0 auto 15px; overflow: hidden; }
.h-avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.h-user-tier { display: inline-block; padding: 4px 10px; border-radius: 4px; background: var(--h-accent-blue-glow); color: var(--h-accent-blue); font-size: 9px; font-weight: 900; letter-spacing: 1px; margin-bottom: 10px; }
.h-user-name { font-size: 20px; color: var(--h-text-primary); font-weight: 700; margin-bottom: 15px; }

/* UPGRADE BOX */
.h-upgrade-box { background: var(--h-bg-card); border: 1px solid var(--h-accent-blue); border-radius: 12px; padding: 20px; margin: 20px 0; text-align: center; }
.h-up-title { color: var(--h-accent-blue); font-weight: 900; font-size: 11px; letter-spacing: 2px; margin-bottom: 15px; }
.h-up-limits { list-style: none; padding: 0; margin: 0 0 20px 0; text-align: left; }
.h-up-limits li { font-size: 11px; color: var(--h-text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.h-up-limits li span { color: var(--h-accent-red); font-weight: bold; }
.h-btn-premium { display: block; background: var(--h-accent-blue); color: var(--h-bg-main); padding: 14px; border-radius: 8px; font-weight: 900; font-size: 11px; text-decoration: none; text-transform: uppercase; }

/* ACTIONS & FORMS */
.h-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 15px; }
.h-auth-btn { width: 100%; padding: 14px; border-radius: 8px; border: none; font-weight: 800; cursor: pointer; text-transform: uppercase; font-size: 10px; }
.h-auth-btn.primary { background: var(--h-text-primary); color: var(--h-bg-main); }
.h-auth-btn.secondary { background: var(--h-bg-card); color: var(--h-text-primary); border: 1px solid var(--h-border-active); }

.h-auth-divider { text-align: center; margin: 30px 0; border-bottom: 1px solid var(--h-border-subtle); line-height: 0.1em; }
.h-auth-divider span { background: var(--h-bg-surface); padding:0 15px; color: var(--h-text-dim); font-size: 9px; letter-spacing: 1px; }
.h-btn-social { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 14px; background: var(--h-bg-card); border: 1px solid var(--h-border-active); border-radius: 8px; color: var(--h-text-primary); font-size: 11px; font-weight: 800; text-decoration: none; }

.h-switch-link { text-align: center; font-size: 10px; font-weight: 800; color: var(--h-text-dim); margin-top: 35px; cursor: pointer; text-transform: uppercase; }
.h-exit-label { text-align: center; font-size: 9px; font-weight: 900; color: var(--h-bg-main); margin-top: 30px; cursor: pointer; letter-spacing: 2px; }

.h-auth-box input { width: 100%; background: var(--h-bg-card); border: 1px solid var(--h-border-active); color: var(--h-text-primary); padding: 14px; margin-bottom: 12px; border-radius: 8px; outline: none; box-sizing: border-box; }
.h-msg-box { text-align: center; font-size: 11px; margin-bottom: 15px; min-height: 15px; }
.h-msg-box.err { color: var(--h-accent-red); }
.h-msg-box.ok { color: var(--h-accent-blue); }

.h-avatar-upload { text-align: center; margin-bottom: 20px; }
#h-avatar-preview { width: 80px; height: 80px; border-radius: 50%; border: 2px solid var(--h-accent-blue); object-fit: cover; cursor: pointer; }
.h-upload-label { display: block; font-size: 10px; margin-top: 8px; color: var(--h-text-dim); }