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

.h-auth-overlay-system {
    /* Le conteneur devient centré et fait la hauteur de la vidéo */
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--h-video-width);
    height: 100%;
    z-index: 20;
    pointer-events: none;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* On gère l'opacité et le flou de fond */
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: background 0.4s ease, backdrop-filter 0.4s ease, visibility 0.4s;
    visibility: hidden;
}

.h-auth-overlay-system.visible {
    visibility: visible;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.82); /* Voile noir flouté limité à la zone vidéo */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Le Layer de flou */
.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 {
    width: 380px;
    max-width: 92vw;
    height: auto;
    max-height: 80vh;
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 30px 30px 30px;
    box-sizing: border-box;
    overflow-y: auto;
    
    /* ÉTAT INITIAL */
    transform: scale(0.88) translateY(16px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    will-change: transform, opacity;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.h-auth-overlay-system.visible .h-auth-content {
    /* ÉTAT ACTIF */
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* --- ELEMENTS INTERNES --- */
.h-auth-logo {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    margin: 0 !important;
}
.h-auth-logo img {
    width: 90px;
    height: 90px;
    display: block;
}

.h-auth-box { 
    background: transparent; 
    padding: 0; 
    position: relative; 
    padding-top: 90px; /* Espace réservé pour le logo absolu */
}

/* 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: 8px; width: 100%; padding: 12px; 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; transition: background 0.2s, border-color 0.2s; }
.h-btn-social:hover { background: rgba(255,255,255,0.08); border-color: var(--h-accent-blue); }
.h-social-wrap { display: flex; flex-direction: column; gap: 8px; }
.h-btn-social svg { flex-shrink: 0; }
.h-btn-social-text {
    font-size: 11px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.08em; padding: 10px;
}
.h-social-wrap-logo-only {
    flex-direction: row !important; flex-wrap: wrap;
    justify-content: center; gap: 8px;
}
.h-social-wrap-logo-only .h-btn-social-logo {
    width: auto; padding: 10px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
}
.h-social-wrap-logo-only .h-btn-social-logo svg {
    display: block;
}

.h-switch-link { text-align: center; font-size: 10px; font-weight: 800; color: rgba(255,255,255,0.4); margin-top: 35px; cursor: pointer; text-transform: uppercase; transition: color 0.2s; }
.h-switch-link:hover { color: #fff; }
.h-exit-label { text-align: center; font-size: 9px; font-weight: 900; color: rgba(255,255,255,0.4); margin-top: 30px; cursor: pointer; letter-spacing: 2px; text-transform: uppercase; transition: color 0.2s; }
.h-exit-label:hover { color: #fff; }

.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); }