/* ============================================
   ECHO PARTAGE — FRONT CSS
   Skin : Echo de Plumes — noir profond / or
   ============================================ */

:root {
    --ep-gold:    #d4af37;
    --ep-blue:    #2563eb;
    --ep-dark:    #1a1a1a;
    --ep-darker:  #111111;
    --ep-white:   #f8f8f8;
    --ep-gray:    #333333;
    --ep-border:  rgba(212, 175, 55, 0.3);
    --ep-font-h:  'Playfair Display', Georgia, serif;
    --ep-font-b:  'Inter', -apple-system, sans-serif;
}

/* ============================================
   CONTENEUR GLOBAL
   ============================================ */

.ep-wrap {
    max-width: 860px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: var(--ep-font-b);
    color: var(--ep-white);
}

/* ============================================
   ÉCRAN DE SAISIE DU CODE
   ============================================ */

.ep-access-box {
    background: var(--ep-dark);
    border: 1px solid var(--ep-border);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 480px;
    margin: 3rem auto;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

.ep-access-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.ep-access-title {
    font-family: var(--ep-font-h);
    color: var(--ep-gold);
    font-size: 1.6rem;
    margin-bottom: .5rem;
}

.ep-access-desc {
    color: #aaa;
    font-size: .9rem;
    margin-bottom: 2rem;
}

/* Inputs code à 6 chiffres */
.ep-code-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.ep-code-input {
    width: 48px;
    height: 60px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--ep-gold);
    background: #111;
    border: 2px solid var(--ep-border);
    border-radius: 6px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    caret-color: var(--ep-gold);
}

.ep-code-input:focus {
    border-color: var(--ep-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .2);
}

.ep-code-input.ep-filled {
    border-color: var(--ep-gold);
    background: #1e1a0a;
}

/* Bouton soumettre */
.ep-btn-submit {
    display: inline-block;
    padding: .8rem 2.5rem;
    background: var(--ep-gold);
    color: var(--ep-dark);
    font-family: var(--ep-font-b);
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background .2s, transform .15s;
    letter-spacing: .03em;
}

.ep-btn-submit:hover {
    background: #c4a030;
    transform: translateY(-1px);
}

/* Message d'erreur */
.ep-error {
    background: rgba(192, 57, 43, .15);
    border: 1px solid rgba(192, 57, 43, .4);
    color: #e74c3c;
    padding: .6rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: .9rem;
}

/* ============================================
   EN-TÊTE DU PAQUET (après validation)
   ============================================ */

.ep-header {
    position: relative;
    background: var(--ep-dark);
    border: 1px solid var(--ep-border);
    border-radius: 8px;
    padding: 2rem 2rem 1.5rem;
    margin-bottom: 2rem;
    overflow: hidden;
}

.ep-header-deco {
    position: absolute;
    top: 0; left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ep-gold), var(--ep-blue));
}

.ep-paquet-titre {
    font-family: var(--ep-font-h);
    color: var(--ep-gold);
    font-size: 1.8rem;
    margin: 0 0 .4rem;
}

.ep-expiry {
    color: #888;
    font-size: .85rem;
    margin: 0 0 .4rem;
}

.ep-files-count {
    color: #aaa;
    font-size: .85rem;
    margin: 0;
}

/* ============================================
   LISTE DES FICHIERS
   ============================================ */

.ep-files-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ep-file-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--ep-dark);
    border: 1px solid var(--ep-border);
    border-radius: 6px;
    padding: 16px 20px;
    transition: border-color .2s, box-shadow .2s;
}

.ep-file-card:hover {
    border-color: var(--ep-gold);
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

.ep-file-card .ep-file-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.ep-file-info {
    flex: 1;
    min-width: 0;
}

.ep-file-name {
    display: block;
    font-weight: 600;
    color: var(--ep-white);
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-file-meta {
    display: block;
    color: #888;
    font-size: .8rem;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.ep-file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.ep-btn {
    display: inline-block;
    padding: .5rem 1.2rem;
    font-size: .85rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    border: 2px solid transparent;
    font-family: var(--ep-font-b);
}

.ep-btn-view {
    background: transparent;
    color: var(--ep-gold);
    border-color: var(--ep-gold);
}

.ep-btn-view:hover {
    background: var(--ep-gold);
    color: var(--ep-dark);
}

.ep-btn-dl {
    background: var(--ep-blue);
    color: #fff;
    border-color: var(--ep-blue);
}

.ep-btn-dl:hover {
    background: #1a52d4;
    border-color: #1a52d4;
    color: #fff;
}

/* ============================================
   MESSAGES D'ÉTAT
   ============================================ */

.ep-message {
    padding: 1.5rem 2rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1rem;
    margin: 2rem auto;
    max-width: 500px;
}

.ep-message-error {
    background: rgba(192, 57, 43, .1);
    border: 1px solid rgba(192, 57, 43, .3);
    color: #e74c3c;
}

.ep-message-warn {
    background: rgba(212, 175, 55, .1);
    border: 1px solid var(--ep-border);
    color: var(--ep-gold);
}

.ep-no-files {
    text-align: center;
    color: #888;
    padding: 2rem;
    font-style: italic;
}

/* ============================================
   POPUP DE VISUALISATION
   ============================================ */

.ep-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: epFadeIn .25s ease;
}

@keyframes epFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ep-viewer-box {
    position: relative;
    width: 90vw;
    max-width: 1100px;
    height: 88vh;
    background: var(--ep-darker);
    border: 1px solid var(--ep-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: epSlideUp .25s ease;
}

@keyframes epSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.ep-viewer-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--ep-gold);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    padding: 0;
    transition: transform .15s, color .15s;
}
.ep-viewer-close:hover {
    transform: scale(1.2);
    color: #fff;
}

.ep-viewer-title {
    padding: 14px 48px 14px 20px;
    font-family: var(--ep-font-h);
    color: var(--ep-gold);
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--ep-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.ep-viewer-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
}

/* PDF dans iframe */
.ep-viewer-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Image dans la popup */
.ep-viewer-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Vidéo */
.ep-viewer-content video {
    max-width: 100%;
    max-height: 100%;
}

/* Audio */
.ep-viewer-content audio {
    width: 80%;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
    .ep-code-input {
        width: 40px;
        height: 52px;
        font-size: 1.3rem;
    }
    .ep-code-inputs { gap: 6px; }

    .ep-file-card {
        flex-wrap: wrap;
        gap: 10px;
    }
    .ep-file-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .ep-viewer-box {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}
