/* ============================================================
   MyCodeProduit — WIRQUIN
   Thème Bootstrap personnalisé (couleurs WIRQUIN)
   ============================================================ */

:root {
    --wirquin-blue: #1a56a0;
    --wirquin-blue-dark: #134080;
    --wirquin-blue-light: #e8f1fc;
    --wirquin-accent: #f5a623;
    --body-bg: #f0f4f8;
}

/* ---- Layout général ---- */
body {
    background-color: var(--body-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.container {
    flex: 1;
}

/* ---- Navbar ---- */
.navbar-wirquin {
    background-color: var(--wirquin-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.navbar-wirquin .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

.brand-icon {
    background: rgba(255, 255, 255, .15);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.brand-name {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    line-height: 1.1;
}

.brand-company {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, .65);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.navbar-wirquin .nav-link {
    color: rgba(255, 255, 255, .85) !important;
    font-weight: 500;
    transition: color .15s;
}

.navbar-wirquin .nav-link:hover,
.navbar-wirquin .nav-link.active {
    color: white !important;
}

.navbar-wirquin .nav-link.active {
    border-bottom: 2px solid var(--wirquin-accent);
}

.navbar-wirquin .dropdown-menu {
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

/* ---- Footer ---- */
.footer-wirquin {
    background: white;
    border-top: 1px solid #dee2e6;
    margin-top: auto;
}

/* ---- Bouton principal WIRQUIN ---- */
.btn-wirquin {
    background-color: var(--wirquin-blue);
    border-color: var(--wirquin-blue);
    color: white;
    font-weight: 600;
    transition: all .2s;
}

.btn-wirquin:hover,
.btn-wirquin:focus {
    background-color: var(--wirquin-blue-dark);
    border-color: var(--wirquin-blue-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 86, 160, .3);
}

/* ---- Login page ---- */
.login-page {
    background: linear-gradient(135deg, var(--wirquin-blue) 0%, #0d3a74 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
}

.login-header {
    background: var(--wirquin-blue-light);
    padding: 32px 32px 24px;
    border-bottom: 1px solid #d0e2f7;
}

.login-icon {
    width: 64px;
    height: 64px;
    background: var(--wirquin-blue);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.8rem;
    color: white;
}

.login-body {
    padding: 32px;
}

/* ---- Cards ---- */
.card {
    border: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    border-radius: 10px;
}

.card-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    border-radius: 10px 10px 0 0 !important;
    padding: 14px 20px;
}

.card-action {
    transition: transform .15s, box-shadow .15s;
    cursor: pointer;
}

.card-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .1) !important;
}

/* ---- Stat cards ---- */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.bg-primary-soft  { background: rgba(13, 110, 253, .12); }
.bg-success-soft  { background: rgba(25, 135, 84, .12); }
.bg-warning-soft  { background: rgba(255, 193, 7, .15); }
.bg-danger-soft   { background: rgba(220, 53, 69, .12); }
.bg-info-soft     { background: rgba(13, 202, 240, .12); }

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #212529;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 2px;
}

/* ---- Welcome banner ---- */
.welcome-banner {
    background: white;
    border-radius: 10px;
    padding: 24px 28px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    border-left: 4px solid var(--wirquin-blue);
}

/* ---- Upload zone ---- */
.upload-zone {
    position: relative;
    border: 2px dashed #c8d8ea;
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: #fafcff;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--wirquin-blue);
    background: var(--wirquin-blue-light);
}

.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* ---- Result display ---- */
.result-header {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.result-code-block {
    background: var(--wirquin-blue-light);
    border-radius: 10px;
    border: 1px solid #c8d8ea;
}

.code-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--wirquin-blue);
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
}

.code-label {
    font-size: 0.85rem;
    color: #495057;
}

/* Score circle */
.score-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 5px solid currentColor;
    position: relative;
}

.score-value {
    font-size: 1.4rem;
    font-weight: 800;
}

.score-success { color: #198754; border-color: #198754; background: rgba(25, 135, 84, .08); }
.score-warning { color: #ffc107; border-color: #ffc107; background: rgba(255, 193, 7, .08); }
.score-danger  { color: #dc3545; border-color: #dc3545; background: rgba(220, 53, 69, .08); }

/* Synthesis items */
.synth-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 14px;
}

.synth-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6c757d;
    margin-bottom: 4px;
}

.synth-value {
    font-size: 0.9rem;
    color: #212529;
}

/* ---- Tables ---- */
.table > :not(caption) > * > * {
    padding: .65rem 1rem;
}

.table thead th {
    background: #f8f9fa;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6c757d;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

/* ---- Progress bar ---- */
.progress {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
}

/* ---- Étapes de progression upload ---- */
.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.progress-step:last-child {
    border-bottom: none;
}

.step-icon {
    font-size: 1.15rem;
    color: #adb5bd;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.step-label {
    flex: 1;
    font-size: 0.9rem;
    color: #6c757d;
}

.step-status {
    width: 22px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* États */
.step-loading .step-icon { color: var(--wirquin-blue); }
.step-loading .step-label { color: #212529; font-weight: 500; }
.step-loading { background: var(--wirquin-blue-light); }

.step-done .step-icon { color: #198754; }
.step-done .step-label { color: #6c757d; }

.step-error .step-icon { color: #dc3545; }
.step-error .step-label { color: #dc3545; }

/* ---- Badges ---- */
.badge.fs-6 {
    font-size: 0.85rem !important;
}

/* ---- Breadcrumb ---- */
.breadcrumb-item a {
    color: var(--wirquin-blue);
}

/* ---- Admin nav tabs ---- */
.nav-tabs .nav-link {
    color: #6c757d;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: var(--wirquin-blue);
    border-bottom-color: var(--wirquin-blue);
    font-weight: 600;
}

/* ---- Font monospace ---- */
.font-monospace {
    font-family: 'Courier New', monospace;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .welcome-banner .d-flex {
        flex-direction: column;
    }
    .result-header .row > div {
        text-align: left !important;
    }
    .code-value {
        font-size: 1.6rem;
    }
    .score-circle {
        width: 70px;
        height: 70px;
    }
    .score-value {
        font-size: 1.1rem;
    }
}
