/* ==========================================================================
   SendMe — feuille de style principale
   Organisation : 1. Jetons · 2. Base · 3. Composants · 4. Pages · 5. Responsive
   ========================================================================== */

/* ---------------------------------------------------------------- */
/* 1. Jetons de design                                               */
/* ---------------------------------------------------------------- */

:root {
    --accent:        #6366f1;
    --accent-2:      #8b5cf6;
    --accent-soft:   color-mix(in srgb, var(--accent) 14%, transparent);
    --accent-ring:   color-mix(in srgb, var(--accent) 40%, transparent);

    --success:       #10b981;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --info:          #0ea5e9;

    /* Surfaces — thème sombre par défaut */
    --bg:            #0b0d13;
    --bg-2:          #0f121a;
    --surface:       #151926;
    --surface-2:     #1c2130;
    --surface-3:     #252b3d;
    --border:        #262c3d;
    --border-strong: #333b52;

    --text:          #eef1f8;
    --text-2:        #a7b0c4;
    --text-3:        #6f7a92;

    --radius-sm:  8px;
    --radius:     14px;
    --radius-lg:  20px;
    --radius-xl:  28px;

    --shadow-sm:  0 1px 2px rgba(0,0,0,.3);
    --shadow:     0 4px 24px -6px rgba(0,0,0,.45);
    --shadow-lg:  0 24px 60px -18px rgba(0,0,0,.6);

    --ease:       cubic-bezier(.4, 0, .2, 1);
    --ease-out:   cubic-bezier(.16, 1, .3, 1);
    --speed:      .22s;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    --header-h: 68px;
    --wrap:     1180px;
}

/* Thème clair */
:root[data-theme="light"] {
    --bg:            #f6f7fb;
    --bg-2:          #eef1f7;
    --surface:       #ffffff;
    --surface-2:     #f4f6fb;
    --surface-3:     #e8ecf5;
    --border:        #e2e7f0;
    --border-strong: #cbd3e1;

    --text:          #131722;
    --text-2:        #4a5268;
    --text-3:        #7b8499;

    --shadow-sm:  0 1px 2px rgba(16,24,40,.06);
    --shadow:     0 4px 24px -6px rgba(16,24,40,.12);
    --shadow-lg:  0 24px 60px -18px rgba(16,24,40,.18);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        --bg: #f6f7fb; --bg-2: #eef1f7; --surface: #fff; --surface-2: #f4f6fb;
        --surface-3: #e8ecf5; --border: #e2e7f0; --border-strong: #cbd3e1;
        --text: #131722; --text-2: #4a5268; --text-3: #7b8499;
        --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
        --shadow: 0 4px 24px -6px rgba(16,24,40,.12);
        --shadow-lg: 0 24px 60px -18px rgba(16,24,40,.18);
    }
}

