/* Container for the animation */
.success-animation {
    width: 180px;
    height: 180px;
    position: relative;
    margin: 30px auto 0 auto;
}

/* Circle */
.circle {
    width: 100%;
    height: 100%;
    border: 8px solid var(--bs-primary); /* Bootstrap's primary color variable */
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    animation: scaleCircle 1s ease-in-out;
}

/* Checkmark */
.checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100px;
    height: 100px;
    animation: drawCheckmark 0.5s ease-in-out 0.5s forwards;
}

.checkmark path {
    stroke: var(--bs-primary); /* Bootstrap's primary color variable */
    stroke-width: 8;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawPath 0.5s ease-in-out 0.5s forwards;
}

/* Keyframes for the circle scaling */
@keyframes scaleCircle {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Keyframes for the checkmark scaling */
@keyframes drawCheckmark {
    0% { transform: translate(-50%, -50%) scale(0); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Keyframes for the checkmark path drawing */
@keyframes drawPath {
    0% { stroke-dashoffset: 100; }
    100% { stroke-dashoffset: 0; }
}

/* Container for the error animation */
.error-animation {
    width: 180px;
    height: 180px;
    position: relative;
    margin: 30px auto 0 auto;
}

/* Circle for error */
.error-animation .circle {
    width: 100%;
    height: 100%;
    border: 8px solid var(--bs-danger); /* Bootstrap's danger color variable */
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    animation: scaleCircle 1s ease-in-out;
}

/* Crossmark (X) */
.error-animation .crossmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100px;
    height: 100px;
    animation: drawCrossmark 0.5s ease-in-out 0.5s forwards;
}

.error-animation .crossmark path {
    stroke: var(--bs-danger); /* Bootstrap's danger color variable */
    stroke-width: 8;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawPath 0.5s ease-in-out 0.5s forwards;
}

/* Keyframes for the circle scaling */
@keyframes scaleCircle {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Keyframes for the crossmark scaling */
@keyframes drawCrossmark {
    0% { transform: translate(-50%, -50%) scale(0); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Keyframes for the crossmark path drawing */
@keyframes drawPath {
    0% { stroke-dashoffset: 100; }
    100% { stroke-dashoffset: 0; }
}
