/* =========================================================
   🌐 BASE GLOBAL
========================================================= */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial;
    margin: 0;
    background: #f5f6f8;
    color: #222;
}

/* =========================================================
   🔐 LOGIN (PAGE D'ACCÈS)
========================================================= */

.login-body {
    background: #f5f6f8;
    font-family: Arial, sans-serif;

    /* centrage propre mobile + desktop */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: min(420px, 92vw);
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,.15);
    text-align: center;
}

.login-box input[type="password"],
.login-box input[type="text"] {
    width: 100%;
    padding: 14px;
    margin: 20px 0;
    border-radius: 10px;
    border: 1px solid #ddd;
    box-sizing: border-box;
}

.login-box button {
    width: 100%;
    padding: 14px;
    border: 0;
    border-radius: 10px;
    background: #111;
    color: white;
    cursor: pointer;
}

.toggle {
    font-size: 14px;
    margin-bottom: 10px;
}

.error { color: red; }
.warn { color: orange; }

/* =========================================================
   📌 HEADER
========================================================= */

header {
    padding: 25px;
    background: white;
    position: sticky;
    top: 0;
    text-align: center;
    z-index: 10;
}

h1 {
    margin-top: 0;
}

/* =========================================================
   🔍 INPUT RECHERCHE (explorateur)
========================================================= */

input {
    width: 100%;
    max-width: 600px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #ccc;
    font-size: 16px;
}

/* alias si tu utilises input-password */
.input-password {
    width: 100%;
    max-width: 600px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #ccc;
    font-size: 16px;
    margin: 20px 0;
}

/* =========================================================
   FILTERS
========================================================= */

.filters {
  padding: 10px;
  display: flex;
  justify-content: center;   /* 👈 centre horizontalement */
  gap: 20px;
}

.filters label {
  font-size: 14px;
  cursor: pointer;
}

.filters input {
  margin-right: 5px;
}

/* =========================================================
   📁 STRUCTURE EXPLORATEUR
========================================================= */

main {
    max-width: 900px;
    margin: auto;
    padding: 20px;
}

.card {
    background: white;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 3px 12px #0001;
    overflow: hidden;
}

.folder-title {
    width: 100%;
    border: 0;
    background: white;
    padding: 20px;
    font-size: 18px;
    text-align: left;
    cursor: pointer;
}

.folder-title small {
    display: block;
    color: #666;
    margin-top: 5px;
}

.content {
    display: none;
    padding: 15px 25px;
    background-color: #CBCBCB52;
}

.open .content {
    display: block;
}

.file,
.subfolder {
    display: block;
    padding: 10px;
}

.subfolder {
    background: #fafafa;
    border-radius: 10px;
    margin-bottom: 10px;
}

a {
    color: #1565c0;
    text-decoration: none;
}

/* séparation fichiers */
.separator {
    border: 0;
    border-top: 1px solid #66666669;
    margin: 18px 0;
}

/* =========================================================
   📄 PDF VIEWER
========================================================= */

#pdfViewer {
    display: none;
    position: fixed;
    inset: 0;
    background: white;
    z-index: 9999;
}

#pdfViewer iframe {
    width: 100%;
    height: calc(100vh - 60px);
    border: 0;
}

.pdf-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    box-shadow: 0 2px 8px #0002;
}

.pdf-header button,
.pdf-header a {
    padding: 10px 15px;
    border-radius: 8px;
    border: 0;
    background: #eee;
    cursor: pointer;
    text-decoration: none;
    color: #222;
}

/* =========================================================
   TEASER
========================================================= */

.teaser-link {
  color: #1565c0;
  text-decoration: none;
  padding: 10px;
}

/* =========================================================
   📦 ZIP BUTTON
========================================================= */

.zip-button {
    padding: 10px;
}

/* =========================================================
   🔽 BOTTOM BAR
========================================================= */

.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: white;
    box-shadow: 0 -3px 12px #0002;
    display: flex;
    justify-content: center;
    z-index: 1000;
}

.bottom-bar a {
    padding: 12px 20px;
    border-radius: 12px;
    background: #f4f7ff;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}

/* =========================================================
   👁️ PASSWORD TOGGLE (OEIL)
========================================================= */

.eye-toggle {
    position: relative;
    display: flex;
    align-items: center;
}

.eye-toggle input {
    width: 100%;
    padding-right: 40px;
}

.eye-button {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 45px !important;
}

.eye-icon {
    display: block;
    width: 18px;
    height: 12px;
    border: 2px solid #999;
    border-radius: 50% / 60%;
    position: relative;
}

.eye-icon::after {
    content: "";
    width: 5px;
    height: 5px;
    background: #999;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.eye-off::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 2px;
    background: #999;
    transform: rotate(-35deg);
    left: -3px;
    top: 5px;
}


/* =========================================================
    Retour au site
========================================================= */
    .back-site {
        display: block;
        margin-top: 20px;
        padding: 10px 14px;
        border-radius: 10px;
        background: #f2f2f2;
        color: #333;
        text-decoration: none;
        font-size: 14px;
    }

    .back-site:hover {
        background: #e6e6e6;
    }

/* =========================================================
   📱 RESPONSIVE MOBILE
========================================================= */

@media (max-width: 768px) {

    /* login plus confortable */
    .login-box {
        padding: 28px 18px;
        border-radius: 14px;
    }

    /* titres plus lisibles */
    h1 {
        font-size: 20px;
    }

    /* contenu plus compact */
    main {
        padding: 12px;
    }

    .folder-title {
        font-size: 16px;
        padding: 16px;
    }

    .content {
        padding: 12px 15px;
    }

    /* PDF viewer optimisation mobile */
    #pdfViewer iframe {
        height: calc(100vh - 50px);
    }

    .pdf-header {
        height: 50px;
        padding: 8px 12px;
    }

    .pdf-header button,
    .pdf-header a {
        padding: 8px 10px;
        font-size: 14px;
    }

    /* bottom bar plus légère */
    .bottom-bar {
        padding: 10px;
    }

    .bottom-bar a {
        padding: 10px 14px;
        font-size: 14px;
    }
}