<style>
/* =========================================================
   BPOS LOGIN — PRIVATE DESIGN SYSTEM
   Mobile First / Premium / Independent
   Ne dépend PAS du CSS de l'application principale
========================================================= */


/* =========================================================
   1. FONT
========================================================= */

@font-face {
    font-family: 'NotoSans';
    src: url('../vendors/fonts/NotoSans-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* =========================================================
   2. VARIABLES
========================================================= */

:root {
    --bpos-radius-sm: 0.625rem;
    --bpos-radius: 0.875rem;
    --bpos-radius-lg: 1.25rem;
    --bpos-radius-xl: 1.5rem;

    /* Accent principal */
    --bpos-accent: #38bdf8;

    /* Identité bleue */
    --bpos-brand-green: #2563eb;
    --bpos-brand-green-dark: #1d4ed8;
    --bpos-brand-green-light: #60a5fa;

    /* Accent secondaire */
    --bpos-brand-orange: #f59e0b;

    /* Couleurs pastel */
    --bpos-pastel-green: #bfdbfe;
    --bpos-pastel-peach: #dbeafe;

    /* Focus */
    --bpos-focus: rgba(37, 99, 235, 0.22);

    /* Transitions */
    --bpos-transition-fast: 150ms;
    --bpos-transition: 220ms;
    --bpos-transition-slow: 400ms;
}


/* =========================================================
   3. LIGHT THEME — BLUE ICE
========================================================= */

[data-theme="light"] {

    /* Arrière-plans */
    --bpos-bg: #f3f7fd;
    --bpos-fg: #172b4d;

    /* Surfaces et cartes */
    --bpos-card: rgba(255, 255, 255, 0.96);

    /* Primaire */
    --bpos-primary: #2563eb;
    --bpos-primary-hover: #1d4ed8;
    --bpos-primary-fg: #ffffff;

    /* Secondaire */
    --bpos-secondary: #eaf1fb;
    --bpos-secondary-fg: #243b5a;

    /* Éléments discrets */
    --bpos-muted: #eaf0f8;
    --bpos-muted-fg: #71819a;

    /* Accent */
    --bpos-accent-bg: #e0f2fe;

    /* Champs de formulaire */
    --bpos-input-bg: rgba(255, 255, 255, 0.90);
    --bpos-input-border: #d4e0f0;

    /* Actions destructives */
    --bpos-destructive: #dc3545;
    --bpos-destructive-bg: #fff1f2;

    /* Bordures */
    --bpos-border: rgba(37, 70, 120, 0.10);

    /* Ombres */
    --bpos-shadow:
        0 24px 60px -20px rgba(37, 75, 135, 0.16);

    --bpos-shadow-soft:
        0 8px 24px rgba(37, 75, 135, 0.07);

    --bpos-shadow-glow:
        0 0 28px rgba(37, 99, 235, 0.13);

    /* Superpositions */
    --bpos-overlay:
        rgba(243, 247, 253, 0.80);

    /* Surfaces système */
    --bpos-system-soft:
        rgba(37, 99, 235, 0.08);
}


/* =========================================================
   4. DARK THEME — DEEP BLUE
========================================================= */

[data-theme="dark"] {

    /* Arrière-plans */
    --bpos-bg: #0b1220;
    --bpos-fg: #e8f0ff;

    /* Surfaces et cartes */
    --bpos-card: rgba(18, 29, 49, 0.97);

    /* Primaire */
    --bpos-primary: #60a5fa;
    --bpos-primary-hover: #93c5fd;
    --bpos-primary-fg: #0b1220;

    /* Secondaire */
    --bpos-secondary: #17243a;
    --bpos-secondary-fg: #dce8fa;

    /* Éléments discrets */
    --bpos-muted: #1b2a42;
    --bpos-muted-fg: rgba(220, 232, 250, 0.64);

    /* Accent */
    --bpos-accent-bg: rgba(56, 189, 248, 0.12);

    /* Champs de formulaire */
    --bpos-input-bg: rgba(255, 255, 255, 0.035);
    --bpos-input-border: rgba(147, 197, 253, 0.14);

    /* Actions destructives */
    --bpos-destructive: #fb7185;
    --bpos-destructive-bg: rgba(251, 113, 133, 0.10);

    /* Bordures */
    --bpos-border: rgba(191, 219, 254, 0.09);

    /* Ombres */
    --bpos-shadow:
        0 30px 90px -30px rgba(0, 0, 0, 0.85);

    --bpos-shadow-soft:
        0 10px 30px rgba(0, 0, 0, 0.28);

    --bpos-shadow-glow:
        0 0 32px rgba(96, 165, 250, 0.17);

    /* Superpositions */
    --bpos-overlay:
        rgba(11, 18, 32, 0.82);

    /* Surfaces système */
    --bpos-system-soft:
        rgba(96, 165, 250, 0.10);
}

/* =========================================================
   5. RESET
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    font-size: 16px;
}

body {
    min-height: 100vh;

    margin: 0;

    font-family:
        'NotoSans',
        'Inter',
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        sans-serif;

    color: var(--bpos-fg);

    background-color: var(--bpos-bg);

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    text-rendering: optimizeLegibility;
}


/* =========================================================
   6. GLOBAL INTERACTION
========================================================= */

button,
input,
textarea,
select {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: none;
}


/* =========================================================
   7. ICON BUTTON
========================================================= */

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    border: 1px solid var(--bpos-border);
    border-radius: var(--bpos-radius-sm);

    background: transparent;
    color: var(--bpos-fg);

    cursor: pointer;

    transition:
        background-color var(--bpos-transition-fast) ease,
        border-color var(--bpos-transition-fast) ease,
        transform var(--bpos-transition-fast) ease;
}

.icon-btn:hover {
    background: var(--bpos-system-soft);
    border-color: rgba(25, 122, 67, 0.22);
}

.icon-btn:active {
    transform: scale(0.96);
}


/* =========================================================
   8. LOGIN WRAPPER
========================================================= */

.bpos-wrapper {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 100vh;
    min-height: 100svh;

    padding: 20px;

    overflow: hidden;

    background:
        radial-gradient(
            70% 55% at 0% 0%,
            var(--bpos-pastel-green) 0%,
            transparent 72%
        ),
        radial-gradient(
            70% 55% at 100% 0%,
            var(--bpos-pastel-peach) 0%,
            transparent 72%
        ),
        var(--bpos-bg);
}


/* Subtile couche de profondeur */

.bpos-wrapper::before {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;

    background:
        radial-gradient(
            circle at 50% 100%,
            rgba(25, 122, 67, 0.06),
            transparent 42%
        );
}


/* =========================================================
   9. CONTAINER
========================================================= */

.bpos-container {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 430px;

    margin: auto;
}


/* =========================================================
   10. PLANS / STEPS
========================================================= */

.bpos-plan {
    display: none;

    opacity: 0;
}

.bpos-plan.active {
    display: block;
    opacity: 1;
}

.bpos-plan.slide-in-left {
    animation:
        bpos-slide-left
        420ms
        cubic-bezier(0.22, 1, 0.36, 1)
        forwards;
}

.bpos-plan.slide-in-right {
    animation:
        bpos-slide-right
        420ms
        cubic-bezier(0.22, 1, 0.36, 1)
        forwards;
}

.bpos-plan.fade-out {
    animation:
        bpos-fade-out
        300ms
        cubic-bezier(0.22, 1, 0.36, 1)
        forwards;
}

.bpos-plan.scale-in {
    animation:
        bpos-scale-in
        360ms
        cubic-bezier(0.22, 1, 0.36, 1)
        forwards;
}


/* =========================================================
   11. CARD
========================================================= */

.bpos-card,
.bpos-loading-screen {
    width: 100%;

    background: var(--bpos-card);

    border: 1px solid var(--bpos-border);
    border-radius: var(--bpos-radius-xl);

    box-shadow: var(--bpos-shadow);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.bpos-card {
    padding: 24px;
}

.bpos-card > * + * {
    margin-top: 1.5rem;
}

.bpos-center {
    text-align: center;
}


/* =========================================================
   12. TYPOGRAPHY
========================================================= */

.bpos-title {
    color: var(--bpos-fg);

    font-size: clamp(1.45rem, 5vw, 1.75rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.bpos-title-sm {
    color: var(--bpos-fg);

    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.25;
}

.bpos-subtitle {
    margin-top: 7px;

    color: var(--bpos-muted-fg);

    font-size: 0.875rem;
    line-height: 1.6;
}

.bpos-subtitle.connexion {
    margin-top: 5px;

    font-size: 0.78rem;
    line-height: 1.5;
    text-align: left;
}

.bpos-form-title {
    margin-top: 1.5rem;
    margin-bottom: 0;

    color: var(--bpos-muted-fg);

    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;

    letter-spacing: 0.12em;
    text-align: center;
    text-transform: uppercase;
}

.bpos-loading-text {
    color: var(--bpos-muted-fg);

    font-size: 0.875rem;
    line-height: 1.5;

    letter-spacing: 0.02em;
}

.bpos-footer-text {
    color: var(--bpos-muted-fg);

    font-size: 0.8125rem;
    line-height: 1.5;
}


/* =========================================================
   13. CARD HEADER / FOOTER
========================================================= */

.bpos-card-header {
    text-align: center;
}

.bpos-card-header > * + * {
    margin-top: 0.55rem;
}

.bpos-card-footer {
    padding-top: 0.25rem;

    text-align: center;
}


/* =========================================================
   14. LOGO
========================================================= */

.logo {
    position: relative;

    display: inline-block;

    font-family:
        'Inter',
        'NotoSans',
        sans-serif;

    font-size: clamp(1.75rem, 7vw, 2.15rem);
    font-weight: 900;

    line-height: 1;

    letter-spacing: -0.055em;

    color: var(--bpos-brand-green);

    text-align: left;
}
.logo img {
    width: 40px;
}

/* =========================================================
   15. LOADING SCREEN
========================================================= */

.bpos-loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 300px;

    padding: 48px 24px;

    gap: 24px;
}


/* =========================================================
   16. SPINNER
========================================================= */

.bpos-spinner {
    width: 40px;
    height: 40px;

    border: 3px solid var(--bpos-muted);
    border-top-color: var(--bpos-primary);

    border-radius: 50%;

    animation: bpos-spin 900ms linear infinite;
}

.bpos-spinner-lg {
    width: 58px;
    height: 58px;

    border-width: 4px;
}


/* =========================================================
   17. FORM
========================================================= */

.bpos-form > * + * {
    margin-top: 14px;
}


/* =========================================================
   18. INPUT GROUP
========================================================= */

.bpos-input-group {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    min-height: 50px;

    padding: 8px 13px;

    border: 1.5px solid var(--bpos-input-border);
    border-radius: var(--bpos-radius);

    background: var(--bpos-input-bg);

    transition:
        border-color var(--bpos-transition) ease,
        box-shadow var(--bpos-transition) ease,
        background-color var(--bpos-transition) ease;
}

.bpos-input-group:hover {
    border-color: rgba(25, 122, 67, 0.25);
}

.bpos-input-group.focused {
    border-color: var(--bpos-primary);

    background: var(--bpos-card);

    box-shadow: var(--bpos-shadow-glow);
}

.bpos-input-group.has-error {
    border-color: var(--bpos-destructive);
    box-shadow: 0 0 0 3px rgba(220, 61, 61, 0.08);
}


/* =========================================================
   19. INPUT ICON
========================================================= */

.bpos-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 20px;
    min-width: 20px;

    color: var(--bpos-muted-fg);

    transition:
        color var(--bpos-transition-fast) ease,
        transform var(--bpos-transition-fast) ease;
}

.bpos-input-group.focused .bpos-input-icon {
    color: var(--bpos-primary);
    transform: scale(1.04);
}


/* =========================================================
   20. INPUT
========================================================= */

.bpos-input {
    flex: 1;

    width: 100%;
    min-width: 0;
    min-height: 32px;

    border: none;
    outline: none;

    background: transparent;

    color: var(--bpos-fg);

    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
}

.bpos-input::placeholder {
    color: var(--bpos-muted-fg);
    opacity: 0.85;
}


/* =========================================================
   21. ERROR
========================================================= */

.bpos-error {
    min-height: 18px;

    color: var(--bpos-destructive);

    font-size: 0.75rem;
    line-height: 1.4;
}


/* =========================================================
   22. PRIMARY BUTTON
========================================================= */

.bpos-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 50px;

    padding: 12px 16px;

    border: 0;
    border-radius: var(--bpos-radius);

    background:
        linear-gradient(
            135deg,
            var(--bpos-brand-green-light),
            var(--bpos-brand-green)
        );

    color: #fff;

    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;

    line-height: 1;

    letter-spacing: 0.015em;

    cursor: pointer;

    box-shadow:
        0 8px 20px rgba(25, 122, 67, 0.18);

    transition:
        transform var(--bpos-transition-fast) ease,
        box-shadow var(--bpos-transition-fast) ease,
        opacity var(--bpos-transition-fast) ease;
}

.bpos-btn-primary:hover {
    opacity: 0.96;

    box-shadow:
        0 10px 25px rgba(25, 122, 67, 0.24);

    transform: translateY(-1px);
}

.bpos-btn-primary:active {
    transform: translateY(0) scale(0.985);
}


/* =========================================================
   23. SECONDARY BUTTON
========================================================= */

.bpos-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 50px;

    padding: 12px 16px;

    border: 1px solid var(--bpos-border);
    border-radius: var(--bpos-radius);

    background: var(--bpos-secondary);
    color: var(--bpos-secondary-fg);

    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;

    cursor: pointer;

    transition:
        background-color var(--bpos-transition-fast) ease,
        border-color var(--bpos-transition-fast) ease,
        transform var(--bpos-transition-fast) ease;
}