/* ---------------------------------------------------------------- */
/* 2. Base                                                           */
/* ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Halo décoratif en arrière-plan */
body::before {
    content: "";
    position: fixed;
    inset: -30% 0 auto 0;
    height: 70vh;
    background:
        radial-gradient(60% 60% at 20% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
        radial-gradient(50% 50% at 85% 10%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%);
    filter: blur(20px);
    opacity: .55;
    pointer-events: none;
    z-index: 0;
}

img, svg, video { display: block; max-width: 100%; }

a { color: var(--accent); text-decoration: none; transition: color var(--speed) var(--ease); }
a:hover { color: var(--accent-2); }

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 650; letter-spacing: -.02em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
h3 { font-size: 1.1rem; }

code, kbd { font-family: var(--mono); font-size: .875em; }

::selection { background: var(--accent-ring); color: var(--text); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Barres de défilement */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 99px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* Les icônes restent dans le flux du texte (la règle svg{display:block}
   ci-dessus les ferait passer à la ligne au milieu d'un paragraphe). */
.icon, .icon-sm, .icon-lg {
    display: inline-block;
    vertical-align: middle;
    flex: none;
}
.icon { width: 20px; height: 20px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-sm { width: 16px; height: 16px; flex: none; }
.icon-lg { width: 28px; height: 28px; flex: none; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- */
/* 3. Mise en page                                                   */
/* ---------------------------------------------------------------- */

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: 20px;
    position: relative;
    z-index: 1;
}
.wrap-narrow { max-width: 780px; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--border);
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -.02em;
    color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-mark {
    display: grid;
    place-items: center;
    width: 36px; height: 36px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 6px 18px -6px var(--accent);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand small {
    display: block;
    font-size: .7rem;
    font-weight: 500;
    color: var(--text-3);
    letter-spacing: 0;
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.site-footer {
    margin-top: 72px;
    padding: 28px 0 40px;
    border-top: 1px solid var(--border);
    color: var(--text-3);
    font-size: .85rem;
    position: relative;
    z-index: 1;
}
.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.site-footer a { color: var(--text-2); }

main { position: relative; z-index: 1; padding-block: 40px 0; }

/* ---------------------------------------------------------------- */
/* 4. Composants                                                     */
/* ---------------------------------------------------------------- */

/* --- Carte --- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.card-pad { padding: clamp(20px, 4vw, 32px); }
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.card-head h2, .card-head h3 { font-size: 1rem; font-weight: 640; }

/* --- Boutons --- */
.btn {
    --btn-bg: var(--surface-2);
    --btn-fg: var(--text);
    --btn-bd: var(--border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid var(--btn-bd);
    border-radius: var(--radius-sm);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: .92rem;
    font-weight: 570;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: transform var(--speed) var(--ease),
                background var(--speed) var(--ease),
                border-color var(--speed) var(--ease),
                box-shadow var(--speed) var(--ease),
                opacity var(--speed) var(--ease);
}
.btn:hover { background: var(--surface-3); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled {
    opacity: .5; cursor: not-allowed; pointer-events: none;
}

.btn-primary {
    --btn-bd: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 8px 22px -10px var(--accent);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    filter: brightness(1.08);
    box-shadow: 0 12px 28px -10px var(--accent);
}

.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-outline { --btn-bg: transparent; }

.btn-danger { --btn-bd: transparent; background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); color: #fff; filter: brightness(1.1); }

.btn-sm { padding: 7px 12px; font-size: .84rem; border-radius: 7px; }
.btn-lg { padding: 15px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; }

/* --- Champs --- */
.field { margin-bottom: 18px; }
.field label,
.label {
    display: block;
    margin-bottom: 7px;
    font-size: .85rem;
    font-weight: 560;
    color: var(--text-2);
}
.hint { margin-top: 6px; font-size: .8rem; color: var(--text-3); }

.input, .select, .textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
    background: var(--surface);
}
.textarea { resize: vertical; min-height: 92px; line-height: 1.55; }
.select {
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8499' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.input-code {
    font-family: var(--mono);
    font-size: 1.4rem;
    letter-spacing: .28em;
    text-align: center;
    text-transform: uppercase;
    padding-block: 16px;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: .9rem;
    color: var(--text-2);
}
.checkbox input[type="checkbox"] {
    appearance: none;
    width: 19px; height: 19px;
    flex: none;
    margin-top: 1px;
    border: 1.5px solid var(--border-strong);
    border-radius: 5px;
    background: var(--bg-2);
    cursor: pointer;
    transition: all var(--speed) var(--ease);
}
.checkbox input[type="checkbox"]:checked {
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/13px no-repeat;
    border-color: var(--accent);
}
.checkbox input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .01em;
    background: var(--surface-3);
    color: var(--text-2);
    white-space: nowrap;
}
.badge-success { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.badge-warning { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.badge-danger  { background: color-mix(in srgb, var(--danger) 16%, transparent);  color: var(--danger); }
.badge-info    { background: color-mix(in srgb, var(--info) 16%, transparent);    color: var(--info); }
.badge-accent  { background: var(--accent-soft); color: var(--accent); }

/* --- Alertes --- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: .9rem;
    margin-bottom: 20px;
}
.alert svg { flex: none; margin-top: 1px; }
.alert-success { border-color: color-mix(in srgb, var(--success) 35%, transparent); background: color-mix(in srgb, var(--success) 10%, var(--surface)); color: var(--success); }
.alert-error   { border-color: color-mix(in srgb, var(--danger) 35%, transparent);  background: color-mix(in srgb, var(--danger) 10%, var(--surface));  color: var(--danger); }
.alert-warning { border-color: color-mix(in srgb, var(--warning) 35%, transparent); background: color-mix(in srgb, var(--warning) 10%, var(--surface)); color: var(--warning); }
.alert-info    { border-color: color-mix(in srgb, var(--info) 30%, transparent);    background: color-mix(in srgb, var(--info) 8%, var(--surface));     color: var(--text-2); }
.alert strong { color: inherit; }

/* --- Bulle d'aide / accordéon --- */
.help-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
    font-size: .9rem;
    font-weight: 560;
    color: var(--text-2);
    transition: all var(--speed) var(--ease);
}
.help-toggle:hover { border-color: var(--border-strong); color: var(--text); }
.help-toggle .chev { margin-left: auto; transition: transform var(--speed) var(--ease); }
.help-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

.help-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .3s var(--ease-out);
}
.help-panel.is-open { grid-template-rows: 1fr; }
.help-panel > div { overflow: hidden; }

.steps { display: grid; gap: 14px; padding: 18px 4px 4px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
    display: grid; place-items: center;
    width: 28px; height: 28px; flex: none;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .82rem;
    font-weight: 700;
}
.step p { font-size: .88rem; color: var(--text-2); }
.step strong { display: block; color: var(--text); font-size: .92rem; margin-bottom: 2px; }

/* --- Copie de lien --- */
.copy-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 6px 6px 6px 16px;
}
.copy-row input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font-family: var(--mono);
    font-size: .88rem;
    color: var(--text);
}
.copy-row input:focus { outline: none; }
.copy-row .btn { flex: none; }

/* --- Table --- */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
    white-space: nowrap;
}
table.data th {
    text-align: left;
    font-weight: 600;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-3);
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    position: sticky;
    top: 0;
}
table.data td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.data tbody tr { transition: background var(--speed) var(--ease); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .wrap-cell { white-space: normal; min-width: 220px; }

/* --- État vide --- */
.empty {
    display: grid;
    place-items: center;
    gap: 12px;
    padding: 56px 20px;
    text-align: center;
    color: var(--text-3);
}
.empty svg { width: 44px; height: 44px; opacity: .4; }
.empty p { font-size: .92rem; }

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 24px;
}
.pagination a, .pagination span {
    min-width: 36px;
    padding: 7px 11px;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-align: center;
    font-size: .85rem;
    color: var(--text-2);
    background: var(--surface);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}
.pagination .disabled { opacity: .4; }

/* --- Bascule de thème --- */
.theme-toggle {
    display: grid;
    place-items: center;
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    transition: all var(--speed) var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) .theme-toggle .icon-sun { display: block; }
    :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}

/* --- Notification éphémère --- */
.toast-stack {
    position: fixed;
    right: 20px; bottom: 20px;
    z-index: 200;
    display: grid;
    gap: 10px;
    max-width: min(360px, calc(100vw - 40px));
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    font-size: .88rem;
    animation: toast-in .28s var(--ease-out);
}
.toast.is-out { animation: toast-out .2s var(--ease) forwards; }
.toast-success { border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.toast-success svg { color: var(--success); }
.toast-error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.toast-error svg { color: var(--danger); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
    to { opacity: 0; transform: translateX(20px); }
}

/* ---------------------------------------------------------------- */
/* 5. Page d'envoi                                                   */
/* ---------------------------------------------------------------- */

.hero { text-align: center; margin-bottom: 34px; }
.hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    margin-bottom: 16px;
    border-radius: 99px;
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    color: var(--accent);
    font-size: .78rem;
    font-weight: 600;
}
.hero h1 {
    background: linear-gradient(135deg, var(--text) 30%, var(--accent) 130%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 12px;
}
.hero p { color: var(--text-2); max-width: 560px; margin-inline: auto; font-size: 1.02rem; }

/* --- Zone de dépôt --- */
.dropzone {
    position: relative;
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 300px;
    padding: 44px 24px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-xl);
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    cursor: pointer;
    text-align: center;
    transition: border-color var(--speed) var(--ease),
                background var(--speed) var(--ease),
                transform var(--speed) var(--ease-out);
    overflow: hidden;
}
.dropzone:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.dropzone.is-dragging {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 11%, var(--surface));
    transform: scale(1.008);
}
.dropzone.is-dragging .dz-cloud { transform: translateY(-6px) scale(1.06); }
.dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.dz-cloud {
    display: grid;
    place-items: center;
    width: 78px; height: 78px;
    margin-bottom: 6px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 16px 40px -14px var(--accent);
    transition: transform .3s var(--ease-out);
}
.dz-cloud svg { width: 34px; height: 34px; }
.dz-title { font-size: 1.22rem; font-weight: 640; letter-spacing: -.02em; }
.dz-sub { color: var(--text-2); font-size: .92rem; }
.dz-or {
    display: flex; align-items: center; gap: 12px;
    width: 180px; margin: 6px 0;
    color: var(--text-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
}
.dz-or::before, .dz-or::after {
    content: ""; flex: 1; height: 1px; background: var(--border);
}
.dz-meta {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px;
    margin-top: 14px; font-size: .8rem; color: var(--text-3);
}
.dz-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* --- Liste des fichiers --- */
.file-list { display: grid; gap: 10px; margin-top: 22px; }

.file-row {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    animation: row-in .3s var(--ease-out);
    transition: border-color var(--speed) var(--ease);
}
.file-row.is-error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.file-row.is-done  { border-color: color-mix(in srgb, var(--success) 35%, transparent); }

@keyframes row-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.file-thumb {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    border-radius: 11px;
    background: var(--surface-3);
    color: var(--text-2);
    overflow: hidden;
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb.cat-image  { background: color-mix(in srgb, var(--info) 16%, transparent);    color: var(--info); }
.file-thumb.cat-video  { background: color-mix(in srgb, var(--accent-2) 18%, transparent); color: var(--accent-2); }
.file-thumb.cat-audio  { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.file-thumb.cat-archive{ background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.file-thumb.cat-doc    { background: color-mix(in srgb, var(--danger) 14%, transparent);  color: var(--danger); }
.file-thumb.cat-design { background: var(--accent-soft); color: var(--accent); }

.file-info { min-width: 0; }
.file-name {
    font-size: .92rem;
    font-weight: 560;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-sub {
    display: flex; align-items: center; gap: 8px;
    margin-top: 3px;
    font-size: .78rem;
    color: var(--text-3);
}
.file-sub .status-text { color: var(--text-2); }
.file-row.is-error .file-sub .status-text { color: var(--danger); }
.file-row.is-done  .file-sub .status-text { color: var(--success); }

.file-actions { display: flex; align-items: center; gap: 6px; }

/* --- Barre de progression --- */
.progress {
    height: 5px;
    margin-top: 8px;
    border-radius: 99px;
    background: var(--surface-3);
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .25s var(--ease);
}
.file-row.is-done .progress-bar { background: var(--success); }
.file-row.is-error .progress-bar { background: var(--danger); }

.progress-shine {
    position: relative;
    overflow: hidden;
}
.progress-shine::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
    animation: shine 1.4s linear infinite;
}
@keyframes shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* --- Résumé global --- */
.upload-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 22px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.summary-stats { display: flex; flex-wrap: wrap; gap: 20px; }
.summary-stat .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.summary-stat .v { font-size: 1.1rem; font-weight: 640; }

.global-progress {
    width: 100%;
    height: 7px;
    margin-top: 14px;
    border-radius: 99px;
    background: var(--surface-3);
    overflow: hidden;
}
.global-progress .bar {
    height: 100%; width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 99px;
    transition: width .3s var(--ease);
}

/* --- Écran de succès --- */
.success-panel {
    text-align: center;
    padding: clamp(28px, 6vw, 52px);
    animation: pop-in .45s var(--ease-out);
}
@keyframes pop-in {
    from { opacity: 0; transform: scale(.96) translateY(10px); }
    to   { opacity: 1; transform: none; }
}
.success-icon {
    display: grid; place-items: center;
    width: 74px; height: 74px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--success) 16%, transparent);
    color: var(--success);
    animation: check-pop .5s .1s var(--ease-out) backwards;
}
.success-icon svg { width: 36px; height: 36px; stroke-width: 2.5; }
@keyframes check-pop {
    0%   { transform: scale(.4); opacity: 0; }
    60%  { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
.success-panel h2 { margin-bottom: 8px; }
.success-panel > p { color: var(--text-2); margin-bottom: 26px; }
.success-actions {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
    margin-top: 22px;
}

/* --- Barrière d'invitation --- */
.gate {
    max-width: 460px;
    margin: clamp(24px, 6vh, 60px) auto;
    text-align: center;
}
.gate-icon {
    display: grid; place-items: center;
    width: 64px; height: 64px;
    margin: 0 auto 20px;
    border-radius: 20px;
    background: var(--accent-soft);
    color: var(--accent);
}
.gate-icon svg { width: 28px; height: 28px; }

/* ---------------------------------------------------------------- */
/* 6. Pages de partage                                               */
/* ---------------------------------------------------------------- */

.share-head {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 24px;
}
.share-head .file-thumb { width: 60px; height: 60px; border-radius: 16px; }
.share-head .file-thumb svg { width: 26px; height: 26px; }
.share-title { min-width: 0; flex: 1; }
.share-title h1 {
    font-size: clamp(1.25rem, 3.4vw, 1.75rem);
    word-break: break-word;
    margin-bottom: 6px;
}
.share-meta {
    display: flex; flex-wrap: wrap; gap: 8px 16px;
    font-size: .85rem; color: var(--text-3);
}
.share-meta span { display: inline-flex; align-items: center; gap: 6px; }

.preview-frame {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border);
    margin-bottom: 22px;
    display: grid;
    place-items: center;
    min-height: 200px;
}
.preview-frame img,
.preview-frame video { width: 100%; max-height: 68vh; object-fit: contain; }
.preview-frame audio { width: 100%; padding: 28px 20px; }
.preview-frame iframe { width: 100%; height: 74vh; border: 0; background: #fff; }

.share-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }

.batch-files { display: grid; gap: 8px; }
.batch-file {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.batch-file:hover { border-color: var(--border-strong); transform: translateX(2px); }
.batch-file .file-thumb { width: 42px; height: 42px; }

.message-box {
    padding: 16px 18px;
    margin-bottom: 22px;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: .93rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------------------------------------------------------------- */
/* 7. Page d'erreur                                                  */
/* ---------------------------------------------------------------- */

.error-page {
    display: grid;
    place-items: center;
    min-height: 74vh;
    text-align: center;
    padding: 20px;
}
.error-code {
    font-size: clamp(4rem, 16vw, 8rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.05em;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}
.error-page h1 { margin-bottom: 10px; }
.error-page p { color: var(--text-2); margin-bottom: 26px; max-width: 460px; }

/* ---------------------------------------------------------------- */
/* 8. Aide                                                           */
/* ---------------------------------------------------------------- */

.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    margin-top: 20px;
}
.format-card {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.format-card h3 {
    display: flex; align-items: center; gap: 9px;
    font-size: .95rem; margin-bottom: 10px;
}
.format-card .ext-list {
    display: flex; flex-wrap: wrap; gap: 5px;
}
.format-card .ext {
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--surface-2);
    font-family: var(--mono);
    font-size: .74rem;
    color: var(--text-2);
}

/* ---------------------------------------------------------------- */
/* 9. Utilitaires                                                    */
/* ---------------------------------------------------------------- */

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-2); }
.text-dim { color: var(--text-3); }
.text-sm { font-size: .85rem; }
.text-xs { font-size: .78rem; }
.mono { font-family: var(--mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }
.full { width: 100%; }

/* ---------------------------------------------------------------- */
/* 10. Responsive                                                    */
/* ---------------------------------------------------------------- */

@media (max-width: 780px) {
    body { font-size: 14.5px; }
    main { padding-block: 26px 0; }
    .wrap { padding-inline: 16px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .dropzone { min-height: 240px; padding: 34px 18px; }
    .dz-cloud { width: 64px; height: 64px; border-radius: 20px; }
    .dz-cloud svg { width: 28px; height: 28px; }
    .dz-title { font-size: 1.08rem; }
    .upload-summary { flex-direction: column; align-items: stretch; }
    .upload-summary .btn { width: 100%; }
    .summary-stats { justify-content: space-between; }
    .share-head { flex-direction: column; gap: 12px; }
    .share-actions .btn { flex: 1 1 auto; }
    .toast-stack { right: 12px; left: 12px; bottom: 12px; max-width: none; }
    .site-footer .wrap { flex-direction: column; text-align: center; }
    .brand small { display: none; }
}

@media (max-width: 480px) {
    .file-row { grid-template-columns: 38px 1fr auto; gap: 10px; padding: 11px 12px; }
    .file-thumb { width: 38px; height: 38px; border-radius: 9px; }
    .btn { padding: 10px 15px; }
    .input-code { font-size: 1.1rem; letter-spacing: .2em; }
}

/* Impression */
@media print {
    .site-header, .site-footer, .share-actions, .btn, .toast-stack { display: none !important; }
    body::before { display: none; }
    body { background: #fff; color: #000; }
}

/* Préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
