
:root {
    /* ── Palette marque ── */
    --accent:        #35C8DE;   /* cyan  — accent principal  */
    --accent2:       #CD077E;   /* rose  — accent secondaire */
    --accent3:       #20a8bc;   /* cyan foncé — hover/succès */

    /* ── Fond clair ── */
    --bg:            #f4f5f7;
    --surface:       #ffffff;
    --surface2:      #fafbfc;
    --border:        #dde1e9;

    /* ── Texte ── */
    --text:          #212529;
    --text-muted:    #7a8499;

    --radius: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #dde8f4 0%, #f0f4f8 50%, #e8f4f8 100%);
    min-height: 100vh;
}

/* ── BACKGROUND GRID ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* debut navbar css */
/* ============================
   NAVBAR – Application
============================ */
.navbar-app {
   background-color: #1a3354;
}

.navbar-app .navbar-brand {
    color: white;
}

.navbar-app .navbar-brand strong {
    color: var(--accent);
}

.navbar-panda {
    width: 36px; height: 36px;
    border-radius: 50%;
    background-color: #1a3354;
    overflow: hidden; flex-shrink: 0;
}

.navbar-panda img { width: 100%; height: 100%; object-fit: cover; }

.btn-deconnexion {
    background: transparent;
    color: #fff;
    border: 1px solid var(--accent) !important;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    padding: 6px 16px;
    cursor: pointer;
    transition: all .2s;
}

.btn-deconnexion:hover {
    background: var(--accent);
    color: #fff;
}

/* ── TABS ── */
.tabs-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    gap: 4px;
    padding: 24px 40px 0;
}

.tab {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: .85rem;
    padding: 10px 24px;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    background: #eceef2;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .2s;
    letter-spacing: .2px;
}

.tab:hover {
    color: var(--text);
    background: var(--surface);
}

.tab.active {
    background: var(--surface2);
    color: var(--text);
    border-color: var(--border);
    position: relative;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--surface2);
}

.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: middle;
}

/* ── MAIN PANEL ── */
main {
    position: relative;
    z-index: 10;
    border: 1px solid var(--border);
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    margin: 0 40px 40px;
    background: var(--surface2);
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(33, 37, 41, .06);
}

.panel {
    display: none;
    padding: 32px;
}

.panel.active {
    display: block;
}

/* ── SECTION TITLES ── */
.section-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.section-title .num {
    font-size: .7rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    padding: 2px 8px;
    background: rgba(53, 200, 222, .12);
    border-radius: 4px;
    color: var(--accent3);
}

/* ── DROP ZONE ── */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all .25s;
    position: relative;
    background: var(--surface);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(53, 200, 222, .04);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.drop-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: .6;
}

.drop-text {
    color: var(--text-muted);
    font-size: .85rem;
    line-height: 1.6;
}

.drop-text strong {
    color: var(--text);
    font-weight: 600;
}

/* ── THUMBNAILS GRID ── */
.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.thumb-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    cursor: grab;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}

.thumb-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(53, 200, 222, .15);
}

.thumb-card.dragging {
    opacity: .4;
}

.thumb-card.drag-over {
    border-color: var(--accent2);
    border-style: dashed;
}

.thumb-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.thumb-info {
    padding: 6px 8px;
    font-size: .65rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(205, 7, 126, .85);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: .75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s;
}

.thumb-card:hover .thumb-remove {
    opacity: 1;
}

/* ── ACTIONS BAR ── */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}



/* ── BOUTONS BASE ── */
.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: .8rem;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 7px;
    letter-spacing: .2px;
}

.btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}


.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent3);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(53, 200, 222, .35);
}

/* Rose — action destructrice */
.btn-danger {
    background: rgba(205, 7, 126, .08);
    color: var(--accent2);
    border: 1px solid rgba(205, 7, 126, .25);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(205, 7, 126, .16);
}

/* Cyan léger — action secondaire positive */
.btn-success {
    background: rgba(53, 200, 222, .1);
    color: var(--accent3);
    border: 1px solid rgba(53, 200, 222, .3);
}

.btn-success:hover:not(:disabled) {
    background: rgba(53, 200, 222, .2);
}

/* Neutre */
.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
    color: var(--text);
    border-color: var(--text-muted);
}

/* ── CROP MODAL ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(33, 37, 41, .6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.crop-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    width: min(700px, 95vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(33, 37, 41, .15);
}

.crop-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.crop-box-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.crop-box-close {
    background: var(--border);
    border: none;
    color: var(--text);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.crop-box-close:hover {
    background: var(--accent2);
    color: #fff;
}

/* ── CROP CANVAS ── */
#crop-container {
    position: relative;
    display: inline-block;
    cursor: crosshair;
    max-width: 100%;
}