.bpos-btn-secondary:hover {
    background: var(--bpos-muted);
    border-color: rgba(25, 122, 67, 0.16);
}

.bpos-btn-secondary:active {
    transform: scale(0.985);
}


/* =========================================================
   24. BUTTON ROW
========================================================= */

.bpos-btn-row {
    display: flex;
    flex-direction: column;

    gap: 10px;
}


/* =========================================================
   25. LINK BUTTON
========================================================= */

.bpos-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 32px;

    margin-top: 4px;
    padding: 4px;

    border: none;

    background: transparent;
    color: var(--bpos-primary);

    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;

    cursor: pointer;

    transition:
        opacity var(--bpos-transition-fast) ease,
        color var(--bpos-transition-fast) ease;
}

.bpos-link:hover {
    opacity: 0.78;
}

.bpos-link:active {
    transform: scale(0.98);
}


/* =========================================================
   26. STEP INDICATOR
========================================================= */

.bpos-steps {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;
}

.bpos-step-dot {
    height: 5px;

    border-radius: 999px;

    transition:
        width var(--bpos-transition-slow) ease,
        background-color var(--bpos-transition-slow) ease;
}

.bpos-step-dot.active {
    width: 30px;
    background: var(--bpos-primary);
}

.bpos-step-dot.inactive {
    width: 9px;
    background: var(--bpos-muted);
}


