/* Animations et transitions */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes animateGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Spinner de chargement */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(27, 160, 128, 0.3);
    border-top-color: #1ba080;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 300;
    padding: 0;
    margin: 0;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ded9d8;
    overflow: hidden;
    background: linear-gradient(-45deg, #86442e, #822246, #145f78, #147860);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

.gradient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background: linear-gradient(-45deg, #86442e, #82224e, #145f78, #147860);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

#canvas {
    display: none;
}

.container {
    width: 100%;
    background: rgba(10, 18, 24, 0.9);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(222, 217, 216, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(222, 217, 216, 0.08);
    position: relative;
    z-index: 3;
    animation: fadeIn 0.8s ease-out;
    transition: max-width 0.5s ease;
}

.container.size-s {
    max-width: 650px;
}

.container.size-m {
    max-width: 700px;
}

.container.size-l {
    max-width: 750px;
}

.container.size-s + .container-glow {
    width: 700px;
    height: 404px;
}

.container.size-m + .container-glow {
    width: 700px;
    height: 500px;
}

.container.size-l + .container-glow {
    width: 750px;
    height: 600px;
}

.container-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    border-radius: 25px;
    pointer-events: none;
    transition: width 0.5s ease, height 0.5s ease;
}

.container-glow:after {
    position: absolute;
    content: '';
    top: 0;
    left: 0;
    right: 0;
    z-index: -1;
    height: 100%;
    width: 100%;
    margin: 0 auto;
    transform: scale(0.95);
    filter: blur(20px);
    background: linear-gradient(
        45deg,
        #3a5f7d,
        #0a1218,
        #3a5f7d,
        #0a1218,
        #3a5f7d
    );
    background-size: 200% 200%;
    animation: animateContourGlow 15s ease-in-out infinite;
}

header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(222, 217, 216, 0.08);
    padding: 20px 0;
    position: relative;
    min-height: 60px;
}

.menu-icon {
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    left: 0;
}

.menu-icon:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.logo {
    font-size: 30px;
    font-weight: bold;
    letter-spacing: 1px;
    transition: font-size 0.3s ease, text-shadow 0.3s ease;
    text-shadow: 0 0 10px rgba(222, 217, 216, 0.5);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo:hover {
    text-shadow: 0 0 15px rgba(222, 217, 216, 0.8);
}

.brand-logo {
    width: 24px;
    height: 24px;
    opacity: 0.8;
    transition: all 0.3s ease;
    position: absolute;
    right: 0;
}

.brand-logo:hover {
    opacity: 1;
    transform: rotate(10deg);
}

.brand-logo svg {
    width: 100%;
    height: 100%;
}

main {
    text-align: center;
}

.litecoin-coin {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    animation: fadeIn 0.8s ease-out 0.2s both;
    transition: all 0.5s ease;
}

.litecoin-coin.compact {
    transform: scale(0.6) translateY(-20px);
    margin-bottom: 15px;
    opacity: 0.8;
}

.litecoin-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.4));
    transition: all 0.5s ease;
}

.litecoin-coin.compact .litecoin-logo {
    width: 80px;
    height: 80px;
}

.litecoin-logo:hover {
    transform: translateY(-5px) scale(1.02);
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.5)) brightness(1.1);
}

h1 {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.2;
    animation: fadeIn 0.8s ease-out 0.4s both;
    transition: all 0.5s ease;
}