#crop-canvas {
    display: block;
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
}

#crop-selection {
    position: absolute;
    border: 2px solid var(--accent);
    background: rgba(53, 200, 222, .12);
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(33, 37, 41, .35);
}

.thumb-check {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
    z-index: 2;
}

/* ── PDF LIST ── */
.pdf-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.pdf-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: grab;
    transition: border-color .15s, box-shadow .15s;
}

.pdf-item:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 10px rgba(53, 200, 222, .1);
}

.pdf-item.dragging {
    opacity: .4;
}

.pdf-item.drag-over {
    border-color: var(--accent2);
    border-style: dashed;
}

.pdf-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pdf-name {
    font-size: .8rem;
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-size {
    font-size: .7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.pdf-remove {
    background: none;
    border: none;
    color: var(--accent2);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 4px;
    opacity: .5;
    transition: opacity .15s;
}

.pdf-remove:hover {
    opacity: 1;
}

.drag-handle {
    color: var(--text-muted);
    font-size: .9rem;
    cursor: grab;
}

/* ── STATUS BAR ── */
.status {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: .8rem;
    display: none;
}

.status.show {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status.info {
    background: rgba(53, 200, 222, .08);
    border: 1px solid rgba(53, 200, 222, .25);
    color: var(--accent3);
}

.status.success {
    background: rgba(53, 200, 222, .08);
    border: 1px solid rgba(53, 200, 222, .25);
    color: var(--accent3);
}

.status.error {
    background: rgba(205, 7, 126, .08);
    border: 1px solid rgba(205, 7, 126, .25);
    color: var(--accent2);
}

/* ── MERGE OPTIONS ── */
.merge-options {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.radio-card {
    flex: 1;
    min-width: 130px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
}

.radio-card:has(input:checked) {
    border-color: var(--accent);
    background: rgba(53, 200, 222, .06);
}

.radio-card input {
    accent-color: var(--accent);
}

.radio-label {
    font-size: .8rem;
    color: var(--text-muted);
}

.radio-card:has(input:checked) .radio-label {
    color: var(--text);
}

/* ── PROGRESS ── */
.progress-bar {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
    display: none;
}

.progress-bar.show {
    display: block;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transition: width .3s;
    width: 0%;
}

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: .85rem;
}

.empty-state .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: .4;
}

/* ── HINT ── */
.hint {
    font-size: .72rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ── DIVIDER ── */
hr.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 28px 0;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    header {
        padding: 16px 20px;
    }

    .tabs-wrapper {
        padding: 20px 20px 0;
    }

    main {
        margin: 0 20px 20px;
    }

    .panel {
        padding: 20px;
    }
}
/* ═══════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════ */

body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 2rem;
}

.login-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 900px;
    width: 100%;
    background: var(--surface);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 8px 40px rgba(33, 37, 41, .12);
    animation: slideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Panneau gauche ── */

.login-brand {
    background: #1a3354;
    padding: 3rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -40%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(53, 200, 222, 0.12) 0%, transparent 65%);
    animation: rotateBg 22s linear infinite;
}

@keyframes rotateBg {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.brand-logo-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    overflow: hidden;
}

.brand-logo-circle img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.brand-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

/* ── Panneau droit ── */

.login-form-panel {
    padding: 3rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
}

.form-content {
    width: 100%;
    max-width: 360px;
}

.form-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.form-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

/* Alert */

.alert-custom {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    border: 1px solid;
}

.alert-custom.alert-danger {
    background: rgba(205, 7, 126, .07);
    border-color: rgba(205, 7, 126, .25);
    color: var(--accent2);
}

/* Form */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    transition: color .2s;
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    color: var(--text);
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(53, 200, 222, 0.1);
}

.input-wrapper:focus-within .input-icon {
    color: var(--accent3);
}

/* Bouton */

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: #fff;
    background: #1a3354;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(26, 51, 84, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    transition: left .4s ease;
}

.btn-submit:hover {
    background: #1e3d5e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 51, 84, 0.4);
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:active {
    transform: translateY(0);
}

/* Footer */

.form-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--bg-surface);
    line-height: 1.6;
}

.form-footer a {
    color: #1a3354;
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    color: var(--accent);
}

@media (max-width: 640px) {
    .login-wrapper {
        grid-template-columns: 1fr;
    }

    .login-brand {
        padding: 2rem 1.5rem;
    }

    .login-form-panel {
        padding: 2rem 1.5rem;
    }
}