/* =========================================================
   27. RESULT SCREENS
========================================================= */

.bpos-result > * + * {
    margin-top: 14px;
}

.bpos-processing {
    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 42px 0;
}

.bpos-processing > * + * {
    margin-top: 22px;
}

.bpos-result {
    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 32px 0;
}


/* =========================================================
   28. SUCCESS / ERROR ICON
========================================================= */

.bpos-success-icon,
.bpos-error-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 76px;
    height: 76px;

    border-radius: 50%;
}

.bpos-success-icon {
    background: var(--bpos-accent-bg);
}

.bpos-error-icon {
    background: var(--bpos-destructive-bg);
}


/* =========================================================
   29. CHECK ANIMATION
========================================================= */

.bpos-check-path {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;

    animation:
        bpos-check
        600ms
        ease
        forwards
        200ms;
}


/* =========================================================
   30. FULL SCREEN LOADING
========================================================= */

#loading-overlay {
    position: fixed;
    inset: 0;

    display: none;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    padding: 24px;

    background: var(--bpos-overlay);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    z-index: 9999;
}


/* =========================================================
   31. FULL SCREEN SPINNER
========================================================= */

.spinner {
    width: 54px;
    height: 54px;

    border: 4px solid var(--bpos-muted);
    border-top-color: var(--bpos-primary);

    border-radius: 50%;

    animation:
        bpos-login-spin
        850ms
        linear
        infinite;
}


