:root {
    --brand: #00ed00;
    --bg: #0b0f0d;
    --card: #111815;
    --card2: #0f1512;
    --text: #e8f2ec;
    --muted: #9bb0a3;
    --border: rgba(255, 255, 255, .10);
    --shadow: 0 12px 30px rgba(0, 0, 0, .35);
    --radius: 18px;
    --focus: 0 0 0 3px rgba(0, 237, 0, .25);
    --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

[data-theme="light"] {
    --bg: #f6faf7;
    --card: #ffffff;
    --card2: #f4f8f5;
    --text: #0f1a13;
    --muted: #51665a;
    --border: rgba(0, 0, 0, .10);
    --shadow: 0 12px 30px rgba(0, 0, 0, .10);
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    /* ✅ plus de scroll global */
    font-family: var(--font);
    background: radial-gradient(1200px 600px at 20% 0%, rgba(0, 237, 0, .10), transparent 60%),
        radial-gradient(900px 500px at 90% 10%, rgba(0, 237, 0, .07), transparent 55%),
        var(--bg);
    color: var(--text);
}

.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* important pour les scroll internes */
}

a {
    color: inherit;
    text-decoration: none
}

h1,
h2 {
    margin: 0 0 6px 0
}

p {
    margin: 0
}

.topbar {
    z-index: 20;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card)
}

.brandName {
    font-weight: 750;
    letter-spacing: .2px;
}

.brandTag {
    font-size: 13px;
    color: var(--muted)
}

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

.container {
    flex: 1;
    /* ✅ prend toute la hauteur dispo */
    min-height: 0;
    /* ✅ autorise les enfants à scroller */
    overflow: auto;
    /* ✅ pas de scroll sur le container */
    max-width: 1150px;
    margin: 16px auto;
    padding: 0 18px 16px;
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 16px;
    align-items: stretch;
    /* ✅ les colonnes s'étirent pareil */
}



.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0)), var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.cardHeader {
    padding: 18px 18px 10px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(0, 237, 0, .10), transparent 70%);
}

.cardHeader .muted {
    margin-top: 6px
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 18px;
    min-height: 0;
    overflow: auto;
    /* ✅ scroll interne */
}

.field {
    display: flex;
    flex-direction: column;
}



.field.full {
    grid-column: 1 / -1
}

label {
    font-size: 13px;
    color: var(--muted);
}

input,
select,
textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text);
    padding: 12px 12px;
    outline: none;
    transition: box-shadow .15s ease, border-color .15s ease, transform .05s ease;
}

textarea {
    min-height: 140px;
    max-height: 300px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(0, 237, 0, .45);
    box-shadow: var(--focus);
}

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

.metaRow {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}

.muted {
    color: var(--muted)
}

.small {
    font-size: 12px
}

.hint {
    font-size: 12px
}

.btn {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0)), var(--card2);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: transform .06s ease, box-shadow .15s ease, border-color .15s ease;
    user-select: none;
}

.btn:hover {
    border-color: rgba(0, 237, 0, .35)
}

.btn:active {
    transform: translateY(1px)
}

.btn:focus {
    outline: none;
    box-shadow: var(--focus)
}

.btn.primary {
    background: linear-gradient(180deg, rgba(0, 237, 0, .22), rgba(0, 237, 0, .08));
    border-color: rgba(0, 237, 0, .45);
}

.btn.ghost {
    background: transparent
}

.btn.danger {
    border-color: rgba(255, 80, 80, .35)
}

.btn.danger:hover {
    border-color: rgba(255, 80, 80, .55)
}

.btn.tiny {
    padding: 7px 10px;
    border-radius: 12px;
    font-size: 12px
}

.tinyActions {
    display: flex;
    gap: 8px
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.customExpiry {
    display: flex;
    gap: 10px
}

.customExpiry input {
    max-width: 140px
}

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

.passRow input {
    flex: 1
}

.uploadBox {
    border: 1px dashed rgba(0, 237, 0, .35);
    background: linear-gradient(180deg, rgba(0, 237, 0, .10), transparent 65%);
    border-radius: 16px;
    padding: 14px;
}

.uploadBox:focus {
    outline: none;
    box-shadow: var(--focus)
}

.uploadTitle {
    font-weight: 650
}

.uploadSub {
    margin-top: 4px;
    font-size: 12px
}

.uploadActions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* cache visuellement mais laisse l'input "existant" pour que click() marche */
.uploadActions input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.fileList {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px
}

.fileItem {
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--card2);
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.fileItem .name {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px
}

.fileItem .meta {
    font-size: 12px;
    color: var(--muted)
}

.fileItem .remove {
    font-size: 12px
}

.preview {
    align-self: start;
    min-height: 0;
}

.previewBody {
    min-height: 0;
    overflow: auto;
    padding: 16px 18px;
}

.previewMeta {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px
}

.previewArea {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--card2);
    overflow: auto;
    min-height: 220px;
    white-space: pre-wrap;
    /* ⬅️ conserve les retours à la ligne */
    word-break: break-word;
    /* évite les débordements */
}

.previewArea pre {
    margin: 0
}

.previewArea code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace
}

.resultBody {
    padding: 16px 18px
}

.resultRow {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap
}

.resultRow input {
    flex: 1;
    min-width: 240px
}

.resultInfo {
    margin: 10px 0 14px;
    color: var(--muted);
    font-size: 12px
}

.footer {
    padding: 10px 18px 14px;
}

.hidden {
    display: none !important
}

/* ===========================
   Scrollbar Sofitex (Cards)
   =========================== */