h1.compact {
    font-size: 18px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.description {
    font-size: 16px;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.4;
    animation: fadeIn 0.8s ease-out 0.6s both;
    transition: all 0.5s ease;
}

.description.compact {
    font-size: 12px;
    margin-bottom: 15px;
    opacity: 0.7;
}

.anonymization-form {
    margin-bottom: 30px;
    animation: fadeIn 0.8s ease-out 0.8s both;
}

.input-group {
    margin-bottom: 15px;
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 15px 20px;
    background: rgba(20, 30, 40, 0.3);
    border: 1px solid rgba(58, 95, 125, 0.3);
    border-radius: 8px;
    color: #ded9d8;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.input-group input::placeholder {
    color: rgba(124, 141, 159, 0.6);
}

.input-group input:focus {
    outline: none;
    border-color: rgba(58, 95, 125, 0.8);
    background: rgba(20, 30, 40, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.input-group:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 5%;
    width: 90%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(58, 95, 125, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.input-group:focus-within:before {
    opacity: 1;
}

.submit-btn {
    width: 100%;
    padding: 15px 20px;
    color: #ffffff;
    border: 0;
    border-radius: 8px;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 21px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    appearance: none;
    outline: 0;
    background: linear-gradient(135deg, #145f78, #822246);
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
    box-shadow: 
        0 4px 15px rgba(20, 95, 120, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.submit-btn.compact-btn {
    width: 160px;
    padding: 12px 20px;
    font-size: 16px;
    margin: 20px auto 0 auto;
    display: block;
    border: 2px solid rgba(20, 95, 120, 0.3);
    box-shadow: 
        0 2px 10px rgba(20, 95, 120, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.submit-btn.compact-btn.success {
    background: linear-gradient(135deg, #1ba080, #16a085);
    border-color: rgba(27, 160, 128, 0.5);
    box-shadow: 
        0 2px 10px rgba(27, 160, 128, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(20, 95, 120, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background-position: 100% 0;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(20, 95, 120, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.small-text {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 8px;
    /*font-style: italic;*/
    animation: fadeIn 0.8s ease-out 1s both;
}

.small-text:last-child {
    margin-bottom: 0;
}

.glow-background {
    position: fixed;
    width: 600px;
    height: 600px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -2;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    background: linear-gradient(270deg, #0a1218, #3a5f7d, #0a1218);
    background-size: 300% 300%;
    animation: animateGlow 15s ease infinite;
    pointer-events: none;
}

@keyframes animateGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Responsive Design */
@media (max-width: 600px) {
    .glow-background {
        width: 400px;
        height: 400px;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 20px;
        padding: 30px;
        max-width: none;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 28px;
    }
    
    .litecoin-logo {
        width: 120px;
        height: 120px;
    }

    .glow-background {
        width: 350px;
        height: 350px;
    }

    header {
        margin-bottom: 30px;
        padding-bottom: 10px;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 20px;
        margin: 15px;
        border-radius: 12px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .description {
        font-size: 14px;
    }
    
    .input-group input,
    .submit-btn {
        padding: 12px 15px;
    }

    .input-group input {
        font-size: 14px;
    }

    .submit-btn {
        font-size: 18px;
    }

    .litecoin-logo {
        width: 100px;
        height: 100px;
    }

    .glow-background {
        width: 300px;
        height: 300px;
    }
}

.grainy-background {
    display: none;
}

/* États et transitions */
.hidden {
    display: none !important;
}

/* Header compact */
header.compact {
    margin-bottom: 20px;
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
}

header.compact .logo {
    font-size: 30px;
    text-shadow: 0 0 10px rgba(222, 217, 216, 0.5);
}

/* Logo Litecoin dans le header compact */
header.compact .litecoin-coin-header {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: -10px;
    position: absolute;
    right: 0;
    margin-bottom: 5px;
}

header.compact .litecoin-coin-header .litecoin-logo {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

.litecoin-coin {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    animation: fadeIn 0.8s ease-out 0.2s both;
    transition: all 0.5s ease;
}

.litecoin-coin.moving-to-header {
    transform: scale(0.25) translateY(-200px) translateX(150px);
    opacity: 0;
    pointer-events: none;
}

.litecoin-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.4));
    transition: all 0.5s ease;
}

.litecoin-logo:hover {
    transform: translateY(-5px) scale(1.02);
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.5)) brightness(1.1);
}

/* Étapes de génération */
.generation-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.step {
    background: rgba(20, 30, 40, 0.3);
    border: 1px solid rgba(58, 95, 125, 0.3);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.step::before {
    content: '';
    position: absolute;
    top: -15px;
    left: calc(50% - 15px);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    z-index: 2;
    background: rgba(100, 100, 100, 0.5);
    color: white;
    line-height: 30px;
    text-align: center;
}

.step.blurred::before {
    content: '⏳';
    background: rgba(100, 100, 100, 0.5);
    animation: hourglass-spin 2s linear infinite;
}

.step.in-progress::before {
    content: '⏳';
    background: linear-gradient(135deg, #ff8c00, #ff6347);
    animation: hourglass-spin 2s linear infinite;
}

.step.completed::before {
    content: '✓';
    background: linear-gradient(135deg, #1ba080, #16a085);
    animation: none;
}

.step-number {
    display: none;
}

.step.blurred .step-number {
    display: none;
}

.step.blurred .step-number::before {
    display: none;
}

.step.in-progress .step-number {
    display: none;
}

.step.in-progress .step-number::before {
    display: none;
}

.step.completed .step-number {
    display: none;
}

.step.completed .step-number::before {
    display: none;
}

.step.completed .step-number::after {
    display: none;
}

.step.highlighted {
    background: rgba(20, 95, 120, 0.2);
    border-color: rgba(20, 95, 120, 0.6);
    box-shadow: 0 0 20px rgba(20, 95, 120, 0.2);
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #ded9d8;
    font-weight: 600;
}

.step-note {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 8px;
    font-style: italic;
}

.step.blurred {
    filter: blur(2px);
    opacity: 0.6;
    pointer-events: none;
}

.step.blurred::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.7;
    animation: none;
}

.step.unblurred {
    filter: none;
    opacity: 1;
    pointer-events: auto;
    transition: all 0.5s ease;
}

.step.in-progress {
    background: rgba(255, 165, 0, 0.2);
    border-color: rgba(255, 165, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.3);
}

.step.completed {
    background: rgba(27, 160, 128, 0.2);
    border-color: rgba(27, 160, 128, 0.8);
    box-shadow: 0 0 20px rgba(27, 160, 128, 0.3);
}

/* Icônes en arrière-plan des conteneurs */
.step.blurred .memo-container::before,
.step.blurred .address-container::before,
.step.blurred .input-container::before,
.step.in-progress .memo-container::before,
.step.in-progress .address-container::before,
.step.in-progress .input-container::before {
    display: none;
}

.step.completed .memo-container::before,
.step.completed .address-container::before,
.step.completed .input-container::before {
    display: none;
}

/* Conteneurs d'input */
.memo-container,
.address-container,
.input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 10px 0;
    position: relative;
}

.receive-address,
.memo-field,
.send-address {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(58, 95, 125, 0.3);
    border-radius: 8px;
    background: rgba(20, 30, 40, 0.5);
    color: #ded9d8;
    font-size: 14px;
    font-family: 'Source Sans Pro', sans-serif;
    transition: all 0.3s ease;
    outline: none;
    text-align: center;
    position: relative;
    z-index: 1;
}

.receive-address {
    font-family: 'Source Sans Pro', sans-serif;
    letter-spacing: normal;
}

.input-container .receive-address.valid {
    border-color: rgba(27, 160, 128, 0.8) !important;
    background: rgba(27, 160, 128, 0.1) !important;
}

.input-container .receive-address.invalid {
    border-color: rgba(231, 60, 126, 0.8) !important;
    background: rgba(231, 60, 126, 0.1) !important;
}

.receive-address:focus {
    outline: none;
    border-color: rgba(20, 95, 120, 0.8);
    background: rgba(10, 18, 24, 0.9);
    box-shadow: 0 0 10px rgba(20, 95, 120, 0.3);
}

.blurred-text {
    filter: blur(3px);
    pointer-events: none;
}

.copy-btn {
    padding: 12px 16px;
    background: linear-gradient(135deg, #145f78, #822246);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.copy-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 95, 120, 0.4);
}

.copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Validation */
.validation-status {
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
    white-space: nowrap;
}

.validation-status.valid {
    color: #1ba080;
}

.validation-status.invalid {
    color: #e73c7e;
}

.input-container {
    flex-direction: column;
    align-items: stretch;
}

.input-container .validation-status {
    margin-left: 0;
    margin-top: 2px;
    text-align: center;
}

/* Bouton Generate désactivé */
.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Responsive pour les nouvelles étapes */
@media (max-width: 768px) {
    .container {
        max-width: none;
        margin: 15px;
    }
    
    .step {
        flex-direction: column;
        gap: 10px;
    }
    
    .step-number {
        align-self: flex-start;
    }
    
    .memo-container,
    .address-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .memo-field,
    .send-address,
    .receive-address {
        font-size: 12px;
    }
    
    .copy-btn {
        align-self: stretch;
    }
}

@media (max-width: 480px) {
    .step {
        padding: 15px;
    }
    
    .step-content h3 {
        font-size: 14px;
    }
    
    .step-note {
        font-size: 11px;
    }
}

/* Étape unique initiale */
.single-step {
    background: rgba(20, 95, 120, 0.2);
    border: 1px solid rgba(20, 95, 120, 0.6);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 0 20px rgba(20, 95, 120, 0.2);
    text-align: center;
}

.single-step .step-content h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #ded9d8;
    font-weight: 600;
}

.single-step .input-container {
    max-width: 400px;
    margin: 0 auto 15px auto;
}

.single-step .receive-address {
    width: 100%;
    padding: 15px 20px;
    background: rgba(10, 18, 24, 0.8);
    border: 1px solid rgba(58, 95, 125, 0.5);
    border-radius: 8px;
    color: #ded9d8;
    font-size: 14px;
    font-family: 'Source Sans Pro', sans-serif;
    text-align: center;
    transition: all 0.3s ease;
}

.single-step .receive-address:focus {
    outline: none;
    border-color: rgba(20, 95, 120, 0.8);
    background: rgba(10, 18, 24, 0.9);
    box-shadow: 0 0 10px rgba(20, 95, 120, 0.3);
}

.single-step .validation-status {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 500;
}

.single-step .step-note {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 15px;
    font-style: italic;
}

/* Étape finale avec confirmation */
.final-step {
    background: rgba(27, 160, 128, 0.2);
    border-color: rgba(27, 160, 128, 0.6);
    box-shadow: 0 0 20px rgba(27, 160, 128, 0.2);
}

.address-label {
    color: #1ba080;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

.final-address {
    flex: 1;
    padding: 12px 15px;
    background: rgba(10, 18, 24, 0.8);
    border: 1px solid rgba(27, 160, 128, 0.5);
    border-radius: 8px;
    color: #ded9d8;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* Animation d'apparition des étapes développées */
#expanded-steps {
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Balance et refresh */
.balance-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.balance-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    flex: 1;
}

.balance-text {
    color: #1ba080;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Calibri', 'Segoe UI', sans-serif;
    text-align: center;
}

.refresh-btn {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid rgba(27, 160, 128, 0.3);
    color: rgba(27, 160, 128, 0.7);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 32px;
}

.refresh-btn:hover {
    background: rgba(27, 160, 128, 0.1);
    border-color: rgba(27, 160, 128, 0.5);
    color: #1ba080;
    transform: rotate(180deg);
}

.refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Tooltip avec pointillés */
.tooltip {
    position: relative;
    border-bottom: 1px dotted #ded9d8;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 18, 24, 0.95);
    color: #ded9d8;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(58, 95, 125, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Animation de déplacement de l'étape 4 */
#step-address-input {
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    order: 1;
}

#step-address-input.move-to-bottom {
    order: 4;
    transform: translateY(0);
}

.generation-steps {
    display: flex;
    flex-direction: column;
}

.step.slide-in {
    animation: slideInFromTop 0.6s ease-out forwards;
}

.step.slide-down {
    animation: slideDown 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-30px);
        max-height: 0;
        padding: 0 20px;
        margin: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
        padding: 20px;
        margin-bottom: 20px;
    }
}

@keyframes slideDown {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
        box-shadow: 0 10px 30px rgba(27, 160, 128, 0.4);
    }
    100% {
        transform: translateY(0);
        box-shadow: 0 0 20px rgba(27, 160, 128, 0.3);
    }
}

/* Masquer initialement les étapes 1, 2, 3 */
.step.hidden {
    display: none;
    max-height: 0;
    padding: 0 20px;
    margin: 0;
    opacity: 0;
    overflow: hidden;
}

.step.show {
    display: flex;
    animation: slideInFromTop 0.6s ease-out forwards;
}

/* Animation spécifique pour l'étape qui se déplace */
.step.moving-to-position {
    animation: moveToNewPosition 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes moveToNewPosition {
    0% {
        transform: translateY(0);
        order: 1;
    }
    50% {
        transform: translateY(20px) scale(0.98);
        box-shadow: 0 15px 40px rgba(27, 160, 128, 0.5);
    }
    100% {
        transform: translateY(0) scale(1);
        order: 4;
        box-shadow: 0 0 20px rgba(27, 160, 128, 0.3);
    }
}

@keyframes hourglass-spin {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
    100% { transform: rotate(360deg); }
}

/* Modal d'erreur centrée */
.error-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.2s ease;
}

.error-modal {
    background: linear-gradient(135deg, rgba(20, 20, 25, 0.98), rgba(30, 30, 35, 0.98));
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 12px;
    padding: 24px 28px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.error-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.error-modal-icon {
    font-size: 28px;
}

.error-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #ff6b6b;
    flex: 1;
}

.error-modal-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.error-modal-code {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.4);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #ff8888;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.error-modal-code-text {
    flex: 1;
    text-align: center;
}

.error-modal-copy-btn {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.5);
    border-radius: 4px;
    width: 32px;
    height: 75%;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.error-modal-copy-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    border-color: rgba(255, 107, 107, 0.7);
}

.error-modal-copy-btn:active {
    transform: scale(0.95);
}

.error-modal-copy-btn svg {
    width: 14px;
    height: 14px;
    stroke: #ff8888;
    fill: none;
    stroke-width: 2;
}

.error-modal-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #1ba080, #15876b);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.error-modal-button:hover {
    background: linear-gradient(135deg, #15876b, #1ba080);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27, 160, 128, 0.4);
}