/* =========================================================
   32. ANIMATIONS
========================================================= */

@keyframes bpos-fade-out {

    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-14px);
    }
}


@keyframes bpos-slide-left {

    from {
        opacity: 0;
        transform: translateX(45px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}


@keyframes bpos-slide-right {

    from {
        opacity: 0;
        transform: translateX(-45px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}


@keyframes bpos-scale-in {

    from {
        opacity: 0;
        transform: scale(0.94);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


@keyframes bpos-spin {

    to {
        transform: rotate(360deg);
    }
}


@keyframes bpos-login-spin {

    to {
        transform: rotate(360deg);
    }
}


@keyframes bpos-check {

    to {
        stroke-dashoffset: 0;
    }
}


@keyframes bpos-logo-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.035);
        opacity: 0.88;
    }
}


.bpos-logo-pulse {
    animation:
        bpos-logo-pulse
        2.4s
        ease-in-out
        infinite;
}


/* =========================================================
   33. TABLET
========================================================= */

@media (min-width: 600px) {

    .bpos-wrapper {
        padding: 32px;
    }

    .bpos-card {
        padding: 30px;
    }

    .bpos-btn-row {
        flex-direction: row;
    }

    .bpos-btn-row > * {
        flex: 1;
    }
}


/* =========================================================
   34. DESKTOP
========================================================= */

@media (min-width: 900px) {

    .bpos-wrapper {
        padding: 40px;
    }

    .bpos-container {
        max-width: 440px;
    }

    .bpos-card {
        padding: 32px;
    }

    .bpos-title {
        font-size: 1.75rem;
    }
}


/* =========================================================
   35. LARGE DESKTOP
========================================================= */

@media (min-width: 1200px) {

    .bpos-container {
        max-width: 450px;
    }

    .bpos-card {
        padding: 34px;
    }
}


/* =========================================================
   36. DARK MODE REFINEMENTS
========================================================= */

[data-theme="dark"] .bpos-wrapper {
    background:
        radial-gradient(
            70% 55% at 0% 0%,
            rgba(38, 105, 66, 0.28) 0%,
            transparent 72%
        ),
        radial-gradient(
            70% 55% at 100% 0%,
            rgba(150, 90, 35, 0.18) 0%,
            transparent 72%
        ),
        var(--bpos-bg);
}

[data-theme="dark"] .bpos-card,
[data-theme="dark"] .bpos-loading-screen {
    border-color: rgba(255, 255, 255, 0.075);
}

[data-theme="dark"] .bpos-input-group.focused {
    background: rgba(72, 185, 120, 0.035);
}

[data-theme="dark"] .bpos-btn-primary {
    color: var(--bpos-primary-fg);

    box-shadow:
        0 8px 24px rgba(72, 185, 120, 0.16);
}


/* =========================================================
   37. SMALL PHONES
========================================================= */

@media (max-width: 380px) {

    .bpos-wrapper {
        padding: 12px;
    }

    .bpos-card {
        padding: 20px 16px;
        border-radius: var(--bpos-radius-lg);
    }

    .bpos-title {
        font-size: 1.35rem;
    }

    .bpos-subtitle {
        font-size: 0.8125rem;
    }

    .bpos-input-group {
        min-height: 48px;
        padding: 7px 11px;
    }

    .bpos-btn-primary,
    .bpos-btn-secondary {
        min-height: 48px;
    }
}


/* =========================================================
   38. REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }

    .bpos-plan,
    .bpos-spinner,
    .spinner,
    .bpos-check-path,
    .bpos-logo-pulse {
        animation: none !important;
    }

    .bpos-input-group,
    .bpos-btn-primary,
    .bpos-btn-secondary,
    .bpos-link,
    .icon-btn,
    .bpos-step-dot {
        transition: none !important;
    }
}
</style>