/* ===========================
   Scrollbar Sofitex (Global)
   =========================== */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 237, 0, .55) transparent;
}

/* Webkit (Chrome, Edge, Safari) */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
            rgba(0, 237, 0, .85),
            rgba(0, 237, 0, .45));
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: content-box;
}

/* Hover */
*:hover::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
            rgba(0, 237, 0, 1),
            rgba(0, 237, 0, .65));
}

/* Active */
*::-webkit-scrollbar-thumb:active {
    background: rgba(0, 237, 0, 1);
}

/* Marges haut/bas */
*::-webkit-scrollbar-track-piece:start {
    margin-top: 6px;
}

*::-webkit-scrollbar-track-piece:end {
    margin-bottom: 6px;
}


/* ===========================
   Modal "À propos"
   =========================== */

.modalOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(10px);
    display: grid;
    place-items: center;
    padding: 18px;
    z-index: 999;
}

.modal {
    width: min(860px, 100%);
    max-height: min(84vh, 760px);
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: linear-gradient(180deg, rgba(0, 237, 0, .10), transparent 40%), var(--card);
    display: flex;
    flex-direction: column;
}

.modalHeader {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.modalKicker {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: .2px;
}

.modalHeader h2 {
    margin: 2px 0 0 0;
}

.modalBody {
    padding: 14px 16px;
    overflow: auto;
    /* ✅ scroll interne du modal */
    min-height: 0;
}

.aboutGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 820px) {
    .aboutGrid {
        grid-template-columns: 1fr;
    }

}

.aboutCard {
    border: 1px solid var(--border);
    background: var(--card2);
    border-radius: 16px;
    padding: 12px 12px;
}

.aboutCard h3 {
    margin: 0 0 6px 0;
    font-size: 14px;
}

.aboutWide {
    grid-column: 1 / -1;
}

.aboutList {
    margin: 0;
    padding-left: 16px;
    color: var(--text);
}

.aboutList li {
    margin: 6px 0;
}

.callout {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(0, 237, 0, .35);
    background: linear-gradient(180deg, rgba(0, 237, 0, .14), transparent 70%);
    color: var(--text);
    font-size: 13px;
}

.modalFooter {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.hidden {
    display: none !important;
}

/* ===========================
   Sélecteur langue
   =========================== */

.langSelect {
    appearance: none;
    border-radius: 14px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text);
    font-family: var(--font);
    cursor: pointer;
}

.langSelect:focus {
    outline: none;
    box-shadow: var(--focus);
}

/* Overlay derrière le drawer résultat */
.resultOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    /* + sombre */
    backdrop-filter: blur(6px);
    z-index: 49;
    /* juste sous la card */
}

/* Card résultat centrée */
#resultCard {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    width: min(720px, calc(100% - 36px));
    max-height: min(80vh, 520px);
}

/* (optionnel) un petit style pour mieux respirer */
#resultCard .resultBody {
    overflow: auto;
}

@keyframes pop {
    0% {
        transform: translateY(0) scale(1);
    }

    40% {
        transform: translateY(-1px) scale(1.06);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

.btn.copied {
    border-color: rgba(0, 237, 0, .65) !important;
    box-shadow: 0 0 0 3px rgba(0, 237, 0, .18);
    animation: pop 220ms ease;
}

.langWrap {
    display: flex;
    align-items: center;
    gap: .5rem;
}

#langFlag {
    font-size: 1.1rem;
}

/* Background layers */
#starfield {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -99;
    display: block;
}

.bg-glow {
    position: fixed;
    inset: -20%;
    background:
        radial-gradient(600px 400px at 20% 30%, rgba(122, 162, 255, .12), transparent 60%),
        radial-gradient(700px 480px at 80% 40%, rgba(169, 193, 255, .10), transparent 62%),
        radial-gradient(900px 650px at 50% 90%, rgba(255, 255, 255, .05), transparent 70%);
    filter: blur(20px);
    z-index: -99;
    pointer-events: none;
}

@media (max-width: 980px) {
    .container {
        grid-template-columns: 1fr
    }

    .preview {
        display: none;
    }

}

@media (max-width: 640px) {

    .topbar {
        padding: 10px 12px;
        /* moins épais */
        gap: 10px;
        flex-wrap: wrap;
        /* autorise 2 lignes */
        align-items: center;
    }

    .brand {
        flex: 1 1 100%;
        /* prend la ligne */
        min-width: 0;
        /* permet ellipsis */
        gap: 10px;
    }

    .logo {
        width: 32px;
        /* plus petit */
        height: 32px;
        border-radius: 9px;
    }

    .brandText {
        min-width: 0;
    }

    .brandName {
        font-size: 15px;
        /* un poil plus petit */
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        /* évite l’explosion */
        max-width: 100%;
    }

    .brandTag {
        display: none;
        /* le plus efficace */
        /* Si tu préfères garder une ligne :
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    */
    }

    .topActions {
        flex: 1 1 100%;
        /* 2e ligne */
        justify-content: flex-start;
        /* ou flex-end si tu veux */
        gap: 8px;
    }

    /* Boutons plus compacts sur mobile */
    .topActions .btn {
        padding: 8px 10px;
        border-radius: 12px;
        font-size: 12px;
    }

    /* Lang select + drapeau plus compact */
    .langSelect {
        padding: 7px 9px;
        border-radius: 12px;
        font-size: 12px;
    }

    .langWrap img {
        width: 16px;
        height: 16px;
    }
    /* body{
        overflow: auto;
    } */
    .cardHeader .muted{
        display: none;
    }
    .grid{
        overflow-x: hidden;
    }
    .filed-mobile{
        margin-bottom: 50px;
    }
}